rpm-ostree upgrade failing: failed to invoke method OpenImage

Started seeing this yesterday when trying to manually run rpm-ostree upgrade to grab my latest image.
error: Preparing import: Fetching manifest: failed to invoke method OpenImage: Requesting bearer token: received unexpected HTTP status: 403 Forbidden
error: Preparing import: Fetching manifest: failed to invoke method OpenImage: Requesting bearer token: received unexpected HTTP status: 403 Forbidden
Anyone else suddenly encounter this?
4 Replies
Luke Skywunker
Couple of things to check: 1. Did you make your images private? 2. Did you at some point login to ghcr.io as root? The login token may have expired
matt_savvy
matt_savvyOP4w ago
Yup the images are private, but they already were. I don't think I've logged in to GHCR as root I'm not sure if rpm-ostree is trying to use docker, podman, or something else under the hood IIRC, when I first made the images private, all I had to do was login with podman and I was good to go And podman pull is able to pull the image just fine
Luke Skywunker
It uses podman Or at least the underlying apis It doesn't use the same container storage But it does use the same settings as far as I've been able to tell
matt_savvy
matt_savvyOP3w ago
I think I've figured it out /etc/ostree/auth.json looks like this
{
"auths": {
"ghcr.io": {
"auth": "<some token>"
}
}
}
{
"auths": {
"ghcr.io": {
"auth": "<some token>"
}
}
}
And I figured out that it didn't actually match what the podman token looked like I basically just manually updated /etc/ostree/auth.json and now rpm-ostree upgrade is happily pulling my image So I'm guessing what happened is that 1. the first time, I had to authenticate podman and ostree/rpm-ostree just grabbed that data and made a copy of it under /etc/ostree 2. at some point recently, I had to cycle the GH token 3. logging into podman (with or without sudo) was able to update podman's copy of this just fine, but not this version under /etc/ostree, so I was able to pull fine on podman 4. rpm-ostree upgrade was now checking /etc/ostree/auth.json, seeing the old token, using that, and getting nowhere.

Did you find this page helpful?