{"record":{"id":"dc98e046cb026b35","repo":"BerriAI/litellm","slug":"gitlab-configuration-not-found-please-set-litellm","errorCode":null,"errorMessage":"Gitlab configuration not found. Please set litellm.global_gitlab_config first.","messagePattern":"Gitlab configuration not found\\. Please set litellm\\.global_gitlab_config first\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/litellm_logging.py","lineNumber":4344,"sourceCode":"            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\n            gitlab_logger: Final = GitLabPromptManager(gitlab_config=gitlab_config)\n            _in_memory_loggers.append(gitlab_logger)\n            return gitlab_logger\n        elif logging_integration == \"newrelic\":\n            for callback in _in_memory_loggers:\n                if isinstance(callback, NewRelicLogger):\n                    return callback\n            newrelic_logger: Final = NewRelicLogger()\n            _in_memory_loggers.append(newrelic_logger)\n            return newrelic_logger\n        return None\n    except Exception as e:\n        verbose_logger.exception(\"[Non-Blocking Error] Error initializing custom logger: %s\", e)\n        return None\n    return None\n\n","sourceCodeStart":4326,"sourceCodeEnd":4362,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/litellm_logging.py#L4326-L4362","documentation":"Same pattern as the BitBucket integration: the 'gitlab' logging integration constructs a GitLabPromptManager from the module-level litellm.global_gitlab_config. If that global was never assigned, LiteLLM refuses with this ValueError. GitLab prompt-management settings are not read from env vars, so the global must be set explicitly (or via proxy prompt-management config).","triggerScenarios":"callbacks: ['gitlab'] enabled while litellm.global_gitlab_config is None at the moment the logger is lazily created (first logged request, or proxy startup without the GitLab prompt management block).","commonSituations":"Adding the gitlab callback from docs without the corresponding global config assignment; custom hosting where the proxy's prompt-management bootstrap isn't run; renaming/moving the config class between LiteLLM versions so the assignment silently stopped happening.","solutions":["Assign litellm.global_gitlab_config = GitLabPromptManagementConfig(gitlab_base_url=..., gitlab_access_token=..., project_id=..., prompt_prefix=...) before the first request","Or configure GitLab prompt management in the proxy config.yaml so startup initializes the global","Verify the assignment happened early (e.g. print litellm.global_gitlab_config in a startup hook)","Drop 'gitlab' from callbacks if prompt management via GitLab is unwanted"],"exampleFix":"# before\nlitellm.callbacks = [\"gitlab\"]  # ValueError: configuration not found\n\n# after\nimport litellm\nfrom litellm.integrations.gitlab import GitLabPromptManagementConfig\nlitellm.global_gitlab_config = GitLabPromptManagementConfig(\n    gitlab_base_url=\"https://gitlab.com/api/v4\",\n    gitlab_access_token=\"...\",\n    project_id=\"12345\",\n)\nlitellm.callbacks = [\"gitlab\"]","handlingStrategy":"validation","validationCode":"import litellm\nfrom litellm.integrations.gitlab import GitLabPromptManagementConfig\n\nif 'gitlab' in litellm.callbacks and getattr(litellm, 'global_gitlab_config', None) is None:\n    litellm.global_gitlab_config = GitLabPromptManagementConfig(\n        gitlab_base_url=..., gitlab_access_token=..., project_id=...\n    )","typeGuard":"def gitlab_ready() -> bool:\n    return getattr(litellm, 'global_gitlab_config', None) is not None","tryCatchPattern":null,"preventionTips":["Set litellm.global_gitlab_config before any request when callbacks include 'gitlab'","Re-check the assignment after upgrading litellm (class import paths move)","Initialize globals in a single startup module to avoid ordering bugs"],"tags":["litellm","gitlab","prompt-management","callbacks","configuration"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}