我正在尝试发布我们的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;
答案 0 :(得分:0)
看起来我的原始直觉是正确的,并且问题是由查询超时引起的。
我已经在构建脚本中编辑了超时长度,但是忘记了tfs直接调用roundhousE,并且在那里没有更改长度。这样做解决了这个问题。