{"id":"7b20d951595cd077","repo":"boto/boto3","slug":"crt-transfer-client-is-configured-but-is-missing-m","errorCode":null,"errorMessage":"CRT transfer client is configured but is missing minimum crt version. CRT installed: {HAS_CRT}[, with version: {awscrt.__version__}]","messagePattern":"CRT transfer client is configured but is missing minimum crt version\\. CRT installed: (.+?)\\[, with version: (.+?)\\]","errorType":"exception","errorClass":"MissingDependencyException","httpStatus":null,"severity":"error","filePath":"boto3/s3/transfer.py","lineNumber":209,"sourceCode":"\n\ndef _should_use_crt(config):\n    # This feature requires awscrt>=0.19.18\n    has_min_crt = HAS_CRT and has_minimum_crt_version((0, 19, 18))\n    is_optimized_instance = has_min_crt and awscrt.s3.is_optimized_for_system()\n    pref_transfer_client = config.preferred_transfer_client.lower()\n\n    if (\n        pref_transfer_client == constants.CRT_TRANSFER_CLIENT\n        and not has_min_crt\n    ):\n        msg = (\n            \"CRT transfer client is configured but is missing minimum CRT \"\n            f\"version. CRT installed: {HAS_CRT}\"\n        )\n        if HAS_CRT:\n            msg += f\", with version: {awscrt.__version__}\"\n        raise MissingDependencyException(msg=msg)\n\n    if (\n        is_optimized_instance\n        and pref_transfer_client == constants.AUTO_RESOLVE_TRANSFER_CLIENT\n    ) or pref_transfer_client == constants.CRT_TRANSFER_CLIENT:\n        logger.debug(\n            \"Attempting to use CRTTransferManager. Config settings may be ignored.\"\n        )\n        return True\n\n    logger.debug(\n        \"Opting out of CRT Transfer Manager. \"\n        \"Preferred client: %s, CRT available: %s, Instance Optimized: %s\",\n        pref_transfer_client,\n        HAS_CRT,\n        is_optimized_instance,\n    )\n    return False","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/boto/boto3/blob/c7b4afac237b976d48395d7523eaf7cec3a450b3/boto3/s3/transfer.py#L191-L227","documentation":"Raised as MissingDependencyException when a TransferConfig explicitly requests the CRT transfer client (preferred_transfer_client='crt') but awscrt is either not installed or older than the required 0.19.18. _should_use_crt() checks HAS_CRT and has_minimum_crt_version((0,19,18)); if the user pinned the CRT client without satisfying the dependency, boto3 refuses to silently fall back and surfaces the missing dependency. The message reports whether CRT is installed and, if so, the detected awscrt.__version__.","triggerScenarios":"Constructing a TransferConfig with preferred_transfer_client set to 'crt' (boto3.s3.constants.CRT_TRANSFER_CLIENT) and then performing any S3 transfer (upload_file/download_file/upload_fileobj/download_fileobj) that calls create_transfer_manager, while awscrt is absent or < 0.19.18.","commonSituations":"Deploying to an environment (Lambda layer, slim Docker image, CI) where awscrt was not installed; pinning an older awscrt that predates the 0.19.18 cutoff; explicitly opting into the CRT client for performance on EC2 without adding the awscrt dependency.","solutions":["Install or upgrade awscrt to at least 0.19.18: pip install -U 'awscrt>=0.19.18'.","If you do not need the CRT client, switch preferred_transfer_client back to 'auto' (the default) or omit it so boto3 uses the default transfer manager.","Pin awscrt in your requirements alongside boto3 so deployments stay consistent.","Verify the installation in the runtime environment (not just your dev machine) with python -c 'import awscrt; print(awscrt.__version__)'."],"exampleFix":"// before\ncfg = TransferConfig(preferred_transfer_client='crt')  # raises if awscrt missing\ns3.upload_file('f', 'bkt', 'key', Config=cfg)\n\n// after\n# Option A: install awscrt>=0.19.18, OR\n# Option B: drop the CRT preference\ncfg = TransferConfig()  # default transfer client\ns3.upload_file('f', 'bkt', 'key', Config=cfg)","handlingStrategy":"validation","validationCode":"from botocore.compat import HAS_CRT\nfrom boto3.s3.transfer import has_minimum_crt_version\nif config.preferred_transfer_client == 'crt' and not has_minimum_crt_version((0, 19, 18)):\n    raise RuntimeError('awscrt>=0.19.18 required for CRT transfer client')","typeGuard":"def crt_client_available() -> bool:\n    from botocore.compat import HAS_CRT\n    from boto3.s3.transfer import has_minimum_crt_version\n    return HAS_CRT and has_minimum_crt_version((0, 19, 18))","tryCatchPattern":"from botocore.exceptions import MissingDependencyException\ntry:\n    s3.upload_file(fn, bucket, key, Config=config)\nexcept MissingDependencyException as e:\n    if 'CRT transfer client' in str(e):\n        s3.upload_file(fn, bucket, key)  # fall back to default transfer client","preventionTips":["Pin 'awscrt>=0.19.18' in requirements whenever you set preferred_transfer_client='crt'.","Verify awscrt is importable in the actual runtime (Lambda layer / Docker image), not just locally.","Prefer preferred_transfer_client='auto' unless you specifically need the CRT client."],"tags":["boto3","s3","crt","dependency","version-mismatch"],"analyzedSha":"c7b4afac237b976d48395d7523eaf7cec3a450b3","analyzedAt":"2026-08-04T20:35:51.598Z","schemaVersion":2}