{"record":{"id":"9993f25a46f633ba","repo":"BerriAI/litellm","slug":"greenscale-logger-error-no-logging-url-found","errorCode":null,"errorMessage":"Greenscale Logger Error - No logging URL found","messagePattern":"Greenscale Logger Error - No logging URL found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/greenscale.py","lineNumber":48,"sourceCode":"            if type(end_time) is datetime and type(start_time) is datetime:\n                data[\"invocationLatency\"] = int((end_time - start_time).total_seconds() * 1000)\n\n            # Add additional metadata keys to tags\n            tags: Final = []\n            metadata: Final = kwargs.get(\"litellm_params\", {}).get(\"metadata\", {})\n            for key, value in metadata.items():\n                if key.startswith(\"greenscale\"):\n                    if key == \"greenscale_project\":\n                        data[\"project\"] = value\n                    elif key == \"greenscale_application\":\n                        data[\"application\"] = value\n                    else:\n                        tags.append({\"key\": key.replace(\"greenscale_\", \"\"), \"value\": str(value)})\n\n            data[\"tags\"] = tags\n\n            if self.greenscale_logging_url is None:\n                raise Exception(\"Greenscale Logger Error - No logging URL found\")\n\n            response: Final = litellm.module_level_client.post(\n                self.greenscale_logging_url,\n                headers=self.headers,\n                data=json.dumps(data, default=str),\n            )\n            if response.status_code != 200:\n                print_verbose(f\"Greenscale Logger Error - {response.text}, {response.status_code}\")\n            else:\n                print_verbose(f\"Greenscale Logger Succeeded - {response.text}\")\n        except Exception as e:\n            print_verbose(f\"Greenscale Logger Error - {e}, Stack trace: {traceback.format_exc()}\")\n","sourceCodeStart":30,"sourceCodeEnd":61,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/greenscale.py#L30-L61","documentation":"Exception raised by the Greenscale custom logger when it is time to send the log event but self.greenscale_logging_url is None. The URL is expected to be injected (typically via the standard logging-callback config), and its absence means the callback cannot POST anywhere.","triggerScenarios":"Adding 'greenscale' to litellm.callbacks (or per-request greenscale params) without providing the Greenscale logging URL in the callback initialization/config. The log attempt then aborts before the HTTP call. Note the surrounding try/except prints via print_verbose, so in default verbose settings this may pass silently.","commonSituations":"Enabling the Greenscale integration by name only, assuming defaults exist; version changes in how callback init params are passed; typo'd env/config key so the URL never reaches the handler.","solutions":["Provide the Greenscale logging URL when configuring the callback (e.g. litellm.callbacks = ['greenscale'] plus the GreenscaleConfig/logging_url setup per docs)","Enable LITELLM_LOG=DEBUG or verbose logging to confirm the handler state at init","Verify the callback object actually received the URL before first completion call"],"exampleFix":"# before\nlitellm.callbacks = ['greenscale']  # no url configured\n\n# after\nfrom litellm.integrations.greenscale import GreenscaleLogger\nlitellm.callbacks = [GreenscaleLogger(greenscale_logging_url='https://api.greenscale.ai/v1/logs')]","handlingStrategy":"validation","validationCode":"logger = GreenscaleLogger(greenscale_logging_url=os.getenv(\"GREENSCALE_LOGGING_URL\"))  # adjust to your litellm version's constructor\nassert logger.greenscale_logging_url is not None, \"GREENSCALE_LOGGING_URL must be set\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Instantiate the logger with an explicit URL rather than relying on defaults","Enable verbose logging in staging to catch handler init problems","Assert required config at startup, not on first log event"],"tags":["litellm","greenscale","logging-callback","configuration"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}