Open worldspawn opened 3 months ago
It ran successfully with transactions off.
@worldspawn I am also getting this error; any solutions other than to run with transactions off?
We had the same issue and it seems to be the TransactionScope default timeout of 1 minute being hit. See System.Transaction defaults from source code and TransactionManager.DefaultTimeout Property.
Changing the default timeout to something higher when creating the new TransactionScope worked for us: use one of the constructors taking a timespan TransactionScope Constructors in place of the one on line 139 in GrateMigrator.cs. Could for example be
GrateMigrator.cs:137-140
if (runInTransaction)
{
// with timeout of 5 minutes
scope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(0,5,0), TransactionScopeAsyncFlowOption.Enabled);
// original
scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled);
}
Note that if the argument to the constructor is greater than the DefaultMaxTimeout of 10 minutes then the DefaultMaxTimeout will be used. This can however be overwritten (without reflection hacks) since they added a setter to TransactionManager.DefaultMaxTimeout (and DefaultTimeout) in 71703.
Perhaps this transaction issue in grate can be fixed by adding an additional parameter similar to the current commandtimeout
and admincommandtimeout
that controls the default transaction timeout. It is conterintuitive that running grate as a transaction will timeout for all migrations taking > 60s, even in cases where the commandtimeout
is > 60s.
We experience the same issue as @Jackietf describes.
Thanks for sharing @Jackietf, I'm running into the same issue.
Describe the bug On only one environment we are unable to migrate our latest script. The script itself appears to run but then it chokes in "InsertScriptRun"
To Reproduce Unsure of the cause. Same migration worked on all our other environments. We can also run the script itself against the target env (with a rollback) with no issues. The script contains no BEGIN TRAN/ROLLBACK or anything transaction related.
Expected behavior My database is grated
Screenshots
Desktop (please complete the following information):
Additional context command run:
Verbose log output: