{"record":{"id":"55b061c8364ac87b","repo":"boto/boto3","slug":"unsupported-source-type-source-55b061","errorCode":null,"errorMessage":"Unsupported source type: {source}","messagePattern":"Unsupported source type: (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"boto3/resources/response.py","lineNumber":71,"sourceCode":"    for identifier in identifiers:\n        source = identifier.source\n        target = identifier.target\n\n        if source == 'response':\n            value = jmespath.search(identifier.path, raw_response)\n        elif source == 'requestParameter':\n            value = jmespath.search(identifier.path, params)\n        elif source == 'identifier':\n            value = getattr(parent, xform_name(identifier.name))\n        elif source == 'data':\n            # If this is a data member then it may incur a load\n            # action before returning the value.\n            value = get_data_member(parent, identifier.path)\n        elif source == 'input':\n            # This value is set by the user, so ignore it here\n            continue\n        else:\n            raise NotImplementedError(f'Unsupported source type: {source}')\n\n        results.append((xform_name(target), value))\n\n    return results\n\n\ndef build_empty_response(search_path, operation_name, service_model):\n    \"\"\"\n    Creates an appropriate empty response for the type that is expected,\n    based on the service model's shape type. For example, a value that\n    is normally a list would then return an empty list. A structure would\n    return an empty dict, and a number would return None.\n\n    :type search_path: string\n    :param search_path: JMESPath expression to search in the response\n    :type operation_name: string\n    :param operation_name: Name of the underlying service operation.\n    :type service_model: :ref:`botocore.model.ServiceModel`","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/boto/boto3/blob/6e10b029c1326a437932a8b24f38af69fd986e15/boto3/resources/response.py#L53-L89","documentation":"Raised by the resource factory when building a resource's response from its identifier model. Each identifier declares a `source` describing where its value comes from, and only four values are supported: `requestParameter`, `identifier`, `data`, and `input`. Any other value means the bundled resource model JSON is malformed or incompatible with this boto3 version. Users almost never hit this through their own code; it signals a broken or mismatched installation.","triggerScenarios":"A service's `resources-1.json` defines an identifier whose `source` field is something other than `requestParameter`/`identifier`/`data`/`input`. Occurs after `boto3.resource(...)` and a subsequent load/action on that resource triggers `build_identified_keywords`/response processing in `boto3/resources/response.py`.","commonSituations":"boto3 and botocore installed at incompatible versions (e.g. downgrading one without the other), a corrupted/partially-removed package install, a locally patched or hand-edited resource model under `boto3/data/`, or a third-party plugin that injects non-standard resource definitions.","solutions":["Reinstall boto3 cleanly: `pip install --force-reinstall boto3` so boto3 and botocore are re-paired to compatible versions.","Pin a known-good boto3/botocore pair in requirements.txt (e.g. `boto3==X.Y.Z botocore==X.Y.Z`) and reinstall.","Remove any local edits or monkey-patches to `boto3/data/<service>/resources-1.json` and any custom resource loader hooks.","Verify the file isn't corrupt: `python -c \"import boto3; boto3.resource('s3')\"` in a fresh virtualenv to isolate environment-specific breakage."],"exampleFix":"# before: mismatched versions after a partial upgrade\n#   pip install --upgrade botocore   (left boto3 stale)\nimport boto3\nboto3.resource('ec2').instances.all()  # raises NotImplementedError: Unsupported source type\n\n# after\npip install --force-reinstall --no-cache-dir boto3","handlingStrategy":"type-guard","validationCode":"import boto3, botocore\n# Ensure a coherent pair before using resources\nassert boto3.__version__ and botocore.__version__\n# Smoke-test the resource model loads\ntry:\n    boto3.resource('s3')\nexcept NotImplementedError as e:\n    print('boto3/botocore model mismatch:', e)","typeGuard":"def safe_resource(session, service_name):\n    try:\n        return session.resource(service_name)\n    except NotImplementedError:\n        # fall back to client; reinstall flagged elsewhere\n        return session.client(service_name)","tryCatchPattern":"try:\n    res = boto3.resource('ec2')\nexcept NotImplementedError:\n    # reinstall boto3, then retry once; do not silently swallow","preventionTips":["Pin boto3 and botocore to a known-compatible pair in requirements.","Run `pip install --upgrade boto3` so both move together.","Add a smoke-test (`boto3.resource('s3')`) to CI after dependency changes."],"tags":["resource-model","installation","internal","version-mismatch"],"backgroundTag":null,"analyzedSha":"6e10b029c1326a437932a8b24f38af69fd986e15","analyzedAt":"2026-08-11T20:52:47.213Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}