docker-java: Invalid Auth config file when using credsStore
Using a “credsStore” configuration for auth in ~/.docker/config.json causes AuthConfigFile to fail with an IOException.
com.github.dockerjava.api.exception.DockerClientException: Failed to parse dockerCfgFile
at com.github.dockerjava.core.DefaultDockerClientConfig.effectiveAuthConfig(DefaultDockerClientConfig.java:268)
at com.github.dockerjava.core.DockerClientImpl.pullImageCmd(DockerClientImpl.java:215)
Caused by: java.io.IOException: Invalid Auth config file
at com.github.dockerjava.core.AuthConfigFile.loadConfig(AuthConfigFile.java:146)
at com.github.dockerjava.core.DefaultDockerClientConfig.effectiveAuthConfig(DefaultDockerClientConfig.java:266)
... 16 more
After a little debugging it looks like the json parsing fails silently a little earlier in AuthConfigFile.java:
com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [map type; class java.util.LinkedHashMap, [simple type, class java.lang.String] -> [simple type, class com.github.dockerjava.api.model.AuthConfig]] from String value ('osxkeychain'); no single-String constructor/factory method
at [Source: config.json; line: 4, column: 3] (through reference chain: java.util.LinkedHashMap["credsStore"])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:878)
at com.fasterxml.jackson.databind.deser.ValueInstantiator._createFromStringFallbacks(ValueInstantiator.java:281)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromString(StdValueInstantiator.java:284)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:334)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:26)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringMap(MapDeserializer.java:495)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:341)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:26)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3736)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2639)
at com.github.dockerjava.core.AuthConfigFile.loadConfig(AuthConfigFile.java:117)
at com.github.dockerjava.core.DefaultDockerClientConfig.effectiveAuthConfig(DefaultDockerClientConfig.java:266)
at com.github.dockerjava.core.DockerClientImpl.pullImageCmd(DockerClientImpl.java:215)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 17 (6 by maintainers)
Commits related to this issue
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to dleischnig/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to dleischnig/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to dleischnig/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to dleischnig/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to dleischnig/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to KostyaSha/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to KostyaSha/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to KostyaSha/docker-java by deleted user 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to KostyaSha/docker-java by deleted user 7 years ago
- #806 - config.json now may have unstructured content without `auths` - the actually observed sample added as new test - related to https://youtrack.jetbrains.com/issue/IDEA-175307 — committed to borlander/docker-java by borlander 7 years ago
- #806 - Fixed (unrelated) check-styles violations - unrelated to previous commit - should fix https://travis-ci.org/docker-java/docker-java/jobs/252597111 — committed to borlander/docker-java by borlander 7 years ago
- #806 - config.json now may have unstructured content without `auths` - the actually observed sample added as new test - related to https://youtrack.jetbrains.com/issue/IDEA-175307 — committed to borlander/docker-java by borlander 7 years ago
- #806 - Fixed (unrelated) check-styles violations - unrelated to previous commit - should fix https://travis-ci.org/docker-java/docker-java/jobs/252597111 — committed to borlander/docker-java by borlander 7 years ago
- #806 - config.json now may have unstructured content without `auths` - the actually observed sample added as new test - related to https://youtrack.jetbrains.com/issue/IDEA-175307 (cherry picked fro... — committed to borlander/docker-java by borlander 7 years ago
- Merge pull request #884 from borlander/#806-only-unknown-config-v3 #806 - config.json now may have unstructured content without `auths` — committed to docker-java/docker-java by KostyaSha 7 years ago
- fix(#806): filter config.json before unmarshalling As ObjectMapper expects all propeties of json content to match AuthConfig it fails on any other like "credStore" or "HttpHeaders". As only "auths" i... — committed to TuKangTech/docker-java by deleted user 7 years ago
- #806 - config.json now may have unstructured content without `auths` - the actually observed sample added as new test - related to https://youtrack.jetbrains.com/issue/IDEA-175307 (cherry picked fro... — committed to TuKangTech/docker-java by borlander 7 years ago
- Merge pull request #884 from borlander/#806-only-unknown-config-v3 #806 - config.json now may have unstructured content without `auths` — committed to TuKangTech/docker-java by KostyaSha 7 years ago
- pom: update version of org.testcontainers. The previous version used an old dependency of docker-java and this caused an error, when local docker configuration has auth credentials (see https://github... — committed to dbmdz/blueprints by stefan-it 6 years ago
- pom: update version of org.testcontainers. The previous version used an old dependency of docker-java and this caused an error, when local docker configuration has auth credentials (see https://github... — committed to dbmdz/blueprints by stefan-it 6 years ago
Same issue. Gradle build always fails on macOS with latest version of https://github.com/bmuschko/gradle-docker-plugin and
docker-java
version3.0.6
.config.json:
The error still happens with version 3.0.14 when using
com.bmuschko.docker-remote-api
gradle plugin.~/.docker/config
content isDocker version is
Version 2.0.0.0-mac81 (29211)
, Engine Version: 18.09.0Securely store Docker logins in macOS keychain
is unchecked in Preference.Please advise…
plan release soon, seems i solved swarm tests so probably master will be forwarded to 3.1.0 at the same time
Answering my own question: Docker -> preferences -> general :: uncheck the checkbox “Securely store credentials …”
Can we expect a release soon with this fix? Without the fix every gradle build relying on the bmuschko/gradle-docker-plugin is broken.