{"record":{"id":"1be173a928c1ac27","repo":"BerriAI/litellm","slug":"server-configuration-error-team-metadata-field-e","errorCode":null,"errorMessage":"Server configuration error: team metadata field 'enforced_file_expires_after' is malformed - must contain 'anchor' and 'seconds' keys. Contact your team or proxy admin to fix this setting.","messagePattern":"Server configuration error: team metadata field 'enforced_file_expires_after' is malformed - must contain 'anchor' and 'seconds' keys\\. Contact your team or proxy admin to fix this setting\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/openai_files_endpoints/files_endpoints.py","lineNumber":475,"sourceCode":"\n        # Prepare the file data according to FileTypes\n        file_data: Final = (file.filename, file_source, file.content_type)\n\n        ## check if model is a loadbalanced model\n        router_model: str | None = None\n        is_router_model = False\n        if litellm.enable_loadbalancing_on_batch_endpoints is True:\n            json_obj: Final = get_first_json_object(file_source)\n            if json_obj:\n                router_model = get_model_from_json_obj(json_object=json_obj)\n                is_router_model = is_known_model(model=router_model, llm_router=llm_router)\n\n        # Apply team-level file expiry enforcement\n        team_metadata: Final = user_api_key_dict.team_metadata or {}\n        enforced_file_expiry: Final = team_metadata.get(\"enforced_file_expires_after\")\n        if enforced_file_expiry is not None:\n            if \"anchor\" not in enforced_file_expiry or \"seconds\" not in enforced_file_expiry:\n                raise HTTPException(\n                    status_code=500,\n                    detail={\n                        \"error\": \"Server configuration error: team metadata field 'enforced_file_expires_after' is malformed - must contain 'anchor' and 'seconds' keys. Contact your team or proxy admin to fix this setting.\",\n                    },\n                )\n            if enforced_file_expiry[\"anchor\"] != \"created_at\":\n                raise HTTPException(\n                    status_code=500,\n                    detail={\n                        \"error\": f\"Server configuration error: team metadata field 'enforced_file_expires_after' has invalid anchor '{enforced_file_expiry['anchor']}' - must be 'created_at'. Contact your team or proxy admin to fix this setting.\",\n                    },\n                )\n            expires_after = FileExpiresAfter(\n                anchor=\"created_at\",\n                seconds=int(enforced_file_expiry[\"seconds\"]),\n            )\n\n        verbose_proxy_logger.debug(\"create_file expires_after: %s\", expires_after)","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/openai_files_endpoints/files_endpoints.py#L457-L493","documentation":"Error \"Server configuration error: team metadata field 'enforced_file_expires_after' is malformed - must contain 'anchor' and 'seconds' keys. Contact your team or proxy admin to fix this setting.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/openai_files_endpoints/files_endpoints.py:475 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ask the team/proxy admin to fix team metadata 'enforced_file_expires_after' to contain 'anchor' and 'seconds' keys."],"exampleFix":null,"handlingStrategy":null,"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"}