[FAQ] GHCR push returns denied in GitHub Actions even with packages: write
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 86/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, github-actions
- Ambito
- devops, documentation
Direzione di ricerca
Leggi la voce delle FAQ nel repository e confronta i passaggi per la risoluzione dei problemi e l’esempio di nuovo tentativo con il .github/workflows/cd.yml collegato. Verifica che la formulazione distingua il fallimento osservato al primo push dalle cause abituali legate alle autorizzazioni e ai nomi; il lavoro è completato quando la risposta è chiara e l’esempio rimanda al workflow funzionante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Course
ai-dev-tools-zoomcamp
Question
Final project CI/CD: my GitHub Actions workflow gets denied when pushing a new image to GHCR, even though it has packages: write and docker login succeeds. How do I fix it?
Answer
Re-run the job, and add a retry to the push. In my project the first push of each brand-new package failed, and the same push succeeded on the re-run, with no change to the workflow.
What the log looked like. The layers upload, then the push fails:
ae51df8ce05a: Pushed
error from registry: denied
denied
I had two images, and each one failed once. The first run failed on the API image. The re-run published it and then failed on the frontend image. The third run published both. Later pushes to the same packages had no problem.
Before assuming that's your issue, check the usual causes of denied:
- The workflow or job has
permissions: packages: write. The default token may be read-only. - The image name uses your own lowercase owner:
ghcr.io/<owner>/<name>. docker/login-actionusespassword: ${{ secrets.GITHUB_TOKEN }}, and the log showsLogin Succeeded!.
If all three are fine and the package doesn't exist yet, retry so a fresh setup doesn't need a manual re-run:
for attempt in 1 2 3; do
docker push --all-tags "$repository" && break
[ "$attempt" = 3 ] && exit 1
sleep 15
done
I don't know the exact cause on GitHub's side. This is what I observed, on a public repository with a user-owned package.
Working example: https://github.com/devotuoma/chamaledger/blob/main/.github/workflows/cd.yml
Checklist
- I have searched existing FAQs and this question is not already answered
- The answer provides accurate, helpful information
- I have included any relevant code examples or links
- Lingua principale
- Python
- Stelle
- 8
- Fork
- 20
- Merge medio
- 3g 14h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataTalksClub/faq
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
DataTalksClub/faq#545 ·
I maintainer di solito rispondono entro 2 giorni
-
Fixing ValueError: feature_names must not contain [, ], or < in XGBoostForse già presa @github-actions l’ha presa 7 giorni fa. Apertafaq-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
DataTalksClub/faq#536 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
How to fix uv warning: VIRTUAL_ENV does not match the project environment pathForse già presa @github-actions l’ha presa 7 giorni fa. Apertafaq-proposal
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
DataTalksClub/faq#534 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Fixing ValueError: This solver needs samples of at least 2 classes in Logistic RegressionForse già presa @github-actions l’ha presa 7 giorni fa. Apertafaq-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
DataTalksClub/faq#532 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
DataTalksClub/faq#531 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di DataTalksClub/faq
Issue simili
-
binding:python bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-webui/open-terminal#210 ·
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agentscope-ai/agentscope#3807 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#150542 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
triton-inference-server/server#9069 ·
I maintainer di solito rispondono entro 1 giorno