New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CockroachDB TransactionRetryWithProtoRefreshError on Collection Creation when using System Default fields #21424
Comments
Using: Same issue on CockroachDB v23.1.14 (docker image cockroachdb/cockroach:v23.1.14) ERROR: COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 149} {articles 137 1}], old versions still in use
err: {
"type": "DatabaseError",
"message": "COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 149} {articles 137 1}], old versions still in use",
"stack":
error: COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 149} {articles 137 1}], old versions still in use
at Parser.parseErrorMessage (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
"length": 289,
"name": "error",
"severity": "ERROR",
"code": "40001",
"hint": "See: https://www.cockroachlabs.com/docs/v23.1/transaction-retry-error-reference.html"
} Same issue on v22.2.18 (docker image cockroachdb/cockroach:v22.2.18). ERROR: COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 149} {articles 137 1}], old versions still in use
err: {
"type": "DatabaseError",
"message": "COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 149} {articles 137 1}], old versions still in use",
"stack":
error: COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 149} {articles 137 1}], old versions still in use
at Parser.parseErrorMessage (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
"length": 289,
"name": "error",
"severity": "ERROR",
"code": "40001",
"hint": "See: https://www.cockroachlabs.com/docs/v22.2/transaction-retry-error-reference.html"
} Same issue on v22.1.22 (docker image cockroachdb/cockroach:v22.1.22). ERROR: COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 124} {articles 137 1}], old versions still in use
err: {
"type": "DatabaseError",
"message": "COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 124} {articles 137 1}], old versions still in use",
"stack":
error: COMMIT; - restart transaction: TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: [{directus_users 106 124} {articles 137 1}], old versions still in use
at Parser.parseErrorMessage (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
"length": 289,
"name": "error",
"severity": "ERROR",
"code": "40001",
"hint": "See: https://www.cockroachlabs.com/docs/v22.1/transaction-retry-error-reference.html"
} |
Sounds like it may no longer be fully compatible with the |
I am having similar issues see below with Planetscale (mysql). Neon and Supabase working fine they both use postgres.
|
Did further testing with prior versions of Directus (docker images). 9.20.4 and 9.21.0 (11/17/2022) work (with the latest version of CockroachDB, v23.2.1), but all later versions of Directus are failing to create a new collection on CockroachDB without the TransactionRetryWithProtoRefreshError error. Looks like something introduced in 9.21.1 (from 11/28/2022, no docker image available) caused it to fail. 9.21.2 was just a markdown update, but does have a docker image available. Appears the "9.21" docker image was published 11/28 and is based on 9.21.2. Hoping someone can look into these changes from 9.21.1, find and fix whatever broke CockroachDB compatibility for over a year. v9.21.1 (November 28, 2022) 🚀 Improvements
🐛 Bug Fixes
🧽 Optimizations
|
Describe the Bug
CockroachDB bootstrap works, but transaction error occurs when trying to create a new collection.
To Reproduce
Setup CockroachDB:
docker network create private mkdir -p crdb/data docker run -it --rm \ --name=crdb --hostname=crdb \ --net=private -p 26257:26257 -p 8080:8080 \ -v ${PWD}/crdb/data:/cockroach/cockroach-data \ --entrypoint /cockroach/cockroach \ cockroachdb/cockroach:v23.2.0 \ start-single-node \ --insecure \ --listen-addr=crdb:26257 \ --http-addr=crdb:8080
Setup MinIO:
Add bucket to MinIO:
Setup Mailhog:
Add directories for Directus:
Configure Directus - directus/env.txt:
Setup Directus:
http://localhost:8055
[email protected]
password
Add collection
articles, id = generate uuid, next
check all options, save
Transaction error is received.
Collection is still created - but not sure what (if anything important) is missing/messed up.
I also tried using the Postgres driver instead of native CockroachDB driver to connect to crdb node.
It can't complete the initial bootstrap - fails with on an unsupported ALTER TABLE command.
Clear folders:
directus/env.txt:
and re-running each of the docker run commands...
Got the following error(s):
The recommendation to enable the experimental ALTER TABLE feature only works for the current session, so needed to find a way to enable globally:
Clearing the CRDB data and starting over, with the global ALTER TABLE setting changed....
That got a little further, but still err'd out in the bootstrap initialization:
For the record, regular Postgres works fine for both bootstrap initialization and adding a new collection.
mkdir -p postgres/data docker run -it --rm \ --name=postgres --hostname=postgres \ --net=private -p 5432:5432 \ -v ${PWD}/postgres/data:/var/lib/postgresql/data \ -e POSTGRES_USER=directus_user \ -e POSTGRES_DB=directus \ -e POSTGRES_PASSWORD=password \ postgres:16.2-alpine3.19
directus/env.txt:
Directus Version
v10.9.1
Hosting Strategy
Self-Hosted (Docker Image)
The text was updated successfully, but these errors were encountered: