{"record":{"id":"919ea0e63320da80","repo":"testcontainers/testcontainers-java","slug":"invalid-value-for-dockerconfig-source-s","errorCode":null,"errorMessage":"Invalid value for dockerconfig.source: %s","messagePattern":"Invalid value for dockerconfig\\.source: (.+?)","errorType":"exception","errorClass":"InvalidConfigurationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/testcontainers/dockerclient/EnvironmentAndSystemPropertyClientProviderStrategy.java","lineNumber":54,"sourceCode":"\n    EnvironmentAndSystemPropertyClientProviderStrategy(DefaultDockerClientConfig.Builder configBuilder) {\n        String dockerConfigSource = TestcontainersConfiguration\n            .getInstance()\n            .getEnvVarOrProperty(\"dockerconfig.source\", \"auto\");\n\n        switch (dockerConfigSource) {\n            case \"auto\":\n                Optional<String> dockerHost = getSetting(\"docker.host\");\n                dockerHost.ifPresent(configBuilder::withDockerHost);\n                applicable = dockerHost.isPresent();\n                getSetting(\"docker.tls.verify\").ifPresent(configBuilder::withDockerTlsVerify);\n                getSetting(\"docker.cert.path\").ifPresent(configBuilder::withDockerCertPath);\n                break;\n            case \"autoIgnoringUserProperties\":\n                applicable = configBuilder.isDockerHostSetExplicitly();\n                break;\n            default:\n                throw new InvalidConfigurationException(\"Invalid value for dockerconfig.source: \" + dockerConfigSource);\n        }\n\n        dockerClientConfig = configBuilder.build();\n    }\n\n    private Optional<String> getSetting(final String name) {\n        return Optional.ofNullable(TestcontainersConfiguration.getInstance().getEnvVarOrUserProperty(name, null));\n    }\n\n    @Override\n    public TransportConfig getTransportConfig() {\n        return TransportConfig\n            .builder()\n            .dockerHost(dockerClientConfig.getDockerHost())\n            .sslConfig(dockerClientConfig.getSSLConfig())\n            .build();\n    }\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/core/src/main/java/org/testcontainers/dockerclient/EnvironmentAndSystemPropertyClientProviderStrategy.java#L36-L72","documentation":"Thrown by EnvironmentAndSystemPropertyClientProviderStrategy when the testcontainers.dockerconfig.source property has a value outside the known set (auto, autoIgnoringUserProperties). The property controls how the Docker client config source is resolved, and unknown values are rejected during strategy initialization.","triggerScenarios":"Setting system property or environment variable dockerconfig.source (e.g. -Dtestcontainers.dockerconfig.source=...) to a value other than 'auto' or 'autoIgnoringUserProperties' while the environment-and-system-property strategy initializes its DockerClientConfig.","commonSituations":"Typo like 'autoIgnoreUserProperties' or 'Auto'; copying a property from a newer/older testcontainers version where allowed values differ; CI configuration with a stale property.","solutions":["Set testcontainers.dockerconfig.source to a valid value: 'auto' or 'autoIgnoringUserProperties'","Fix typos in the property value (check exact casing)","Remove the property entirely to use the default behavior","Check the testcontainers version docs to confirm which values are supported in your version"],"exampleFix":"// before\n-Dtestcontainers.dockerconfig.source=autoIgnoreUserProperties\n// after\n-Dtestcontainers.dockerconfig.source=autoIgnoringUserProperties","handlingStrategy":"validation","validationCode":"String src = System.getProperty(\"testcontainers.dockerconfig.source\");\nif (src != null && !Set.of(\"auto\", \"autoIgnoringUserProperties\").contains(src))\n    throw new IllegalStateException(\"Invalid testcontainers.dockerconfig.source: \" + src);","typeGuard":"static boolean isValidDockerConfigSource(String s) {\n    return s == null || Set.of(\"auto\", \"autoIgnoringUserProperties\").contains(s);\n}","tryCatchPattern":"try {\n    // initialization that reads dockerconfig.source\n} catch (InvalidConfigurationException e) {\n    if (e.getMessage().startsWith(\"Invalid value for dockerconfig.source\")) {\n        System.clearProperty(\"testcontainers.dockerconfig.source\"); // fall back to default\n    } else throw e;\n}","preventionTips":["Copy property values exactly: 'auto' or 'autoIgnoringUserProperties'","Check docs for your testcontainers version before setting the property","Lint CI env/properties files for testcontainers.* keys","Prefer omitting the property unless you need autoIgnoringUserProperties"],"tags":["docker","config","invalid-value","testcontainers"],"backgroundTag":"invalid-config-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"}