{"record":{"id":"b7efbe7b20815aa0","repo":"coleam00/Archon","slug":"authentication-failed-for-projectpath-check-gi","errorCode":null,"errorMessage":"Authentication failed for ${projectPath}. Check GITLAB_TOKEN permissions.","messagePattern":"Authentication failed for (.+?)\\. Check GITLAB_TOKEN permissions\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/adapters/src/community/forge/gitlab/adapter.ts","lineNumber":513,"sourceCode":"        sanitizedError.cause = sanitize((err.cause as Error).message);\n      }\n      const errRecord = err as unknown as Record<string, unknown>;\n      if (typeof errRecord.stdout === 'string') sanitizedError.stdout = sanitize(errRecord.stdout);\n      if (typeof errRecord.stderr === 'string') sanitizedError.stderr = sanitize(errRecord.stderr);\n\n      getLog().error({ projectPath, repoPath, error: sanitizedError }, 'gitlab.repo_clone_failed');\n\n      if (msg.includes('not found') || msg.includes('404')) {\n        throw new Error(\n          `Repository ${projectPath} not found or is private. Check repository access.`\n        );\n      }\n      if (\n        msg.includes('authentication failed') ||\n        msg.includes('could not read') ||\n        msg.includes('403')\n      ) {\n        throw new Error(\n          `Authentication failed for ${projectPath}. Check GITLAB_TOKEN permissions.`\n        );\n      }\n      throw new Error(`Failed to clone ${projectPath}: ${sanitized}`);\n    }\n\n    await addSafeDirectory(toRepoPath(repoPath));\n  }\n\n  private async autoDetectAndLoadCommands(repoPath: string, codebaseId: string): Promise<void> {\n    const commandFolders = getCommandFolderSearchPaths();\n\n    for (const folder of commandFolders) {\n      try {\n        const fullPath = join(repoPath, folder);\n        await access(fullPath);\n\n        const files = (await readdir(fullPath)).filter(f => f.endsWith('.md'));","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/adapters/src/community/forge/gitlab/adapter.ts#L495-L531","documentation":"Error \"Authentication failed for ${projectPath}. Check GITLAB_TOKEN permissions.\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/adapters/src/community/forge/gitlab/adapter.ts:513 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}