{"record":{"id":"2609166e4da0e45a","repo":"testcontainers/testcontainers-java","slug":"unknown-transport-type-s","errorCode":null,"errorMessage":"Unknown transport type '%s'","messagePattern":"Unknown transport type '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java","lineNumber":401,"sourceCode":"                );\n            })\n            .findFirst();\n    }\n\n    public static DockerClient getClientForConfig(TransportConfig transportConfig) {\n        final DockerHttpClient dockerHttpClient;\n\n        String transportType = TestcontainersConfiguration.getInstance().getTransportType();\n        switch (transportType) {\n            case \"httpclient5\":\n                dockerHttpClient =\n                    new ZerodepDockerHttpClient.Builder()\n                        .dockerHost(transportConfig.getDockerHost())\n                        .sslConfig(transportConfig.getSslConfig())\n                        .build();\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unknown transport type '\" + transportType + \"'\");\n        }\n\n        DefaultDockerClientConfig.Builder configBuilder = DefaultDockerClientConfig\n            .createDefaultConfigBuilder()\n            .withDockerHost(transportConfig.getDockerHost().toString());\n\n        Map<String, String> headers = new HashMap<>();\n        headers.put(\"x-tc-sid\", DockerClientFactory.SESSION_ID);\n        headers.put(\"User-Agent\", String.format(\"tc-java/%s\", DockerClientFactory.TESTCONTAINERS_VERSION));\n\n        try {\n            if (configBuilder.build().getApiVersion() == RemoteApiVersion.UNKNOWN_VERSION) {\n                configBuilder.withApiVersion(RemoteApiVersion.VERSION_1_44);\n            }\n            DockerClient client = DockerClientImpl.getInstance(\n                new AuthDelegatingDockerClientConfig(configBuilder.build()),\n                new HeadersAddingDockerHttpClient(dockerHttpClient, headers)\n            );","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java#L383-L419","documentation":"Thrown by DockerClientProviderStrategy.getClientForConfig when the selected strategy's TransportConfig reports a docker host whose transport type (scheme) is not one of the supported values (unix, tcp, npipe, http/https). It means the library cannot build an HTTP client for the given dockerHost URI scheme.","triggerScenarios":"Calling dockerClient() with a strategy/TransportConfig whose dockerHost URI scheme is unrecognized, e.g. DOCKER_HOST set to something like 'foo://...' or a malformed URI, or a custom strategy returning an unsupported transport type.","commonSituations":"Typo in the DOCKER_HOST scheme in the environment or ~/.testcontainers.properties; a custom TestcontainersConfiguration or client provider strategy returning a hand-built TransportConfig with a wrong scheme; version changes introducing new scheme names.","solutions":["Check DOCKER_HOST and set it to a supported scheme: unix:///var/run/docker.sock, tcp://host:port, or npipe:////./pipe/docker_engine on Windows","Print the resolved config (DefaultDockerClientConfig) and inspect the dockerHost URI scheme","If using a custom strategy, return a TransportConfig whose dockerHost URI uses a supported scheme","Upgrade/align testcontainers versions if a strategy produces a scheme not handled by this core version"],"exampleFix":"// before (env)\nDOCKER_HOST=sock:///var/run/docker.sock\n// after\nDOCKER_HOST=unix:///var/run/docker.sock","handlingStrategy":"validation","validationCode":"String dh = System.getenv(\"DOCKER_HOST\");\nif (dh != null) {\n    java.net.URI uri = java.net.URI.create(dh);\n    Set<String> ok = Set.of(\"unix\", \"tcp\", \"npipe\", \"http\", \"https\");\n    if (!ok.contains(uri.getScheme()))\n        throw new IllegalStateException(\"Unsupported DOCKER_HOST scheme: \" + uri.getScheme());\n}","typeGuard":"static boolean isSupportedDockerHost(java.net.URI u) {\n    return u != null && Set.of(\"unix\", \"tcp\", \"npipe\", \"http\", \"https\").contains(u.getScheme());\n}","tryCatchPattern":"try {\n    DockerClient client = DockerClientFactory.instance().client();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Unknown transport type\")) {\n        // fix or clear DOCKER_HOST and retry with defaults\n    } else throw e;\n}","preventionTips":["Only use unix://, tcp://, or npipe:// schemes for DOCKER_HOST","Validate DOCKER_HOST before running test containers in CI","Keep testcontainers core and strategy versions aligned","Avoid hand-built TransportConfig unless you know supported schemes"],"tags":["docker","config","invalid-url","testcontainers"],"backgroundTag":"invalid-enum-value","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"}