{"record":{"id":"5d044e4e8ea5ea9b","repo":"BerriAI/litellm","slug":"bitbucket-config-is-required-for-bitbucket-prompt","errorCode":null,"errorMessage":"bitbucket_config is required for BitBucket prompt integration","messagePattern":"bitbucket_config is required for BitBucket prompt integration","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/bitbucket/__init__.py","lineNumber":41,"sourceCode":"                - workspace: BitBucket workspace name\n                - repository: Repository name\n                - access_token: BitBucket access token\n                - branch: Branch to fetch prompts from (default: main)\n    \"\"\"\n    import litellm\n\n    litellm.global_bitbucket_config = config\n\n\ndef prompt_initializer(litellm_params: \"PromptLiteLLMParams\", prompt_spec: \"PromptSpec\") -> \"CustomPromptManagement\":\n    \"\"\"\n    Initialize a prompt from a BitBucket repository.\n    \"\"\"\n    bitbucket_config: Final = getattr(litellm_params, \"bitbucket_config\", None)\n    prompt_id: Final = getattr(litellm_params, \"prompt_id\", None)\n\n    if not bitbucket_config:\n        raise ValueError(\"bitbucket_config is required for BitBucket prompt integration\")\n\n    try:\n        bitbucket_prompt_manager: Final = BitBucketPromptManager(\n            bitbucket_config=bitbucket_config,\n            prompt_id=prompt_id,\n        )\n\n        return bitbucket_prompt_manager\n    except Exception as e:\n        raise e\n\n\nprompt_initializer_registry: Final = {\n    SupportedPromptIntegrations.BITBUCKET.value: prompt_initializer,\n}\n\n# Export public API\n__all__ = [","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/bitbucket/__init__.py#L23-L59","documentation":"The BitBucket prompt initializer reads bitbucket_config off the call's litellm_params; when a prompt is marked as sourced from BitBucket but no bitbucket_config object is attached, it raises before a BitBucketPromptManager can be constructed. The config dict carries workspace, repository, access_token and branch used to fetch .prompt files from the repo.","triggerScenarios":"Configuring a prompt with source 'bitbucket' (or registering the integration) without embedding bitbucket_config in litellm_params; key typo like bitbucketConfig or bitbucket; building router prompt deployments from YAML that omits the config block; programmatic prompt specs that set prompt_id only.","commonSituations":"Copying an example that passes prompt_id alone; config generated by a template engine that silently drops nested dicts; team assumes the client reads env vars instead of the inline config.","solutions":["Attach bitbucket_config={\"workspace\": ..., \"repository\": ..., \"access_token\": ..., \"branch\": ...} to the litellm_params / prompt spec for every BitBucket-sourced prompt","Verify the attribute name is exactly bitbucket_config (getattr is used, so aliases will not resolve)","If BitBucket was not intended, switch the prompt source back to inline/spec-based definitions"],"exampleFix":"// before\nparams = PromptLiteLLMParams(prompt_id=\"triage\")  # no config -> ValueError\n// after\nparams = PromptLiteLLMParams(\n    prompt_id=\"triage\",\n    bitbucket_config={\n        \"workspace\": \"acme\",\n        \"repository\": \"prompt-library\",\n        \"access_token\": os.environ[\"BITBUCKET_TOKEN\"],\n        \"branch\": \"main\",\n    },\n)","handlingStrategy":"validation","validationCode":"cfg = getattr(litellm_params, \"bitbucket_config\", None)\nif not isinstance(cfg, dict) or not all(cfg.get(k) for k in (\"workspace\", \"repository\", \"access_token\")):\n    raise ValueError(\"bitbucket_config must be a dict with workspace, repository, access_token\")","typeGuard":"def has_bitbucket_config(litellm_params) -> bool:\n    cfg = getattr(litellm_params, \"bitbucket_config\", None)\n    return isinstance(cfg, dict) and bool(cfg.get(\"workspace\")) and bool(cfg.get(\"repository\")) and bool(cfg.get(\"access_token\"))","tryCatchPattern":null,"preventionTips":["Use the exact attribute name bitbucket_config — the initializer uses getattr without aliases","Build prompt specs through a factory that always attaches the config for bitbucket-sourced prompts","Assert config completeness in a startup schema validation pass","Keep the access token in env/vault and inject at construction, not in checked-in YAML"],"tags":["bitbucket","litellm","prompt-management","missing-config"],"backgroundTag":"missing-required-argument","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}