BerriAI/litellm · error · Exception
Greenscale Logger Error - No logging URL found
Error message
Greenscale Logger Error - No logging URL found
What it means
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.
Source
Thrown at litellm/integrations/greenscale.py:48
if type(end_time) is datetime and type(start_time) is datetime:
data["invocationLatency"] = int((end_time - start_time).total_seconds() * 1000)
# Add additional metadata keys to tags
tags: Final = []
metadata: Final = kwargs.get("litellm_params", {}).get("metadata", {})
for key, value in metadata.items():
if key.startswith("greenscale"):
if key == "greenscale_project":
data["project"] = value
elif key == "greenscale_application":
data["application"] = value
else:
tags.append({"key": key.replace("greenscale_", ""), "value": str(value)})
data["tags"] = tags
if self.greenscale_logging_url is None:
raise Exception("Greenscale Logger Error - No logging URL found")
response: Final = litellm.module_level_client.post(
self.greenscale_logging_url,
headers=self.headers,
data=json.dumps(data, default=str),
)
if response.status_code != 200:
print_verbose(f"Greenscale Logger Error - {response.text}, {response.status_code}")
else:
print_verbose(f"Greenscale Logger Succeeded - {response.text}")
except Exception as e:
print_verbose(f"Greenscale Logger Error - {e}, Stack trace: {traceback.format_exc()}")
View on GitHub (pinned to 6c2dcb801b)
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
Example fix
# before litellm.callbacks = ['greenscale'] # no url configured # after from litellm.integrations.greenscale import GreenscaleLogger litellm.callbacks = [GreenscaleLogger(greenscale_logging_url='https://api.greenscale.ai/v1/logs')]
Defensive patterns
Strategy: validation
Validate before calling
logger = GreenscaleLogger(greenscale_logging_url=os.getenv("GREENSCALE_LOGGING_URL")) # adjust to your litellm version's constructor
assert logger.greenscale_logging_url is not None, "GREENSCALE_LOGGING_URL must be set" Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Error: {response.status_code} - {response.text}
- Missing Authorization header
- Invalid bearer token
- Invalid API key
- Prompt '{prompt_id}' not found
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/9993f25a46f633ba.
Report an issue: GitHub.