Hi everyone!
I'm running a nushell script through cbsh to update data in multiple collections at once with a transaction. It works perfectly fine in our development database, but for some reason fails in the production with the following error:
[INFO] 2025-05-30 13:00:55.764 Ending transaction
Error: × Unknown query error
╭─[<my script>.nu:37:5]
36 │
37 │ query transactions "COMMIT WORK;"
· ─────────┬────────
· ╰──
38 │ }
╰────
help: Received error from query engine, message: "Failed post commit", code: 17018
It looks very much like TransactionCommitAmbiguousException, because the changes are actually applied, though it might take some time as for larger data to get updated (replication?) – I keep getting old results from the repl / Query Workbench.
The script looks like this:
query transactions "BEGIN WORK;"
for collection in $collections {
let update_query = $"UPDATE ($collection) SET ... WHERE ... RETURNING META().id"
let result = query transactions $update_query
print $"Updated ($result | length) documents in ($collection)"
}
query transactions "COMMIT WORK;"
It seems like a bug, but I'm not sure that this repo is the right place to refer to. Any help or directions are appreciated 🙏
Hi everyone!
I'm running a nushell script through
cbshto update data in multiple collections at once with a transaction. It works perfectly fine in our development database, but for some reason fails in the production with the following error:It looks very much like
TransactionCommitAmbiguousException, because the changes are actually applied, though it might take some time as for larger data to get updated (replication?) – I keep getting old results from the repl / Query Workbench.The script looks like this:
It seems like a bug, but I'm not sure that this repo is the right place to refer to. Any help or directions are appreciated 🙏