{"record":{"id":"fd52bf2194367744","repo":"BerriAI/litellm","slug":"invalid-account-id-format","errorCode":null,"errorMessage":"Invalid account_id format","messagePattern":"Invalid account_id format","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/snowflake/utils.py","lineNumber":65,"sourceCode":"        Returns:\n            dict: Updated optional_params with supported non-default parameters.\n        \"\"\"\n        supported_openai_params: Final = self.get_supported_openai_params(model)\n        for param, value in non_default_params.items():\n            if param in supported_openai_params:\n                optional_params[param] = value\n        return optional_params\n\n    def _get_api_base(self, api_base, optional_params):\n        if not api_base:\n            if \"account_id\" in optional_params:\n                account_id = optional_params.pop(\"account_id\")\n            else:\n                account_id = get_secret_str(\"SNOWFLAKE_ACCOUNT_ID\")\n            if account_id is None:\n                raise ValueError(\"Missing snowflake account_id\")\n            if not re.match(r\"^[a-zA-Z0-9_-]+$\", account_id):\n                raise ValueError(\"Invalid account_id format\")\n            api_base = f\"https://{account_id}.snowflakecomputing.com/api/v2\"\n\n        api_base = api_base.rstrip(\"/\")\n        if not api_base.endswith(\"/api/v2\"):\n            api_base += \"/api/v2\"\n        return api_base\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        api_key: str | None = None,\n        api_base: str | None = None,\n    ) -> dict:\n        \"\"\"","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/snowflake/utils.py#L47-L83","documentation":"Guard in _get_api_base: the account_id popped from optional_params does not match the expected Snowflake account identifier format, so the Cortex endpoint hostname would be invalid and the value is rejected up front.","triggerScenarios":"Triggered when the Snowflake account_id has an invalid format.","commonSituations":"See trigger scenarios.","solutions":["Use a valid Snowflake account identifier format, e.g. 'orgname-accountname'.","Check for typos in the account_id."],"exampleFix":"account_id=\"myorg-myaccount\"","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}