{"record":{"id":"2ae828b29681661b","repo":"n8n-io/n8n","slug":"could-not-find-a-personal-project-for-this-user","errorCode":null,"errorMessage":"Could not find a personal project for this user","messagePattern":"Could not find a personal project for this user","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"packages/cli/src/controllers/project.controller.ts","lineNumber":200,"sourceCode":"\n\t\t\tresults.push(result);\n\t\t}\n\n\t\t// Deduplicate and sort scopes\n\t\tfor (const result of results) {\n\t\t\tif (result.scopes) {\n\t\t\t\tresult.scopes = [...new Set(result.scopes)].sort();\n\t\t\t}\n\t\t}\n\n\t\treturn results;\n\t}\n\n\t@Get('/personal')\n\tasync getPersonalProject(req: AuthenticatedRequest) {\n\t\tconst project = await this.projectsService.getPersonalProject(req.user);\n\t\tif (!project) {\n\t\t\tthrow new NotFoundError('Could not find a personal project for this user');\n\t\t}\n\n\t\tconst relation = await this.projectsService.getProjectRelationForUserAndProject(\n\t\t\treq.user.id,\n\t\t\tproject.id,\n\t\t);\n\t\tconst scopes: Scope[] = [\n\t\t\t...combineScopes({\n\t\t\t\tglobal: getAuthPrincipalScopes(req.user),\n\t\t\t\tproject: relation?.role.scopes.map((scope) => scope.slug) ?? [],\n\t\t\t}),\n\t\t];\n\t\treturn {\n\t\t\t...project,\n\t\t\tscopes,\n\t\t\t// Personal projects have a single owner and are never subject to managed team roles.\n\t\t\trolesManaged: false,\n\t\t};","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/controllers/project.controller.ts#L182-L218","documentation":"The personal-project endpoint expects every user to have exactly one personal project. If projectsService.getPersonalProject(req.user) returns undefined, the endpoint responds 404 'Could not find a personal project for this user'.","triggerScenarios":"GET /personal for a user who has no personal project record (getPersonalProject returned undefined).","commonSituations":"User created before the personal-project provisioning feature (or before the migration that backfills personal projects ran); the user's personal project record was deleted; owner/instance setup did not complete project provisioning.","solutions":["Run the personal-project provisioning/migration so every existing user gets a personal project.","Re-trigger project creation for the affected user (e.g. re-run owner setup / user sync).","Confirm the user record is intact and not in a partially-deleted state in the DB."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// No pure caller pre-check; ensure provisioning ran. Caller can verify a personal project exists via the same endpoint and handle 404 gracefully.","typeGuard":null,"tryCatchPattern":"try {\n  await api.get('/projects/personal');\n} catch (e) {\n  if (e.status === 404 && /Could not find a personal project/.test(e.message)) {\n    // trigger/re-run personal-project provisioning for the user, then retry\n  } else { throw e; }\n}","preventionTips":["Run the personal-project migration/provisioning on upgrade.","Confirm owner setup completes project creation for new users."],"tags":["projects","migration","provisioning"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}