jmls
October 29, 2024, 8:58am
1
Describe the problem/error/question
Getting numerous and odd error messages in the execution log in QUEUE mode
What is the error message (if any)?
The execution log has errors like
|Stock Information|Starting soon|Error in 28830759:43m (Success retry #22375 )
The actual node getting the error is the “Execute Workflow node version 1 (Latest version: 1.1)”
Error is "column ProjectRelation__ProjectRelation_user.apiKey does not exist
"
We recently upgraded from 1.52.0 to 1.62.4 where there was a db upgrade that moved apiKey from the user table to the user_apikey table
Please share your workflow
Unfortunately I cannot
Information on your n8n setup
n8n version: 1.62.4
Database (default: SQLite): postgres
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Operating system: Ubuntu
jmls
October 29, 2024, 10:05am
2
some further error info from the node output
n8n version
1.62.4 (Self Hosted)
Stack trace
QueryFailedError: column ProjectRelation__ProjectRelation_user.apiKey does not exist at PostgresQueryRunner.query (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected] _@[email protected] [email protected] [email protected] [email protected] [email protected] _rg7pzssmsoyrgkymlglpgzi36a/node_modules/src/driver/postgres/PostgresQueryRunner.ts:331:19) at processTicksAndRejections (node:internal/process/task_queues:95:5) at SelectQueryBuilder.loadRawResults (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected] _@[email protected] [email protected] [email protected] [email protected] [email protected] _rg7pzssmsoyrgkymlglpgzi36a/node_modules/src/query-builder/SelectQueryBuilder.ts:3805:25) at SelectQueryBuilder.executeEntitiesAndRawResults (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected] _@[email protected] [email protected] [email protected] [email protected] [email protected] _rg7pzssmsoyrgkymlglpgzi36a/node_modules/src/query-builder/SelectQueryBuilder.ts:3551:26) at SelectQueryBuilder.getRawAndEntities (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected] _@[email protected] [email protected] [email protected] [email protected] [email protected] _rg7pzssmsoyrgkymlglpgzi36a/node_modules/src/query-builder/SelectQueryBuilder.ts:1670:29) at SelectQueryBuilder.getMany (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@[email protected] _@[email protected] [email protected] [email protected] [email protected] [email protected] _rg7pzssmsoyrgkymlglpgzi36a/node_modules/src/query-builder/SelectQueryBuilder.ts:1760:25) at ProjectRelationRepository.getPersonalProjectOwners (/usr/local/lib/node_modules/n8n/dist/databases/repositories/project-relation.repository.js:21:16) at OwnershipService.getPersonalProjectOwnerCached (/usr/local/lib/node_modules/n8n/dist/services/ownership.service.js:44:26) at PermissionChecker.check (/usr/local/lib/node_modules/n8n/dist/user-management/permission-checker.js:26:34) at Object.executeWorkflow (/usr/local/lib/node_modules/n8n/dist/workflow-execute-additional-data.js:561:9)
thing is user.apiKey does not exist in 1.62.4 … so where is it coming from ?
ria
October 29, 2024, 1:04pm
3
Hi @jmls
We released a db migration fix with 1.62.3
but since you’ve updated from 1.52.0
this is a big jump and it may need a restart of your instance.
Alternatively you can update to the latest again (1.64.3
). That should also trigger the db migration and remove the user.apiKey
error logs.
n8n-io:master
← n8n-io:add-down-method-to-add-apikeys-migration
opened 04:19PM - 05 Oct 24 UTC
## Summary
See context here -> https://n8nio.slack.com/archives/C069HS026UF/p… 1728054310275989
## To test:
1. Checkout PR - `gh pr checkout 11118`
2. Install, build and start n8n.
3. Create API key in the UI
4. Run db:revert CLI command (in CLI package do: `(cd bin && ./n8n db:revert)`) - You need to do it twice, as this command only revert the last migration and a migration was added after `AddApiKeysTable1724951148974 `
5. Check the `user` table and notice the `apiKey` column has the right value and the `user_api_keys` table is deleted.
6. Check out in the n8n version before adding the migration (`git checkout tags/[email protected] `) and start n8n again (build again)
7. Check that the same API is still in the UI.
8. Test API key (```curl --location 'http://localhost:5678/api/v1/users' \ --header 'X-N8N-API-KEY: you api key'```)
9. Delete API key, and create a new one.
## Review / Merge checklist
- [x] PR title and summary are descriptive. ([conventions](../blob/master/.github/pull_request_title_conventions.md)) <!--
**Remember, the title automatically goes into the changelog.
Use `(no-changelog)` otherwise.**
-->
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created.
- [ ] Tests included. <!--
A bug is not considered fixed, unless a test is added to prevent it from happening again.
A feature is not complete without tests.
-->
- [ ] PR Labeled with `release/backport` (if the PR is an urgent fix that needs to be backported)
Let us know if this fixes it!
1 Like
jmls
October 29, 2024, 1:18pm
4
our postgres database has been migrated - there is no apiKey on the user table, amd there’s a user_apikey table now
The error is that the node is complaining that it can’t find the user.apiKey - which is obvious, as the migration has removed it !
jmls
October 29, 2024, 1:19pm
5
we have also restarted the instance several times. This is a self-hosted stack running uder docker
ria
November 1, 2024, 5:14am
6
Hi @jmls
Can you please try to update your instance once again and also update the node version of the Execute Workflow
node? (Just add a new node from the nodes panel and replace the old one)
Please let us know if that helped
jltts
November 3, 2024, 1:30pm
7
I faced the same error. In my case I was on version 1.58.0
self-hosted in docker swarm. Changing to version 1.64.3
, prune services, re-pull image and redeploy stack solved my issue.
1 Like
system
Closed
February 1, 2025, 1:30pm
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.