{"record":{"id":"07a20b41d52dc5c0","repo":"testcontainers/testcontainers-java","slug":"unknown-docker-host-scheme-skipping-the-strategy-test","errorCode":null,"errorMessage":"Unknown DOCKER_HOST scheme {}, skipping the strategy test...","messagePattern":"Unknown DOCKER_HOST scheme (.+?), skipping the strategy test\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java","lineNumber":204,"sourceCode":"                if (!new File(dockerHost.getPath()).exists()) {\n                    log.debug(\"DOCKER_HOST socket file '{}' does not exist\", dockerHost.getPath());\n                    return false;\n                }\n                socketProvider =\n                    () -> {\n                        switch (dockerHost.getScheme()) {\n                            case \"unix\":\n                                return UnixSocket.get(dockerHost.getPath());\n                            case \"npipe\":\n                                return new NamedPipeSocket(dockerHost.getPath());\n                            default:\n                                throw new IllegalStateException(\"Unexpected scheme \" + dockerHost.getScheme());\n                        }\n                    };\n                socketAddress = new InetSocketAddress(\"localhost\", 2375);\n                break;\n            default:\n                log.warn(\"Unknown DOCKER_HOST scheme {}, skipping the strategy test...\", dockerHost.getScheme());\n                return true;\n        }\n\n        try (Socket socket = socketProvider.call()) {\n            Awaitility\n                .await()\n                .atMost(TestcontainersConfiguration.getInstance().getClientPingTimeout(), TimeUnit.SECONDS) // timeout after configured duration\n                .pollInterval(Duration.ofMillis(200)) // check state every 200ms\n                .pollDelay(Duration.ofSeconds(0)) // start checking immediately\n                .untilAsserted(() -> socket.connect(socketAddress));\n            return true;\n        } catch (Exception e) {\n            log.warn(\"DOCKER_HOST {} is not listening\", dockerHost, e);\n            return false;\n        }\n    }\n\n    /**","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java#L186-L222","documentation":"Testcontainers saw a DOCKER_HOST URI whose scheme it does not recognize while testing a strategy. Instead of failing, it logs a warning and returns true (assumes the strategy works, skipping the socket reachability check). Common when the scheme is misspelled or an unsupported transport is used.","triggerScenarios":"DOCKER_HOST set to a URI whose scheme is not one of tcp, http, https, unix, or npipe — e.g. `DOCKER_HOST=docker://...`, `DOCKER_HOST=ssh://...`, `DOCKER_HOST=TCP://...` (uppercase), or a typo like `unix:://`.","commonSituations":"Typo in DOCKER_HOST; copying an ssh:// Docker context URI into DOCKER_HOST (docker-java/Testcontainers do not support ssh transport via scheme); trailing whitespace or uppercase scheme; IDE or CI config exporting a scheme from a non-Docker tool.","solutions":["Set DOCKER_HOST to a supported scheme: tcp://host:port, http://, https://, unix:///var/run/docker.sock, or npipe:////./pipe/docker_engine.","Check for typos and casing (`echo $DOCKER_HOST`) and fix the scheme spelling.","If you intended to use Docker over SSH, use a Docker context or an SSH tunnel (e.g. socat/ssh -L to expose a tcp:// endpoint) instead of an ssh:// DOCKER_HOST.","Alternatively let Testcontainers auto-detect the environment by unsetting DOCKER_HOST."],"exampleFix":"// before\nDOCKER_HOST=ssh://user@dockerhost\n// after\nDOCKER_HOST=tcp://localhost:2375  # via `ssh -L 2375:/var/run/docker.sock user@dockerhost`\n# or use a supported scheme such as unix:///var/run/docker.sock","handlingStrategy":"validation","validationCode":"// Validate the scheme before tests run\nString dh = System.getenv(\"DOCKER_HOST\");\nif (dh != null) {\n    String scheme = java.net.URI.create(dh.trim()).getScheme();\n    if (scheme == null || !java.util.Set.of(\"tcp\", \"http\", \"https\", \"unix\", \"npipe\").contains(scheme.toLowerCase())) {\n        throw new IllegalStateException(\"Unsupported DOCKER_HOST scheme '\" + scheme + \"' in: \" + dh);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Sanity-check `echo $DOCKER_HOST` in CI before the build; it must use tcp/http/https/unix/npipe.","Don't copy ssh:// Docker context endpoints into DOCKER_HOST; use docker context or a tunnel instead.","Unset DOCKER_HOST in dev to let Testcontainers auto-detect a sane default."],"tags":["docker","docker-host","url-scheme","configuration","testcontainers"],"backgroundTag":"invalid-url-format","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}