{"record":{"id":"5796e49ef4f3b4e8","repo":"BerriAI/litellm","slug":"invalid-webhook-url-value-for-webhook-url-got","errorCode":null,"errorMessage":"Invalid webhook url value for: {webhook_url}. Got type={type(_env_value)}","messagePattern":"Invalid webhook url value for: (.+?)\\. Got type=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/SlackAlerting/utils.py","lineNumber":37,"sourceCode":"\ndef process_slack_alerting_variables(\n    alert_to_webhook_url: dict[AlertType, list[str] | str] | None,\n) -> dict[AlertType, list[str] | str] | None:\n    \"\"\"\n    process alert_to_webhook_url\n    - check if any urls are set as os.environ/SLACK_WEBHOOK_URL_1 read env var and set the correct value\n    \"\"\"\n    if alert_to_webhook_url is None:\n        return None\n\n    for alert_type, webhook_urls in alert_to_webhook_url.items():\n        if isinstance(webhook_urls, list):\n            _webhook_values: list[str] = []\n            for webhook_url in webhook_urls:\n                if \"os.environ/\" in webhook_url:\n                    _env_value = get_secret(secret_name=webhook_url)\n                    if not isinstance(_env_value, str):\n                        raise ValueError(f\"Invalid webhook url value for: {webhook_url}. Got type={type(_env_value)}\")\n                    _webhook_values.append(_env_value)\n                else:\n                    _webhook_values.append(webhook_url)\n\n            alert_to_webhook_url[alert_type] = _webhook_values\n        else:\n            _webhook_value_str: str = webhook_urls\n            if \"os.environ/\" in webhook_urls:\n                _env_value = get_secret(secret_name=webhook_urls)\n                if not isinstance(_env_value, str):\n                    raise ValueError(f\"Invalid webhook url value for: {webhook_urls}. Got type={type(_env_value)}\")\n                _webhook_value_str = _env_value\n            else:\n                _webhook_value_str = webhook_urls\n\n            alert_to_webhook_url[alert_type] = _webhook_value_str\n\n    return alert_to_webhook_url","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/SlackAlerting/utils.py#L19-L55","documentation":"Error \"Invalid webhook url value for: {webhook_url}. Got type={type(_env_value)}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/SlackAlerting/utils.py:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the webhook URL environment variable to a string URL, not another type."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}