{"record":{"id":"fd25942d700a382e","repo":"jackwener/OpenCLI","slug":"missing-label","errorCode":null,"errorMessage":"Missing ${label}","messagePattern":"Missing (.+?)","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"clis/_atlassian/shared.js","lineNumber":25,"sourceCode":"    ConfigError,\n    EmptyResultError,\n} from '@jackwener/opencli/errors';\n\nconst USER_AGENT = 'opencli-atlassian-adapter (+https://github.com/jackwener/opencli)';\nconst DEPLOYMENTS = new Set(['cloud', 'datacenter', 'auto']);\n\nfunction firstEnv(names) {\n    for (const name of names) {\n        const value = process.env[name]?.trim();\n        if (value) return value;\n    }\n    return '';\n}\n\nfunction normalizeBaseUrl(value, label) {\n    const raw = String(value ?? '').trim();\n    if (!raw) {\n        throw new ConfigError(`Missing ${label}`, `Set ${label}, for example https://example.atlassian.net`);\n    }\n    let parsed;\n    try {\n        parsed = new URL(raw);\n    } catch {\n        throw new ConfigError(`Invalid ${label}: ${raw}`, 'Use an absolute http(s) URL.');\n    }\n    if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {\n        throw new ConfigError(`Invalid ${label}: ${raw}`, 'Use an http(s) URL.');\n    }\n    parsed.hash = '';\n    parsed.search = '';\n    return parsed.toString().replace(/\\/+$/, '');\n}\n\nfunction parseDeployment(raw, baseUrl) {\n    const value = String(raw || 'auto').trim().toLowerCase();\n    if (!DEPLOYMENTS.has(value)) {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/_atlassian/shared.js#L7-L43","documentation":"This ConfigError is thrown by normalizeBaseUrl() in clis/_atlassian/shared.js when the Atlassian base URL value (after trimming) is empty — i.e. no site URL was provided via config or environment (e.g. ATLASSIAN_SITE / ATLASSIAN_BASE_URL). The label in the message tells you which variable to set (e.g. \"Missing ATLASSIAN_SITE\").","triggerScenarios":"Running any Atlassian (Confluence/Jira) command without the base URL configured: env var unset or whitespace-only, config file missing the site key, or passing an empty string explicitly.","commonSituations":"Fresh install without copying the .env example, CI pipeline missing the secret/env var, typo'd env var name so the lookup falls through to empty, or .env file not loaded in the runtime.","solutions":["Set the base URL environment variable named in the message, e.g. ATLASSIAN_SITE=https://example.atlassian.net","If using a config file, add the site/base-url key the label refers to","In CI, verify the secret is defined and exported with the exact env var name","Check that your .env file is actually loaded (correct working directory / dotenv setup)"],"exampleFix":"// before\nexport ATLASSIAN_SITE=\"\"        # Missing ATLASSIAN_SITE\n// after\nexport ATLASSIAN_SITE=\"https://example.atlassian.net\"","handlingStrategy":"validation","validationCode":"const site = process.env.ATLASSIAN_SITE ?? '';\nif (!site.trim()) throw new Error('Set ATLASSIAN_SITE, e.g. https://example.atlassian.net');","typeGuard":"const hasBaseUrl = (v) => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":"try {\n  return await cli.call('confluence.search', { cql });\n} catch (e) {\n  if (e instanceof ConfigError && /^Missing /.test(e.message)) {\n    console.error('Configure your Atlassian base URL first, e.g. export ATLASSIAN_SITE=https://example.atlassian.net');\n  }\n  throw e;\n}","preventionTips":["Set ATLASSIAN_SITE in .env and commit a .env.example","Validate required env vars at script startup with a preflight check","Use the exact env var name from the error message label"],"tags":["configuration","missing-env-var","atlassian","setup"],"backgroundTag":"missing-env-var","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}