{"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":4327,"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":4309,"sourceCodeEnd":4345,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/litellm_logging.py#L4309-L4345","documentation":"The 'bitbucket' logging integration is a prompt-management callback (BitBucketPromptManager) that pulls its settings from the module-level litellm.global_bitbucket_config object rather than env vars. If that global was never populated (no BitBucketPromptManagementConfig assigned), LiteLLM raises this ValueError instead of constructing the logger with empty settings.","triggerScenarios":"Enabling callbacks: ['bitbucket'] (config.yaml litellm_settings or litellm.callbacks) without first assigning litellm.global_bitbucket_config = BitBucketPromptManagementConfig(...) in the process before the first logged request.","commonSituations":"Following the BitBucket prompt-management docs partially (adding the callback but not the global config assignment); config expecting the proxy bootstrap to set the global, which only happens when the corresponding prompt-management settings block is present; forgetting initialization in custom server setups.","solutions":["Set the global before any request: litellm.global_bitbucket_config = BitBucketPromptManagementConfig(app_token=..., project_key=..., repo_slug=..., prompt_prefix=...)","If using the proxy, configure BitBucket prompt management in config.yaml per the docs so the server sets the global at startup","Confirm only one BitBucketPromptManager is intended — the callback is cached after creation, so the global must exist at first use, not later","Remove 'bitbucket' from callbacks if you did not intend to enable BitBucket prompt management"],"exampleFix":"# before\nimport litellm\nlitellm.callbacks = [\"bitbucket\"]  # ValueError: configuration not found\n\n# after\nimport litellm\nfrom litellm.integrations.bitbucket import BitBucketPromptManagementConfig\nlitellm.global_bitbucket_config = BitBucketPromptManagementConfig(\n    app_token=\"...\", project_key=\"myproj\", repo_slug=\"myrepo\", prompt_prefix=\"\"\n)\nlitellm.callbacks = [\"bitbucket\"]","handlingStrategy":"validation","validationCode":"import litellm\nfrom litellm.integrations.bitbucket import BitBucketPromptManagementConfig\n\nif 'bitbucket' in litellm.callbacks and getattr(litellm, 'global_bitbucket_config', None) is None:\n    litellm.global_bitbucket_config = BitBucketPromptManagementConfig(\n        app_token=..., project_key=..., repo_slug=...\n    )","typeGuard":"def bitbucket_ready() -> bool:\n    return getattr(litellm, 'global_bitbucket_config', None) is not None","tryCatchPattern":null,"preventionTips":["Assign litellm.global_bitbucket_config in the same startup block that registers the callback","Add an assert at boot so misordering fails fast","Remember the logger is cached: config must exist before first use"],"tags":["litellm","bitbucket","prompt-management","callbacks","configuration"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}