[FAQ] GHCR push returns denied in GitHub Actions even with packages: write
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker, github-actions
- Área
- devops, documentation
Línea de trabajo
Lee la entrada de preguntas frecuentes del repositorio y compara sus pasos para solucionar problemas y el ejemplo de reintento con el .github/workflows/cd.yml enlazado. Confirma que la redacción distingue entre el fallo observado en el primer push y las causas habituales relacionadas con los permisos y los nombres; termina cuando la respuesta sea clara y el ejemplo apunte al workflow que funciona.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 8
- Forks
- 20
- Merge medio
- 3 d 14 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DataTalksClub/faq
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 70/100
DataTalksClub/faq#545 ·
Los mantenedores suelen responder en 2 días
-
Fixing ValueError: feature_names must not contain [, ], or < in XGBoostPosiblemente ocupada @github-actions la tomó hace 7 días. Abiertofaq-proposal
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DataTalksClub/faq#536 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
How to fix uv warning: VIRTUAL_ENV does not match the project environment pathPosiblemente ocupada @github-actions la tomó hace 7 días. Abiertofaq-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
DataTalksClub/faq#534 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Fixing ValueError: This solver needs samples of at least 2 classes in Logistic RegressionPosiblemente ocupada @github-actions la tomó hace 7 días. Abiertofaq-proposal
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
DataTalksClub/faq#532 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
DataTalksClub/faq#531 ·
Los mantenedores suelen responder en 2 días
Todos los issues de DataTalksClub/faq
Issues similares
-
binding:python bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
open-webui/open-terminal#210 ·
-
triage/confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agentscope-ai/agentscope#3807 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#150542 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
triton-inference-server/server#9069 ·
Los mantenedores suelen responder en 1 día