Skip to content
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

SSO upsert constraint issue #768

Open
ericlinagora opened this issue Dec 14, 2024 · 0 comments
Open

SSO upsert constraint issue #768

ericlinagora opened this issue Dec 14, 2024 · 0 comments
Assignees

Comments

@ericlinagora
Copy link
Contributor

{"level":"ERROR","time":1734072860111,"pid":18,"hostname":"tdrive-backend-6bcbd8b997-fx2fc","name":"TdriveApp","request_id":"req-ahsm","err":{"type":"DatabaseError","message":"syntax error at or near \"WHERE\"","stack":"error: syntax error at or near \"WHERE\"\n    at /usr/src/app/node_modules/pg/lib/client.js:526:17\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async PostgresConnector.executeRaw (/usr/src/app/dist/core/platform/services/database/services/orm/connectors/postgres/postgres.js:242:20)\n    at async PostgresConnector.execute (/usr/src/app/dist/core/platform/services/database/services/orm/connectors/postgres/postgres.js:250:24)\n    at async PostgresConnector.upsertOne (/usr/src/app/dist/core/platform/services/database/services/orm/connectors/postgres/postgres.js:212:19)\n    at async Promise.all (index 0)\n    at async EntityManager.persist (/usr/src/app/dist/core/platform/services/database/services/orm/manager.js:60:13)\n    at async Repository.save (/usr/src/app/dist/core/platform/services/database/services/orm/repository/repository.js:81:9)\n    at async UserServiceImpl.updateExtRepository (/usr/src/app/dist/services/user/services/users/service.js:72:13)\n    at async UserServiceImpl.save (/usr/src/app/dist/services/user/services/users/service.js:96:9)\n    at async ConsoleRemoteClient.updateLocalUserFromConsole (/usr/src/app/dist/services/console/clients/remote.js:142:9)\n    at async ConsoleController.authByToken (/usr/src/app/dist/services/console/web/controller.js:233:22)\n    at async ConsoleController.auth (/usr/src/app/dist/services/console/web/controller.js:26:36)","length":94,"name":"error","severity":"ERROR","code":"42601","position":"70","file":"scan.l","line":"1242","routine":"scanner_yyerror"},"msg":"services.database.orm.postgres - Error with SQL query: UPDATE \"external_user_repository\" \n              SET  \n              WHERE service_id = $1 AND external_id = $2 AND user_id = $3  \n               "}

and

{"level":"ERROR","time":1734072860118,"pid":18,"hostname":"tdrive-backend-6bcbd8b997-fx2fc","name":"TdriveApp","request_id":"req-ahsm","err":{"type":"DatabaseError","message":"duplicate key value violates unique constraint \"external_user_repository_pkey\"","stack":"error: duplicate key value violates unique constraint \"external_user_repository_pkey\"\n    at /usr/src/app/node_modules/pg/lib/client.js:526:17\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async PostgresConnector.executeRaw (/usr/src/app/dist/core/platform/services/database/services/orm/connectors/postgres/postgres.js:242:20)\n    at async PostgresConnector.execute (/usr/src/app/dist/core/platform/services/database/services/orm/connectors/postgres/postgres.js:250:24)\n    at async Promise.all (index 0)\n    at async EntityManager.persist (/usr/src/app/dist/core/platform/services/database/services/orm/manager.js:60:13)\n    at async Repository.save (/usr/src/app/dist/core/platform/services/database/services/orm/repository/repository.js:81:9)\n    at async UserServiceImpl.updateExtRepository (/usr/src/app/dist/services/user/services/users/service.js:72:13)\n    at async UserServiceImpl.save (/usr/src/app/dist/services/user/services/users/service.js:96:9)\n    at async ConsoleRemoteClient.updateLocalUserFromConsole (/usr/src/app/dist/services/console/clients/remote.js:142:9)\n    at async ConsoleController.authByToken (/usr/src/app/dist/services/console/web/controller.js:233:22)\n    at async ConsoleController.auth (/usr/src/app/dist/services/console/web/controller.js:26:36)","length":338,"name":"error","severity":"ERROR","code":"23505","detail":"Key (service_id, external_id, user_id)=(console, [redacted email], 134ad210-b91f-11ef-aa57-c70daf2b13ba) already exists.","schema":"public","table":"external_user_repository","constraint":"external_user_repository_pkey","file":"nbtinsert.c","line":"666","routine":"_bt_check_unique"},"msg":"services.database.orm.postgres - Error with SQL query: INSERT INTO \"external_user_repository\" (service_id, external_id, user_id)\n              VALUES ($1, $2, $3)"}
@ericlinagora ericlinagora self-assigned this Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant