{"record":{"id":"3ff619e0dfe0c55b","repo":"can1357/oh-my-pi","slug":"unable-to-find-a-gitlab-duo-workflow-namespace-se","errorCode":null,"errorMessage":"Unable to find a GitLab Duo Workflow namespace. Set GITLAB_DUO_NAMESPACE_ID to a root namespace or GITLAB_DUO_PROJECT_ID to a GitLab project.","messagePattern":"Unable to find a GitLab Duo Workflow namespace\\. Set GITLAB_DUO_NAMESPACE_ID to a root namespace or GITLAB_DUO_PROJECT_ID to a GitLab project\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/catalog/src/discovery/gitlab-duo-workflow.ts","lineNumber":151,"sourceCode":"): Promise<GitLabDuoWorkflowNamespaceSelection> {\n\tconst selection = await selectGitLabDuoWorkflowNamespace(config);\n\treturn {\n\t\trootNamespaceId: selection.rootNamespaceId,\n\t\t...(selection.namespacePath ? { namespacePath: selection.namespacePath } : {}),\n\t\t...(selection.projectPath ? { projectPath: selection.projectPath } : {}),\n\t\tsource: selection.source,\n\t};\n}\n\nexport async function discoverGitLabDuoWorkflowRuntimeNamespace(\n\tconfig: GitLabDuoWorkflowDiscoveryConfig,\n): Promise<GitLabDuoWorkflowNamespaceSelection> {\n\tconst baseUrl = normalizeGitLabBaseUrl(config.baseUrl);\n\tconst selection = await selectGitLabDuoWorkflowCandidate(config, baseUrl, resolveRuntimeNamespaceCandidate, true);\n\tif (selection) {\n\t\treturn selection;\n\t}\n\tthrow new Error(\n\t\t\"Unable to find a GitLab Duo Workflow namespace. Set GITLAB_DUO_NAMESPACE_ID to a root namespace or GITLAB_DUO_PROJECT_ID to a GitLab project.\",\n\t);\n}\n\nexport async function fetchGitLabDuoWorkflowModels(\n\tconfig: GitLabDuoWorkflowDiscoveryConfig,\n): Promise<readonly ModelSpec<\"gitlab-duo-agent\">[] | null> {\n\tconst selection = await discoverGitLabDuoWorkflowNamespace(config);\n\tconst baseUrl = normalizeGitLabBaseUrl(config.baseUrl);\n\tconst availability = await fetchAiChatAvailableModels(config, baseUrl, selection.rootNamespaceId);\n\tif (!availability) {\n\t\treturn null;\n\t}\n\tconst modelRefs = resolveModelRefs(availability);\n\tif (modelRefs.length === 0) {\n\t\treturn null;\n\t}\n\treturn modelRefs.map(model => buildGitLabDuoWorkflowModelSpec(model, baseUrl, selection.rootNamespaceId));","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/catalog/src/discovery/gitlab-duo-workflow.ts#L133-L169","documentation":"Thrown by discoverGitLabDuoWorkflowRuntimeNamespace when no GitLab Duo Workflow namespace candidate could be resolved: neither the explicit env configuration nor the runtime candidate resolver yielded a selection. The library needs a root namespace (GITLAB_DUO_NAMESPACE_ID) or a project (GITLAB_DUO_PROJECT_ID) to discover Duo Workflow models.","triggerScenarios":"Calling fetchGitLabDuoWorkflowModels/discovery with config lacking GITLAB_DUO_NAMESPACE_ID and GITLAB_DUO_PROJECT_ID, or with ids pointing at groups/subgroups that are not root namespaces or not Duo-enabled projects.","commonSituations":"Running against gitlab.com or self-hosted GitLab without Duo Workflow entitlement; GITLAB_DUO_PROJECT_ID pointing at a personal (non-group) project path; token lacking the api scope to enumerate namespaces.","solutions":["Set GITLAB_DUO_PROJECT_ID to a GitLab project with Duo Workflow enabled.","Or set GITLAB_DUO_NAMESPACE_ID to a root namespace that has Duo model access.","Verify GITLAB_TOKEN has api scope and Duo Workflow is enabled for the account/instance."],"exampleFix":"// before\nGITLAB_TOKEN=glpat-...\n// after\nGITLAB_TOKEN=glpat-...\nGITLAB_DUO_PROJECT_ID=my-group/my-project","handlingStrategy":"validation","validationCode":"const env = process.env;\nif (!env.GITLAB_DUO_NAMESPACE_ID && !env.GITLAB_DUO_PROJECT_ID) {\n  throw new Error(\"Set GITLAB_DUO_NAMESPACE_ID (root namespace) or GITLAB_DUO_PROJECT_ID before GitLab Duo discovery\");\n}","typeGuard":"null","tryCatchPattern":"try {\n  const models = await fetchGitLabDuoWorkflowModels(config);\n} catch (err) {\n  if (err.message.startsWith(\"Unable to find a GitLab Duo Workflow namespace\")) {\n    logger.error(\"GitLab Duo namespace not configured\", { hasNamespace: !!process.env.GITLAB_DUO_NAMESPACE_ID });\n  }\n  throw err;\n}","preventionTips":["Set GITLAB_DUO_PROJECT_ID or GITLAB_DUO_NAMESPACE_ID in CI/local env before discovery.","Use a root namespace id, not a subgroup.","Confirm the token has api scope and the namespace has Duo Workflow enabled."],"tags":["gitlab","discovery","configuration","env"],"backgroundTag":"missing-gitlab-namespace-config","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}