{"record":{"id":"b49e3e8e073bde6c","repo":"crewAIInc/crewAI","slug":"provider-provider-name-does-not-support-type","errorCode":null,"errorMessage":"Provider '{provider_name}' does not support {type_name}","messagePattern":"Provider '(.+?)' does not support (.+?)","errorType":"validation","errorClass":"UnsupportedFileTypeError","httpStatus":null,"severity":"error","filePath":"lib/crewai-files/src/crewai_files/processing/validators.py","lineNumber":504,"sourceCode":"    raise_on_error: bool,\n) -> Sequence[str]:\n    \"\"\"Check if file type is unsupported and handle error.\n\n    Args:\n        file: The file being validated.\n        provider_name: Name of the provider.\n        type_name: Name of the file type (e.g., \"images\", \"PDFs\").\n        raise_on_error: If True, raise exception instead of returning errors.\n\n    Returns:\n        List with error message (only returns when raise_on_error is False).\n\n    Raises:\n        UnsupportedFileTypeError: If raise_on_error is True.\n    \"\"\"\n    msg = f\"Provider '{provider_name}' does not support {type_name}\"\n    if raise_on_error:\n        raise UnsupportedFileTypeError(\n            msg, file_name=file.filename, content_type=file.content_type\n        )\n    return [msg]\n\n\ndef validate_file(\n    file: FileInput,\n    constraints: ProviderConstraints,\n    *,\n    raise_on_error: bool = True,\n) -> Sequence[str]:\n    \"\"\"Validate a file against provider constraints.\n\n    Dispatches to the appropriate validator based on file type.\n\n    Args:\n        file: The file to validate.\n        constraints: Provider constraints to validate against.","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-files/src/crewai_files/processing/validators.py#L486-L522","documentation":"Raised by crewai-files validation when a FileInput's type (e.g. images, PDFs) is not in the provider's supported set defined by its ProviderConstraints. It only raises when raise_on_error=True (the default); otherwise the same message is returned in the error list. The exception is UnsupportedFileTypeError, a subclass of FileValidationError, and carries file_name and content_type context.","triggerScenarios":"Calling validate_file(file, constraints) or a provider upload path that validates first, where the file's extension/content_type is absent from constraints.supported_extensions (e.g. sending .webp to a provider whose constraints only list .png/.jpg, or a PDF to an image-only provider) with raise_on_error=True.","commonSituations":"Mixing up provider constraint sets, adding a new file format to uploads without updating ProviderConstraints, auto-detecting content_type as application/octet-stream so no extension matches, or routing every file through one provider (e.g. anthropic) that only accepts a narrow type set.","solutions":["Check the file's extension/content_type against the provider's ProviderConstraints.supported_extensions before uploading.","Route the file to a provider whose constraints include that type, or convert the file (e.g. webp -> png, docx -> pdf) before upload.","Extend the ProviderConstraints configuration for the provider if the underlying API actually supports the type.","Call validators with raise_on_error=False and handle the returned error strings when you prefer soft-failure behavior."],"exampleFix":"// before\nresult = anthropic_uploader.upload(file)  # raises UnsupportedFileTypeError for .webp\n\n# after\nfrom crewai_files.processing.validators import validate_file\nerrors = validate_file(file, constraints, raise_on_error=False)\nif errors:\n    logger.warning(\"Skipping %s: %s\", file.filename, errors)\nelse:\n    result = anthropic_uploader.upload(file)","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\next = Path(file.filename).suffix.lower()\nif ext not in constraints.supported_extensions:\n    logger.warning(\"skip %s: %s not supported\", file.filename, ext)\n    return\nresult = uploader.upload(file)","typeGuard":"def is_supported_type(file: FileInput, constraints: ProviderConstraints) -> bool:\n    ext = Path(file.filename).suffix.lower()\n    return ext in constraints.supported_extensions","tryCatchPattern":"from crewai_files.processing.exceptions import UnsupportedFileTypeError\ntry:\n    uploader.upload(file)\nexcept UnsupportedFileTypeError as e:\n    logger.warning(\"unsupported for provider: %s\", e)","preventionTips":["Log each provider's ProviderConstraints.supported_extensions at startup so operators see the accepted set.","Normalize/convert uploads to formats every target provider accepts before dispatch.","Run validate_file with raise_on_error=False first when accepting untrusted user files."],"tags":["validation","file-upload","provider-constraints","content-type"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}