Skip to content
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 build fails: Failed to push image: unauthized:authentication required #496

Closed
stephanosbacon opened this issue Mar 16, 2017 · 13 comments
Labels
component/OpenShift kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/P2

Comments

@stephanosbacon
Copy link

Pushing image 172.30.46.106:5000/chat/chatback:latest ...
Pushed 0/20 layers, 0% complete
error: build error: Failed to push image: unauthorized: authentication required

After running kompose convert, and editing the resulting buildconfig such that it has a dockerfilePath (dunno if this should make a difference), the resulting build fails with the above failure.

The relevant test case is at: https://github.com/stephanosbacon/chatBack/tree/master/build/kompose

@stephanosbacon
Copy link
Author

If I delete the buildconfig, re-create it via oc-new-build, and then go edit the yaml to set the dockerfilePath, I get the following, which works:

apiVersion: v1
kind: BuildConfig
metadata:
name: chatback
namespace: chat
selfLink: /oapi/v1/namespaces/chat/buildconfigs/chatback
uid: 2de0fe2a-0a71-11e7-8156-f20cfd71a2ac
resourceVersion: '1329'
creationTimestamp: '2017-03-16T17:51:27Z'
labels:
build: chatback
annotations:
openshift.io/generated-by: OpenShiftNewBuild
spec:
triggers:
- type: GitHub
github:
secret: DJO8oSqrmDoNkzj7m4Cf
- type: Generic
generic:
secret: rxdnhyBexz6kPqofQX43
- type: ConfigChange
runPolicy: Serial
source:
type: Git
git:
uri: 'https://github.com/stephanosbacon/chatBack.git'
ref: master
strategy:
type: Docker
dockerStrategy:
dockerfilePath: build/Dockerfiles/Dockerfile_server
output:
to:
kind: ImageStreamTag
name: 'chatback:latest'
resources: {}
postCommit: {}
nodeSelector: null
status:
lastVersion: 2

@surajnarwade
Copy link
Contributor

@stephanosbacon , I am trying to reproduce this error, this config also gives me the same error. this error is coming from openshift and is being tracked here openshift/origin#12474

@kadel
Copy link
Member

kadel commented Mar 20, 2017

Hmm that is strange, I just tried that and it worked for me.

I've skipped oc login and oc adm policy commands from your oc_setup script.
So it looks like it will be some issue with permissions.

@kadel
Copy link
Member

kadel commented Mar 20, 2017

New observations.
with minishift v0.9.0 it works perfectly.
with new 1.0.0-beta.5 it fails

Something is different in new minishift :-(

@kadel
Copy link
Member

kadel commented Mar 20, 2017

It looks like its bug in openshift. openshift/origin#4518

If you create buildconfig first before imagestream it fails. If imagestream is created first it is ok.

@stephanosbacon
Copy link
Author

Will OpenCompose work around it? (It seems to be a combination big deal/low priority to fix on the OpenShift side)

@kadel
Copy link
Member

kadel commented Mar 20, 2017

with kompose up or if you save output to one file ImageStream will always be before BuildConfig. (Or at least it should be if I remember correctly 🤓 )

@surajnarwade
Copy link
Contributor

@kadel , that worked 😛

@kadel kadel added component/OpenShift kind/bug Categorizes issue or PR as related to a bug. priority/P2 labels Apr 26, 2017
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 23, 2017
@cdrage
Copy link
Member

cdrage commented Jan 2, 2018

Can we close this?

@surajnarwade
Copy link
Contributor

cc @stephanosbacon

@stephanosbacon
Copy link
Author

Sure

@cdrage cdrage closed this as completed Jan 4, 2018
@sp1d3rino
Copy link

Check if the serviceaccount chat/builder with system:image-builder role is missing then add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/OpenShift kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/P2
Projects
None yet
Development

No branches or pull requests

7 participants