-
Notifications
You must be signed in to change notification settings - Fork 581
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
Error: buildx call failed with: failed to solve: rpc error: code = Unknown desc = unexpected status: 403 Forbidden #238
Comments
As you can see in your logs:
Looks similar to #178 #200. Maybe your personal access token (PAT) does not have the required scopes? |
Aha! Feels like a resource constraint, then. It appears as though the 403 Forbidden might actually be caused by "out of disk space" which eventually became more clear when not using the "push:true" setting for the buildx action and instead doing a "load:true" followed by a separate plain "docker push" step. Since writing the layers works for a while when using "push:true", I think it looks more like the runner actually have permissions to write layers to disk, but it runs out of disk space at some point, would that be possible? Also since the plain docker push equivalence doing the same thing reports that? I did set up the scopes for repo write and read/write for packages and added the CR_PAT to the repository, but will double check again. The CR_PAT was generated with a service account that is used for automated builds. A variant of this job runs on Travis CI without disk space issues. I wonder what the limits are for image size before running into this with GitHub Action runners. |
As I can see in the action window no logs are displayed so maybe you reached the std output limit. Can you build locally and redirect stdout/stderr to a file and let me know the size?
Do you have a link to the Travis build? |
@crazy-max I believe out of disk space is causing this and opened an issue with GitHub to clarify and I just got confirmation that there's ~14 GB of disk space available and 7GB of RAM on the hosted runners at GitHub. I think Travis CI.org offers about 40-50 GB on their runners (but lesser of build time, simultaneous builds quotas). With regards to the awesome actions for cache, qemu, buildx etc, would it be possible to consider an enhancement with regards to the error message, which is a bit vague. Perhaps in case of OOM or OOD, the message "rpc error: code = Unknown desc = unexpected status: 403 Forbidden" could be "Out of disk space or RAM", if it is possible to capture this error condition? I'm still unclear on what I can do about what I can do about this "out of disk" issue, for example a) how to reset the runner when it gets filled up (I'm using the cache action) b) whether the caching "doubles the required space" ie the tarball being written back to disk while the base image layers are also stored on disk c) and if there are workarounds.
A local build generates an image with this footprint:
This build is based on some layers from https://rocker-project.org, which seems to run into a similar issue looking at this action window It is a kind of "big" build in the sense that it bundles a lot of things and is the opposite of a minimalistic Alpine linux image build. I would expect more disk space requirements will be needed for these kinds of builds, especially in the future for supporting having workflows that for example generate prepare and generate "data images" for bundling datasets into OCI compliant "storage" or "data only containers", which seems to be on the roadmap: github/roadmap#119. I guess I'll continue to watch the ghcr roadmap and can always build locally or elsewhere where the is more disk space. |
I'm getting the same issue. I'm using multistage build, and I checked locally, it uses less than 1GB in total:
Login stage shows:
Lastly, the push:
Full build - note this was the third attempt. |
Seems to work fine for Docker Hub. My case is probably an issue with ghcr itself. |
@mskyttner have you "Enabling improved container support" for your account and organisation? |
You could use registry cache instead for that.
Will be available with buildx 0.5.0.
As @atorosyan said your issue is linked to this. See also #205 (comment) |
@crazy-max thanks so much for the help on this, my "big build" now passes after I made two changes a) made it smaller by making a part into an optional install (conda) which effectively reduced the image size to 10GB uncompressed and b) did the settings you recommended with regards to registry cache. No other changes and I'm not sure which one kicked in, but now it pulled through. Travis build failed though, but that is another story. Merry xmas! |
Behaviour
A gha using buildx with push:true reports unexpected status: 403 Forbidden, after login to ghcr.io (which was ok).
Final lines in log before error were:
Steps to reproduce this issue
Expected behaviour
No 403 Forbidden error? I'm not sure what causes that, I don't think it is the CR_PAT token since the login to ghcr.io works.
Actual behaviour
I'm getting that 403. Perhaps some time out kicks in? Or maybe the docker image is too large for the runner? Not sure where to begin to investigate.
Configuration
Workaround
I'm attempting to use a workflow file which instead sets "load: true" and then runs a docker push command, here is a section from the end of that workflow file:
This progresses a bit further with these messages in the log:
But either it is stuck there or takes a long time to complete.
Logs
https://github.com/KTH-Library/kontarion/runs/1441299541?check_suite_focus=true
The text was updated successfully, but these errors were encountered: