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

issue publishing bundle on Harbor 2 #1793

Closed
dberardo-com opened this issue Oct 12, 2021 · 2 comments · Fixed by #2273
Closed

issue publishing bundle on Harbor 2 #1793

dberardo-com opened this issue Oct 12, 2021 · 2 comments · Fixed by #2273
Assignees
Labels
bug Oops, sorry!

Comments

@dberardo-com
Copy link

Describe the bug

i was trying to publish a bundle which uses 2 custom images as dependencies into a private Harbor 2 registry over HTTP. I have faced an issue similar to: #1229

adding the insecure-registry flag solves the issue with the installer, but the two images that i have defined inside the images: block of the porter.yml file are not being pushed correctly.

I am using the docker-compose mixin.

On the bright side: the same error seems to popup when interacting with a PortUs registry, so it seems that registry could also work with porter, and could therefore be added to the list of tested registries.

To Reproduce

Steps to reproduce the behavior:

  1. create a porter project with image dependencies (using the digest field, like in the official documentation)
  2. publish the project on a private, insecure registry using the --insecure-registry argument

Expected behavior

both installer and all image dependencies are pushed in the registry

Porter Command and Output

$ porter publish --insecure-registry
...
Generating Dockerfile =======>

Writing Dockerfile =======>

Starting Invocation Image Build (harbor:port/image:tag) =======>
Pushing CNAB invocation image...
The push refers to repository [....]
70c719657eb4: Preparing
4b4f45f2ac98: Preparing
cdf38cd72117: Preparing
83f1053cc22b: Preparing
87dc58ac540c: Preparing
...
d87a2dd7512: Pushed
tag: digest: sha256:3fe9244... size: 2003

Rewriting CNAB bundle.json...
Defaulting the type of parameter dev_registry_user to string
Defaulting the type of parameter dev_registry_password to string
Starting to copy image harbor:port/image:tag...
Completed image harbor:port/image:tag copy
Starting to copy image my_custom_image@digest...
Failed to copy image image my_custom_image@digest: failed to resolve or push image for service "service-name"
Error: error preparing the bundle with cnab-to-oci before pushing: failed to resolve or push image for service "service-name"
...

Version

latest

@bherw
Copy link

bherw commented Nov 2, 2021

This is also an issue using the official Docker Registry docker image.

@carolynvs
Copy link
Member

I am finally able to reproduce this and think that the problem is how we are passing --insecure-registry to cnab-to-oci. Here is what I got when running porter publish against a local docker registry that is using self-signed TLS certs

$ porter publish -r localhost:55027/mybuns:v1.0.0 --insecure-registry
Pushing CNAB invocation image...
The push refers to repository [localhost:55027/mybuns]
5f70bf18a086: Preparing
1a04589807a1: Preparing
e0d15490b536: Preparing
6b6298008d67: Preparing
b00b581baea5: Preparing
704cc640f891: Preparing
554048199755: Preparing
4d223218b942: Preparing
232350190af6: Preparing
455b047776ff: Preparing
704cc640f891: Waiting
554048199755: Waiting
4d223218b942: Waiting
232350190af6: Waiting
455b047776ff: Waiting
5f70bf18a086: Layer already exists
1a04589807a1: Layer already exists
6b6298008d67: Layer already exists
e0d15490b536: Layer already exists
b00b581baea5: Layer already exists
554048199755: Layer already exists
704cc640f891: Layer already exists
4d223218b942: Layer already exists
232350190af6: Layer already exists
455b047776ff: Layer already exists
77aa53375f882628b5dec9ed0558c948: digest: sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14 size: 2412

Rewriting CNAB bundle.json...
Starting to copy image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14...
Failed to copy image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14: 1 error occurred:
	* failed to fixup the image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14 for service "InvocationImage": failed to resolve image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14: pulling from host localhost:55027 failed with status code [manifests sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14]: 400 Bad Request


error preparing the bundle with cnab-to-oci before pushing: 1 error occurred:
	* failed to fixup the image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14 for service "InvocationImage": failed to resolve image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14: pulling from host localhost:55027 failed with status code [manifests sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14]: 400 Bad Request


error preparing the bundle with cnab-to-oci before pushing: 1 error occurred:
	* failed to fixup the image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14 for service "InvocationImage": failed to resolve image localhost:55027/mybuns:77aa53375f882628b5dec9ed0558c948@sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14: pulling from host localhost:55027 failed with status code [manifests sha256:010e2396d0683005795355a71048e57f742cf53c9a0e9a0214ab9bd905d08b14]: 400 Bad Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants