n8n-io/n8n · warning
Project not found
Error message
Project not found
What it means
HTTP 404 with literal body 'Project not found' sent at folder.controller.ts:53 by the `validateProjectExists` middleware when `projectService.getProject(projectId)` throws (project missing or inaccessible in the current tenant). The middleware short-circuits with `res.status(404).send('Project not found')` before the route handler runs.
Source
Thrown at packages/cli/src/controllers/folder.controller.ts:53
export class ProjectController {
constructor(
private readonly folderService: FolderService,
private readonly enterpriseWorkflowService: EnterpriseWorkflowService,
private readonly projectService: ProjectService,
) {}
@Middleware()
async validateProjectExists(
req: AuthenticatedRequest<{ projectId: string }>,
res: Response,
next: NextFunction,
) {
try {
const { projectId } = req.params;
await this.projectService.getProject(projectId);
next();
} catch (e) {
res.status(404).send('Project not found');
return;
}
}
@Post('/')
@ProjectScope('folder:create')
@Licensed('feat:folders')
async createFolder(
req: AuthenticatedRequest<{ projectId: string }>,
_res: Response,
@Body payload: CreateFolderDto,
) {
const { projectId } = req.params;
try {
const folder = await this.folderService.createFolder(payload, projectId);
return folder;
} catch (e) {View on GitHub (pinned to 5ac6606e81)
Solutions
- Verify the project exists and the caller has access: `GET /projects/<projectId>`.
- Refresh the parent project list in the UI and re-issue the folder request against a valid ID.
- Audit for deleted projects whose IDs still appear in client state/bookmarks.
Defensive patterns
Strategy: validation
Validate before calling
async function projectExists(svc: ProjectService, id: string) {
try { await svc.getProject(id); return true; } catch { return false; }
}
// gate folder calls on projectExists(...) Try / catch
const r = await fetch(`/projects/${pid}/folders`);
if (r.status === 404) { /* refresh project list, re-issue with valid pid */ } Prevention
- Cache the current project list and invalidate on project delete.
- Validate :projectId at the client before any folder action.
- Surface 404 'Project not found' as 'project was deleted' rather than a hard error.
When it happens
Trigger: Any folder route under a `:projectId` path where the project doesn't exist, was deleted, or isn't visible to the caller's scope. The middleware runs before `@ProjectScope` enforcement completes the lookup.
Common situations: Stale project ID in a bookmarked URL; project deleted between page load and folder action; cross-tenant access attempts; typos in manually constructed URLs.
Related errors
- Could not find the folder: ${folderId}
- error.message
- Internal Server Error
- File not found: ${path}
- Down migration only possible when there are no projects. Ple
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/cc4276844ee75ddb.
Report an issue: GitHub.