{"record":{"id":"026c2697548811d6","repo":"BerriAI/litellm","slug":"bitbucket-configuration-not-found-please-set-lite","errorCode":null,"errorMessage":"BitBucket configuration not found. Please set litellm.global_bitbucket_config first.","messagePattern":"BitBucket configuration not found\\. Please set litellm\\.global_bitbucket_config first\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/litellm_logging.py","lineNumber":4333,"sourceCode":"                if isinstance(callback, DotpromptManager):\n                    return callback\n\n            dotprompt_logger: Final = DotpromptManager()\n            _in_memory_loggers.append(dotprompt_logger)\n            return dotprompt_logger\n        elif logging_integration == \"bitbucket\":\n            from litellm.integrations.bitbucket.bitbucket_prompt_manager import (\n                BitBucketPromptManager,\n            )\n\n            for callback in _in_memory_loggers:\n                if isinstance(callback, BitBucketPromptManager):\n                    return callback\n\n            # Get global BitBucket config\n            bitbucket_config: Final = getattr(litellm, \"global_bitbucket_config\", None)\n            if bitbucket_config is None:\n                raise ValueError(\"BitBucket configuration not found. Please set litellm.global_bitbucket_config first.\")\n\n            bitbucket_logger: Final = BitBucketPromptManager(bitbucket_config=bitbucket_config)\n            _in_memory_loggers.append(bitbucket_logger)\n            return bitbucket_logger\n        elif logging_integration == \"gitlab\":\n            from litellm.integrations.gitlab.gitlab_prompt_manager import (\n                GitLabPromptManager,\n            )\n\n            for callback in _in_memory_loggers:\n                if isinstance(callback, GitLabPromptManager):\n                    return callback\n\n            # Get global BitBucket config\n            gitlab_config: Final = getattr(litellm, \"global_gitlab_config\", None)\n            if gitlab_config is None:\n                raise ValueError(\"Gitlab configuration not found. Please set litellm.global_gitlab_config first.\")\n","sourceCodeStart":4315,"sourceCodeEnd":4351,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/litellm_logging.py#L4315-L4351","documentation":"Raised when the 'bitbucket' callback (BitBucketPromptManager, which resolves model='bitbucket/<name>' + prompt_id against .prompt files in a BitBucket repo) is instantiated: LiteLLM reads the global config from litellm.global_bitbucket_config, and if it is None (never set) this ValueError fires. The config is a dict of workspace/repository/access_token (plus optional branch, auth_method, username) that you must install via litellm.set_global_bitbucket_config() or, in the proxy, under litellm_settings.global_bitbucket_config in config.yaml.","triggerScenarios":"Adding 'bitbucket' to callbacks (SDK: litellm.callbacks = ['bitbucket']; proxy: litellm_settings.callbacks) without calling set_global_bitbucket_config first; proxy config placing global_bitbucket_config in the wrong section or misspelling the key; calling completion(model='bitbucket/gpt-4', prompt_id=...) in a fresh process that never set the global.","commonSituations":"Using the bitbucket prompt-management integration from its README but skipping step 3 (set global config); proxy deployments where the litellm_settings block is restructured and the key is lost; multiple workers where only one sets the global.","solutions":["In SDK code, call litellm.set_global_bitbucket_config({'workspace': ..., 'repository': ..., 'access_token': ..., 'branch': 'main'}) before any request.","In the proxy, add litellm_settings: global_bitbucket_config: {workspace: ..., repository: ..., access_token: ...} to config.yaml.","Check spelling/placement of the key and restart all workers so every process has the global set."],"exampleFix":"# before\nimport litellm\nlitellm.completion(model='bitbucket/gpt-4', prompt_id='prompts/hello', messages=[...])\n# ValueError: BitBucket configuration not found\n\n# after\nimport litellm\nlitellm.set_global_bitbucket_config({'workspace': 'ws', 'repository': 'repo', 'access_token': 'x', 'branch': 'main'})\nlitellm.completion(model='bitbucket/gpt-4', prompt_id='prompts/hello', messages=[...])","handlingStrategy":"validation","validationCode":"import litellm\n\nrequired = {'workspace', 'repository', 'access_token'}\nbitbucket_config = {'workspace': 'ws', 'repository': 'repo', 'access_token': os.environ['BITBUCKET_TOKEN']}\nassert required <= set(bitbucket_config), f'bitbucket config missing: {required - set(bitbucket_config)}'\nlitellm.set_global_bitbucket_config(bitbucket_config)\nresp = litellm.completion(model='bitbucket/gpt-4', prompt_id='prompts/hello', messages=[...])","typeGuard":"def bitbucket_config_is_valid(cfg: object) -> bool:\n    return isinstance(cfg, dict) and {'workspace', 'repository', 'access_token'} <= set(cfg)","tryCatchPattern":"try:\n    resp = litellm.completion(model='bitbucket/gpt-4', prompt_id='prompts/hello', messages=[...])\nexcept ValueError as e:\n    if 'BitBucket configuration not found' in str(e):\n        litellm.set_global_bitbucket_config({'workspace': 'ws', 'repository': 'repo', 'access_token': 'x'})\n        resp = litellm.completion(model='bitbucket/gpt-4', prompt_id='prompts/hello', messages=[...])\n    else:\n        raise","preventionTips":["Call litellm.set_global_bitbucket_config() once at app startup, before any bitbucket/ model call.","In the proxy, keep global_bitbucket_config under litellm_settings and validate it in a config check hook.","Add a startup assertion that litellm.global_bitbucket_config is a dict with workspace/repository/access_token."],"tags":["litellm","bitbucket","prompt-management","callbacks","configuration"],"backgroundTag":"missing-callback-config","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}