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

odo deploy fails with 401 while pushing to container registry #6778

Closed
datho7561 opened this issue Apr 27, 2023 · 3 comments
Closed

odo deploy fails with 401 while pushing to container registry #6778

datho7561 opened this issue Apr 27, 2023 · 3 comments
Labels
area/deploy Issues or PRs specific to the `odo deploy` command kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@datho7561
Copy link

/kind bug

What versions of software are you using?

Operating System:

RHEL 8.7

Output of odo version:

odo v3.9.0 (8cb53c2a0)

Server: https://api.crc.testing:6443
Kubernetes: v1.24.0+3882f8f

How did you run odo exactly?

crc start # I made sure that crc started properly
odo login -u developer -p developer
git clone https://github.com/devfile-samples/devfile-sample-go-basic
cd devfile-sample-go-basic
odo deploy

You can also reproduce this bug with version 3.0.0 of the python+flask devfile and starter code

Actual behavior

The component is not deployed to OpenShift, and odo displays the following output:

❯ odo deploy
  __
 /  \__     Running the application in Deploy mode using go Devfile
 \__/  \    Namespace: my-test-project-1
 /  \__/    odo version: v3.9.0
 \__/

↪ Building & Pushing Image: go-image:latest
 •  Building image locally  ...
STEP 1/7: FROM registry.access.redhat.com/ubi9/go-toolset:1.18.9-14
STEP 2/7: COPY . .
--> 6b04abfcc74
STEP 3/7: RUN go mod download
go: no module dependencies to download
--> 4394cddaeaf
STEP 4/7: RUN go build -o ./main
--> 415d97bde34
STEP 5/7: ENV PORT 8081
--> ff5f1bf845f
STEP 6/7: EXPOSE 8081
--> cb6bf788651
STEP 7/7: CMD [ "./main" ]
COMMIT go-image:latest
--> 62cbfab7488
Successfully tagged localhost/go-image:latest
62cbfab7488bcb420404a7be564bb9a41dd2550c027e00fc9ca7037ae98cd193
 ✓  Building image locally [4s]
 •  Pushing image to container registry  ...
Getting image source signatures
Error: trying to reuse blob sha256:314640f419c581ddcac8f3618af39342a4571d5dc7a4e1f5b64d60f37e630b49 at destination: checking whether a blob sha256:314640f419c581ddcac8f3618af39342a4571d5dc7a4e1f5b64d60f37e630b49 exists in docker.io/library/go-image: errors:
denied: requested access to the resource is denied
error parsing HTTP 401 response body: unexpected end of JSON input: ""

 ✗  Pushing image to container registry [507ms]
 ✗  error running podman command: exit status 125

Expected behavior

The component is deployed to OpenShift and odo reports no errors

Any logs, error output, etc?

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 27, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Apr 27, 2023
@rm3l
Copy link
Member

rm3l commented Apr 28, 2023

Hi @datho7561, thanks for reporting this issue!

Indeed, odo currently tries to build and push image names as they are defined in the Devfile.

But we are working on #6565, with the end goal of handling image names as selectors by dynamically pushing images to user-defined (or auto-detected) registries; this would make the Devfile more portable.
I think this is the exact problem that could be addressed with this.
We have a work-in-progress PR (#6768) implementing this feature.

Can you please try using odo from this PR (#6768) and let us know your thoughts? Once you build odo from this PR, you'll need to first set an image registry in the odo settings to use this feature, e.g. (replace with your own registry)
: odo preference set ImageRegistry "<registry.example.com>/$USER"
Thanks.

@github-actions
Copy link
Contributor

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 28, 2023
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Jul 31, 2023
@rm3l
Copy link
Member

rm3l commented Jul 31, 2023

The troubleshooting guide on odo.dev now contains a dedicated section about that kind of issues: https://odo.dev/docs/troubleshooting#odo-deploy-is-failing-to-push-container-image-components-due-to-401-errors

So closing this issue as done.

/close

@rm3l rm3l closed this as completed Jul 31, 2023
@github-project-automation github-project-automation bot moved this to Done ✅ in odo Project Jul 31, 2023
@rm3l rm3l added area/deploy Issues or PRs specific to the `odo deploy` command and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 31, 2023
@rm3l rm3l added this to the v3.13.0 🚀 milestone Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deploy Issues or PRs specific to the `odo deploy` command kind/bug Categorizes issue or PR as related to a bug.
Projects
Archived in project
Development

No branches or pull requests

2 participants