-
Notifications
You must be signed in to change notification settings - Fork 8
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
401 Unauthorized pulling from private registry #47
Comments
Hi @anthony-zawacki sorry for the delayed response, are you able to patch this same image locally using copa or does it result in the same error? Also, since you are able to pull the image in the workflow, can you try the containerd image store approach for local images to see if that also results in the same error? |
This is a touch painful. :) At the top of my workflow, I've added:
However, aquasecurity/[email protected] runs and builds a local image in docker before these steps run. Trying to use the crazy-max docker server fails on the trivy step because the local image they built as part of the set up to the action doesn't exist in that docker server. To work around this, in my environment configuration section, changed it to log into the ECR registry with both the "standard" docker server as well as the crazy-max docker server:
Using that, I can see both servers, the crazy-max one running 27.2.0 and the "standard" one running 26.1.3. I updated my image pull section to pull the target image to both docker servers:
This allows trivy to run using the "standard" docker server and copa to run using the crazy-max docker server, both accessing different copies of the same image. The copa step now looks like:
This appears to work, I now get to where copa times out trying to update the image:
This is project-copacetic/copacetic#714 which has been fixed, but not yet released. Is there any facility to run a nightly build of copa of some sort where I could test to see if it actually successfully makes it to the end of the patching, or do we need to wait for 0.7.1 release? I have gotten past the step with a custom-built copa binary where I had fixed the missing |
This issue seems to be related to #46 and using the --docker-host flag within Trivy. We have also released a new version of copa with microdnf issue resolved :) Let me know if theres any other issues! |
Hi, I am also seeing the 401 issue. I have tried to use the instructions for running a local docker setup with |
Yes, for the build I use to test, I changed:
to
My build action uses
because I was debugging. I didn't change this for my test. No other configuration changes, and the image successfully rebuilt in my environment. |
Thanks @anthony-zawacki. I added a comment to an issue on the setup-docker-action repo as that is not starting on my runner - could be because of using custom self-hosted runners. So, I tried to remove the registry details from my image so instead of Did someone state why Copa isn't first looking if the image is already present locally on the runner that is being used? It seems to always default to try and pull the image from the public/private registry it is stored in. |
I'm pretty sure it does use the local image if it's already present, I don't see any evidence of copa pulling the image in the logs. Just be aware that there are two docker servers in the environment, and that you need the image in both servers. The details are in this comment: #47 (comment) There's the "main" docker server which is used by trivy, and there's the "crazy-max" docker server which is used by copa. Just running docker commands without the |
This is the error I am seeing after retagging my image so that it is not going to ECR or This is the Copa command: It feels like it is doing this because the image - Is this why we have to use the external docker server so that the image is pulled into its context and that is what Copa is looking at? Strange that Trivy seems to be ok with the docker install on the runner but not Copa. Am wondering whether to just install Copa directly onto our runner and do everything in a simple shell run command in the workflow. |
If trivy is running properly, I suspect you're only pulling and retagging the image in the main docker server, and that you need to repeat the actions in the "crazy-max" docker server. If you are pulling the image into both servers and retagging them already, then I am at a loss as to what is going wrong. |
Issue #16 is closed indicating that public/private registries are supported, but
project-copacetic/copa-action@main
fails to be able to pull from an ECR registry. I've logged into the registry every way in the github action that I could think to do it. As far as I understand, there are no parameters to the buildx container that runs, so I'm not sure how it's supposed to authenticate with the registry.The documentation at https://github.com/project-copacetic/copa-action?tab=readme-ov-file#ways-to-connect-to-buildkit seems to indicate buildx (Option 1) is the only supported way to connect to private registries.
Selected github action logs:
Example of being able to pull the image locally, can be done as a regular user or as super use, both are successful:
Running the copa action fails with 401 unauthorized:
This is a private registry and private git repository, but the full contents of the github workflow is:
In my case, I have copied the original keycloak image from ironbank to our ECR with a tag of 25.0.1-0 and I'm attempting to patch the image and update the
25.0.1
tag for keycloak with the output from copa. I don't think ironbank images have anything special about them, we could copyregistry.access.redhat.com/ubi9/ubi-minimal:9.4-949
to our private ECR asregistry.access.redhat.com/ubi9/ubi-minimal:9.4-949-0
and then attempt to run copa against it and have the same results.The text was updated successfully, but these errors were encountered: