You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@bsideup identified issue #270 as the possible cause.
After testing with version 1.1.7 the test passed. So it's likely a regression caused by the above issue.
Just an extra detail. After the test passed using version 1.1.7 I recompiled with 1.1.9 and the test passed. I had to manually delete the redis image to cause the error to occur again. So if you already have the required image in your local environment you may need to remove it to reproduce.
Reacted by Nikita Salnikov-Tarnovski and Jair Avilés
When I found this issue I was testing on a machine that has a ~/.docker/config.json file present. I believe this file is used to store auth details for private repositories.
I just tried to reproduce the issue on another machine with the exact same environment. The only difference is that this machine does not have a ~/.docker/config.json file present. The test passed fine with version 1.1.9.
Hi @peter-evans
Sorry - that's very odd. Could you possibly share the ~/.docker/config.json file as well (please do mask out any sensitive values, though!)
This will probably help reproduce and also identify if there are any edge cases for parsing that need to be handled upstream in docker-java. @tourea might be interested to know about this if there is anything!
I noticed that the entry in the file for my company's internal docker registry is different. It uses identitytoken instead of email.
Removing that one entry from the file allows the file to be parsed and the spring boot project test passes with version 1.1.9. It seems likely that the parsing code for config.json isn't taking into account the identitytoken format.
The product my company is using is the Docker Datacenter. It comes with the Docker Trusted Registry component, which I believe is using the identitytoken format.
@peter-evans Sorry for the slow response.
It looks like that field isn't supported in docker-java's AuthConfig DTO. I'm not sure why the changes to support registry v2 format broke things, though. Is it possible that 1.1.7 was working for you because docker-java ignored your registry config, whereas now it's trying and failing to parse it?
@rnorth Yes, I believe that is why version 1.1.7 was working. Before this change docker-java didn't support config.json and so didn't attempt to parse it.
I think you are right about that AuthConfig DTO. The Docker Trusted Registry, which is a component of the newly branded Docker Enterprise Edition, is the official commercial offering from Docker, so it really should support it.
I have similar problem - parsing fails when config.json contains "credsStore".
There was an issue for this in docker-java (docker-java/docker-java#806) and it's fixed, but new version wasn't released yet. It will be included in docker-java 3.0.12.
Reacted by Nikita Salnikov-Tarnovski, Aboubacar Toure, Tom Haines and Ivan Li
I have the same issue with the unrecognized identitytoken.
A PR has just been merged in project docker-java to solve this (docker-java/docker-java#1004).
I think this issue could be closed as soon as the new release of docker-java with the fix is available is used.
@nowheresly are you aware of reliable workaround, until this issue is fixed in the upstream (other than removing "identitytoken": ... from ~/.docker/config.json)? Even with image pull disabled like:
Hi @majusmisiak , unfortunately, my current workaround consist in remove the identityToken (by calling docker logout).
In fact the fix is located in only one class of docker-java project. Maybe if you try to put the correct version of the AuthConfig class somewhere in your classpath so that it takes precedence over the official one inside the docker-java jar, it may help.
The correct version of the class can be found here in this PR docker-java/docker-java#1083
Hi @nowheresly, patching this single class directly solved the problem. I used AuthConfig.java directly from master (sha1 153e06a4) with testcontainers:core 1.8.3 and testcontainers:docker-compose 0.9.9.
This seems more portable workaround than removing "identitytoken: ..., since I can run it as-it-is on any build server.
Many thanks, now awaiting docker-java 3.1.0 release.
Activity
peter-evans commentedon Feb 18, 2017
When I found this issue I was testing on a machine that has a
~/.docker/config.jsonfile present. I believe this file is used to store auth details for private repositories.I just tried to reproduce the issue on another machine with the exact same environment. The only difference is that this machine does not have a
~/.docker/config.jsonfile present. The test passed fine with version 1.1.9.rnorth commentedon Feb 18, 2017
Hi @peter-evans
Sorry - that's very odd. Could you possibly share the
~/.docker/config.jsonfile as well (please do mask out any sensitive values, though!)This will probably help reproduce and also identify if there are any edge cases for parsing that need to be handled upstream in docker-java. @tourea might be interested to know about this if there is anything!
Richard
peter-evans commentedon Feb 20, 2017
Hi @rnorth
This is the file: config.json.txt
Except for the following two actions to mask sensitive details everything in the file is unchanged.
companynameThere is one entry in the file for a company internal docker registry. All the other entries have presumably been inserted by the Google Cloud SDK.
peter-evans commentedon Feb 20, 2017
I noticed that the entry in the file for my company's internal docker registry is different. It uses
identitytokeninstead ofemail.Removing that one entry from the file allows the file to be parsed and the spring boot project test passes with version 1.1.9. It seems likely that the parsing code for
config.jsonisn't taking into account theidentitytokenformat.The product my company is using is the Docker Datacenter. It comes with the Docker Trusted Registry component, which I believe is using the
identitytokenformat.Update: Docker Datacenter has been re-branded Docker Enterprise Edition.
rnorth commentedon Mar 3, 2017
@peter-evans Sorry for the slow response.
It looks like that field isn't supported in docker-java's
AuthConfigDTO. I'm not sure why the changes to support registry v2 format broke things, though. Is it possible that 1.1.7 was working for you because docker-java ignored your registry config, whereas now it's trying and failing to parse it?We'll need to look into this further.
peter-evans commentedon Mar 3, 2017
@rnorth Yes, I believe that is why version 1.1.7 was working. Before this change docker-java didn't support
config.jsonand so didn't attempt to parse it.I think you are right about that AuthConfig DTO. The Docker Trusted Registry, which is a component of the newly branded Docker Enterprise Edition, is the official commercial offering from Docker, so it really should support it.
peter-evans commentedon Mar 5, 2017
Spotify's docker-client also had the same issue and it seems to have been fixed recently here with an update here. That fix might help as a reference.
mabn commentedon Jun 30, 2017
I have similar problem - parsing fails when config.json contains "credsStore".
There was an issue for this in docker-java (docker-java/docker-java#806) and it's fixed, but new version wasn't released yet. It will be included in docker-java 3.0.12.
email2liyang commentedon Jul 15, 2017
I have the same issue when I try to use version 1.3.1
bsideup commentedon Jul 26, 2017
Hi @peter-evans, @mabn, and @email2liyang,
we just released 1.4.2, it should fix the issue, could you please try it? Thanks!
3 remaining items
nowheresly commentedon Aug 15, 2018
I have the same issue with the unrecognized
identitytoken.A PR has just been merged in project docker-java to solve this (docker-java/docker-java#1004).
I think this issue could be closed as soon as the new release of docker-java with the fix is available is used.
[-]"Failed to parse dockerCfgFile" Issue[/-][+]Support for identitytoken auth type[/+]rnorth commentedon Aug 16, 2018
Thanks @nowheresly - will watch out for that being released.
majusmisiak commentedon Sep 4, 2018
@nowheresly are you aware of reliable workaround, until this issue is fixed in the upstream (other than removing
"identitytoken": ...from~/.docker/config.json)? Even with image pull disabled like:it is still failing with
org.testcontainers.shaded.com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.Should the config be read, if pulling is disabled?
nowheresly commentedon Sep 4, 2018
Hi @majusmisiak , unfortunately, my current workaround consist in remove the identityToken (by calling docker logout).
In fact the fix is located in only one class of docker-java project. Maybe if you try to put the correct version of the AuthConfig class somewhere in your classpath so that it takes precedence over the official one inside the docker-java jar, it may help.
The correct version of the class can be found here in this PR docker-java/docker-java#1083
majusmisiak commentedon Sep 5, 2018
Hi @nowheresly, patching this single class directly solved the problem. I used
AuthConfig.javadirectly from master (sha1 153e06a4) with testcontainers:core 1.8.3 and testcontainers:docker-compose 0.9.9.This seems more portable workaround than removing
"identitytoken: ..., since I can run it as-it-is on any build server.Many thanks, now awaiting docker-java 3.1.0 release.
bsideup commentedon Sep 5, 2018
@majusmisiak have you tried running the code from #845 PR?
If not, could you please? @rnorth is currently testing it and any feedback will help 👍
majusmisiak commentedon Sep 6, 2018
@bsideup it will give it a spin locally and add comment on PR if I come up with anything useful for you.
rnorth commentedon Sep 7, 2018
I think we'll probably need to bump up to docker-java 3.1.0-rc4 to benefit from that PR. I think that would be worth including in #845...
bsideup commentedon Sep 7, 2018
@rnorth yes, upgrading docker-java is a good idea 👍
nowheresly commentedon Sep 7, 2018
I agree as well since this bug is really annoying.
rnorth commentedon Sep 10, 2018
We updated docker-java in #845 on Friday.
We have this out in a Release Candidate build (1.9.0-rc1) for anyone who is keen to try it!
Release notes
kiview commentedon Oct 1, 2018
Fixed with #845.
We recommend trying out Testcontainers 1.9.1. If this problem persists, I'll gladly reopen the issue.
jonkjenn commentedon May 3, 2019
Seems to me the support for
identitytokenwas not introduced until docker-java 3.1.0-rc5?