{"record":{"id":"2196d88a7ef2c50d","repo":"arduino/Arduino","slug":"no-connection-adapters-were-found-for-s","errorCode":null,"errorMessage":"No connection adapters were found for '%s'","messagePattern":"No connection adapters were found for '(.+?)'","errorType":"exception","errorClass":"InvalidSchema","httpStatus":null,"severity":"error","filePath":"arduino-core/src/processing/app/i18n/python/requests/sessions.py","lineNumber":450,"sourceCode":"        # Shuffle things around if there's history.\n        if history:\n            # Insert the first (original) request at the start\n            history.insert(0, r)\n            # Get the last request made\n            r = history.pop()\n            r.history = tuple(history)\n\n        return r\n\n    def get_adapter(self, url):\n        \"\"\"Returns the appropriate connnection adapter for the given URL.\"\"\"\n        for (prefix, adapter) in self.adapters.items():\n\n            if url.startswith(prefix):\n                return adapter\n\n        # Nothing matches :-/\n        raise InvalidSchema(\"No connection adapters were found for '%s'\" % url)\n\n    def close(self):\n        \"\"\"Closes all adapters and as such the session\"\"\"\n        for _, v in self.adapters.items():\n            v.close()\n\n    def mount(self, prefix, adapter):\n        \"\"\"Registers a connection adapter to a prefix.\"\"\"\n        self.adapters[prefix] = adapter\n\n    def __getstate__(self):\n        return dict((attr, getattr(self, attr, None)) for attr in self.__attrs__)\n\n    def __setstate__(self, state):\n        for attr, value in state.items():\n            setattr(self, attr, value)\n\n","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/arduino/Arduino/blob/a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee/arduino-core/src/processing/app/i18n/python/requests/sessions.py#L432-L468","documentation":"Session.get_adapter() selects a transport adapter by matching the URL against registered adapter prefixes (default 'https://' and 'http://'). If no registered prefix matches the URL's beginning, it raises InvalidSchema — the scheme is unknown or unregistered.","triggerScenarios":"Calling session.send/prepared requests with schemes like 'ftp://', 'file://', 'unix://', or a URL missing its scheme entirely ('example.com/api') so no 'http://' prefix matches; custom adapters removed or a session constructed without default adapters (e.g. via mount manipulation).","commonSituations":"Connecting through unix sockets/custom schemes without mounting an adapter; malformed URLs from config/env missing the scheme; typos like 'htp://'; using Session after Session.close() or clearing self.adapters.","solutions":["Ensure the URL includes the scheme: prefix with 'https://' or 'http://'.","For custom schemes, mount an adapter: session.mount('myapp://', MyAdapter()).","Fix env/config URLs (HTTP_PROXY, base_url settings) that are missing the scheme.","Check for typos in the scheme before dispatching."],"exampleFix":"// before\ns.get('example.com/api')  # InvalidSchema: no adapter matches\n// after\ns.get('https://example.com/api')","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse\ndef ensure_adaptable(session, url):\n    scheme = urlparse(url).scheme\n    if not scheme:\n        raise ValueError('URL missing scheme: %r' % url)\n    if not any(url.startswith(p) for p in session.adapters):\n        raise ValueError('No adapter for scheme %r (mounted: %s)' % (scheme, list(session.adapters)))","typeGuard":null,"tryCatchPattern":"from requests.exceptions import InvalidSchema\ntry:\n    resp = session.get(url, timeout=10)\nexcept InvalidSchema as e:\n    log.error('Unsupported URL scheme: %s', e)\n    raise ValueError('Use http(s):// or mount a custom adapter') from e","preventionTips":["Always include http:// or https:// in URLs built from config/env.","Mount adapters (session.mount) for custom schemes like unix:// before use.","Validate base URLs at startup, not at first request.","Don't clear session.adapters; only add mounts."],"tags":["requests","url","adapter","invalid-scheme","network"],"backgroundTag":"invalid-url-format","analyzedSha":"a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee","analyzedAt":"2026-09-06T10:13:38.901Z","contentChangedAt":"2026-09-06T10:13:38.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}