0

我正在尝试发布我们的 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 分钟以上才能完成。起初我以为roundhouseE可能会超时,但我尝试将超时设置得更高,但没有任何效果。

有人对这里发生的事情有任何见解吗?

这是脚本,如果有帮助的话:

   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;
4

1 回答 1

0

看起来我最初的直觉是正确的,问题是由查询超时引起的。

我在我们的构建脚本中编辑了超时长度,但忘记了 tfs 直接调用roundhouseE,并且没有在那里更改长度。这样做解决了这个问题。

于 2018-07-10T08:32:28.050 回答