-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker push failed due to "Error pushing to registry: Authentication is required." if build(buildconfig) created first #4518
Comments
OK, it is NOT related to deploymentConfig and "second time". I found the correct order. Reproduce steps (updated):
|
This will cause timing issue. For example, if you wrote BuildConifg ealier than ImageStream in the resource list like:
I wrote the example json, and it 100% caused Auth error with this command.
|
I get the same thing every time with origin master and:
Repeating the build or re-creating the BC doesn't seem to make any difference. |
|
Does this happen if you create a new project, or just in the default project? |
I tested default project, but if I created a new project, I got the error. (However if I tested with F21 with latest origin source, the message was a little changed, although still authentication error.)
|
If I used
|
Different error message has bee appeared from newest sour code or docker 1.8.
Following creation order (BuildConfig->ImageStream) causes above error.
|
@bparees I remember similar errors happening when the build is started before an image stream has a IP for pushing. It happened because there was no way to auto-detect which dockercfg secrets might be valid and so none were chosen. The choice of secret was made (or not made) even though the information was present to know that there wasn't enough information to choose, but it was never re-checked. Is this the same error with a different manifestation? |
it could be. loglevel 5 build logs would give us more info about what, if any, push secret is being used by the build. |
I couldn't find any clue after setting Loglevel 5.- https://paste.fedoraproject.org/265517/ After fixed
entire messages - https://paste.fedoraproject.org/265485/ |
Can you include the JSON build definition and secrets from the namespace? ( |
Sure here is the output of |
thanks, can you also include the JSON definitions of the pod created to run the build? |
The build's |
OK, here it is. https://paste.fedoraproject.org/265912/
Yes, |
Sorry my mistake. Here is the json definitions of the pod created to run the build (builder container pod) |
no push secret populated. and "172.30.50.7:5000/demoproject/helloworld-v3:latest" definitely matches the current docker registry ip? seems like maybe the issue is that something is getting mismatched between the ip you have credentials for and the ip we're trying to push to, which means we don't find an appropriate secret to attach to the pod. is this consistently recreatable? |
Yes, it is match the current docker registry ip.
Yes, it is recreatable. Following commnad will reproduce it. (Need to create bc.json first)
When I failed to build with this error, following messages output to server log. After failed to create secret with Failed log (bc -> is)
Success log (is -> bc)
|
ok here's what's happening. during the generation of the build object, we try to resolve the output IST so we can decide what secret we need to use with it. the resolution fails so we don't setup any push secret, but that does not (and should not) fail the creation of the build object. So a build object gets created. Then the build controller sees it and tries to process the build object. part of processing the build object requires resolving the output IST (so we know where to push). Since we can't do this (no IST yet), the build hangs in a retry state until the IST gets created. Finally the IST gets created and the build proceeds, but the push secret was never set up. The right fix for this is to resolve the output push location at the time we create the build also, but i think there are some flow challenges with doing that. Another option would be to update the push secret when we resolve the reference in the build controller, instead of when creating the build in the buildconfig controller. either way it's a real bug, you need to create your IST before launching the build if you don't want to hit it, but since that's fairly easily worked around i'm lowering it to a sev3. |
also, a second build would work, even if the first encounters this bug, right? |
yes that's what i meant by "fairly easily worked around" but i guess I didn't complete the thought. |
@bparees Yes, that's also the reason I thought it might be better written documentation of |
@bparees I think this should be bumped in priority, as one thing we are doing is:
|
I don't know if it will help but:
I am using same template for deployments. Edit: I've tried fourth build and it passed - same template nothing modified. |
@jorgemoralespou @david-strejc prio bumped. |
thanks form EASY!!! |
this issue exists to resolve exactly one problem, the one described here: please open a separate issue if you are having push issues under another scenario. |
The no basic auth creds problem is still happening for me, and starting a new build doesnt always fix it. |
facing the same issue E0808 18:46:41.896388 1 cfg.go:57] Reading /var/run/secrets/openshift.io/push failed: read /var/run/secrets/openshift.io/push: is a directory
I0808 18:46:41.896421 1 sti.go:215] No push secret provided
I0808 18:46:41.896426 1 sti.go:217] Pushing 172.30.79.164:5000/development/welcome:latest image ...
F0808 18:46:41.908998 1 builder.go:59] Build error: Failed to push image. Response from registry is: Post http://172.30.79.164:5000/v2/development/welcome/blobs/uploads/: no basic auth credentials |
@debianmaster are all your builds failing or just the first one? |
@bparees all build not just first one, iam not able to do any s2i |
@debianmaster then you have a different issue, not this one. likely your project/service account is missing the tokens that should be autogenerated. please open a new issue and tag @liggitt and @deads2k. |
So how this one is going on? still bumpt? |
@Mangirdaz it's still an issue and we still want to fix it, it's not a trivial issue to resolve due to needing to refactor significant chunks of code and given that there are easy workarounds (wait a few seconds after creating a project before you create a build, or rerun your failed build), it's not a high priority. |
- Added buildconfig doc in user guide. - Add inline code documentation to explain why buildconfig object needs to be created after imagestream, because of openshift/origin#4518
we're now tracking this in bugzilla, closing this issue. |
NOTE: It might be expected behaivor, but please allow me to file the report.
Env
Issue
_(Removed reprodce steps, because I wrote wrong steps. I updated below)_
The text was updated successfully, but these errors were encountered: