BerriAI/litellm · error · ValueError

BitBucket configuration not found. Please set litellm.global

Error message

BitBucket configuration not found. Please set litellm.global_bitbucket_config first.

What it means

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.

Source

Thrown at litellm/litellm_core_utils/litellm_logging.py:4327

                if isinstance(callback, DotpromptManager):
                    return callback

            dotprompt_logger: Final = DotpromptManager()
            _in_memory_loggers.append(dotprompt_logger)
            return dotprompt_logger
        elif logging_integration == "bitbucket":
            from litellm.integrations.bitbucket.bitbucket_prompt_manager import (
                BitBucketPromptManager,
            )

            for callback in _in_memory_loggers:
                if isinstance(callback, BitBucketPromptManager):
                    return callback

            # Get global BitBucket config
            bitbucket_config: Final = getattr(litellm, "global_bitbucket_config", None)
            if bitbucket_config is None:
                raise ValueError("BitBucket configuration not found. Please set litellm.global_bitbucket_config first.")

            bitbucket_logger: Final = BitBucketPromptManager(bitbucket_config=bitbucket_config)
            _in_memory_loggers.append(bitbucket_logger)
            return bitbucket_logger
        elif logging_integration == "gitlab":
            from litellm.integrations.gitlab.gitlab_prompt_manager import (
                GitLabPromptManager,
            )

            for callback in _in_memory_loggers:
                if isinstance(callback, GitLabPromptManager):
                    return callback

            # Get global BitBucket config
            gitlab_config: Final = getattr(litellm, "global_gitlab_config", None)
            if gitlab_config is None:
                raise ValueError("Gitlab configuration not found. Please set litellm.global_gitlab_config first.")

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Set the global before any request: litellm.global_bitbucket_config = BitBucketPromptManagementConfig(app_token=..., project_key=..., repo_slug=..., prompt_prefix=...)
  2. If using the proxy, configure BitBucket prompt management in config.yaml per the docs so the server sets the global at startup
  3. Confirm only one BitBucketPromptManager is intended — the callback is cached after creation, so the global must exist at first use, not later
  4. Remove 'bitbucket' from callbacks if you did not intend to enable BitBucket prompt management

Example fix

# before
import litellm
litellm.callbacks = ["bitbucket"]  # ValueError: configuration not found

# after
import litellm
from litellm.integrations.bitbucket import BitBucketPromptManagementConfig
litellm.global_bitbucket_config = BitBucketPromptManagementConfig(
    app_token="...", project_key="myproj", repo_slug="myrepo", prompt_prefix=""
)
litellm.callbacks = ["bitbucket"]
Defensive patterns

Strategy: validation

Validate before calling

import litellm
from litellm.integrations.bitbucket import BitBucketPromptManagementConfig

if 'bitbucket' in litellm.callbacks and getattr(litellm, 'global_bitbucket_config', None) is None:
    litellm.global_bitbucket_config = BitBucketPromptManagementConfig(
        app_token=..., project_key=..., repo_slug=...
    )

Type guard

def bitbucket_ready() -> bool:
    return getattr(litellm, 'global_bitbucket_config', None) is not None

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/026c2697548811d6. Report an issue: GitHub.