我正在尝试发布我们的web应用程序(使用tfs部署到Azure),但我一直收到一个我无法理解的错误:
2018-07-10T07:07:27.7518609Z RoundhousE encountered an error. You were running in a transaction though, so the database should be in the state it was in prior to this piece running. This does not include a drop/create or any creation of a database, as those items can not run in a transaction.
2018-07-10T07:07:27.7520033Z System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
2018-07-10T07:07:27.7520928Z at System.Data.SqlClient.SqlTransaction.ZombieCheck()
2018-07-10T07:07:27.7521739Z at System.Data.SqlClient.SqlTransaction.Rollback()
2018-07-10T07:07:27.7522799Z at roundhouse.databases.AdoNetDatabase.rollback()
2018-07-10T07:07:27.7523835Z at roundhouse.migrators.DefaultDatabaseMigrator.run_sql(String sql_to_run, String script_name, Boolean run_this_script_once, Boolean run_this_script_every_time, Int64 version_id, EnvironmentSet environment_set, String repository_version, String repository_path, ConnectionType connection_type)
2018-07-10T07:07:27.7525261Z at roundhouse.runners.RoundhouseMigrationRunner.traverse_files_and_run_sql(String directory, Int64 version_id, MigrationsFolder migration_folder, EnvironmentSet migrating_environment_set, String repository_version, ConnectionType connection_type)
2018-07-10T07:07:27.7526355Z at roundhouse.runners.RoundhouseMigrationRunner.log_and_traverse(MigrationsFolder folder, Int64 version_id, String new_version, ConnectionType connection_type)
2018-07-10T07:07:27.7527288Z at roundhouse.runners.RoundhouseMigrationRunner.run()
2018-07-10T07:07:27.7535389Z This SqlTransaction has completed; it is no longer usable.
2018-07-10T07:07:27.7536462Z System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
2018-07-10T07:07:27.7537385Z at System.Data.SqlClient.SqlTransaction.ZombieCheck()
2018-07-10T07:07:27.7538815Z at System.Data.SqlClient.SqlTransaction.Rollback()
2018-07-10T07:07:27.7539676Z at roundhouse.databases.AdoNetDatabase.rollback()
2018-07-10T07:07:27.7540661Z at roundhouse.migrators.DefaultDatabaseMigrator.run_sql(String sql_to_run, String script_name, Boolean run_this_script_once, Boolean run_this_script_every_time, Int64 version_id, EnvironmentSet environment_set, String repository_version, String repository_path, ConnectionType connection_type)
2018-07-10T07:07:27.7541750Z at roundhouse.runners.RoundhouseMigrationRunner.traverse_files_and_run_sql(String directory, Int64 version_id, MigrationsFolder migration_folder, EnvironmentSet migrating_environment_set, String repository_version, ConnectionType connection_type)
2018-07-10T07:07:27.7542995Z at roundhouse.runners.RoundhouseMigrationRunner.log_and_traverse(MigrationsFolder folder, Int64 version_id, String new_version, ConnectionType connection_type)
2018-07-10T07:07:27.7543950Z at roundhouse.runners.RoundhouseMigrationRunner.run()
2018-07-10T07:07:27.7544856Z at roundhouse.console.Program.run_migrator(ConfigurationPropertyHolder configuration)
2018-07-10T07:07:27.7545759Z at roundhouse.console.Program.Main(String[] args)
2018-07-10T07:07:29.8091395Z ##[error]Process completed with exit code 1.在部署本地或我们的演示环境时,从未发生过这种情况。在尝试执行相同的简单SQL脚本时总是会发生这种情况,这是第五个需要运行的脚本。脚本从SSMS到生产数据库的副本运行良好,但需要10分钟以上才能完成。起初,我认为roundhousE可能会超时,但我尝试将超时设置得更高,但没有任何效果。
有人对这里发生了什么有任何洞察力吗?
这是脚本,如果这有帮助的话:
UPDATE ut
SET ut.IsX = t.IsX
FROM UserTasks ut
INNER JOIN Procedures p
ON ut.ProcedureID = p.ID
INNER JOIN Types t
ON p.TypeID = t.ID;发布于 2018-07-10 08:32:28
看起来我原来的直觉是正确的,这个问题是由查询超时引起的。
我在构建脚本中编辑了超时长度,但忘记了tfs直接调用roundhousE,也没有更改长度。这样做解决了这个问题。
https://stackoverflow.com/questions/51259837
复制相似问题