docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.31k stars 553 forks source link

Push access denied #970

Closed CarlosChuan closed 11 months ago

CarlosChuan commented 1 year ago

Logs:

#0 building with "builder-73fb1c8c-16a9-44ca-bb80-dece5a9381e0" instance using docker-container driver

#1 [internal] load git source https://github.com/chuancho22/PraePlan.git#9d61458092455419abe6d9946cadc67c043c9aa0
#1 0.026 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/
#1 0.032 fatal: Not a valid object name 9d61458092455419abe6d9946cadc67c043c9aa0^{commit}
#1 1.970 From https://github.com/chuancho22/PraePlan
#1 1.970  * [new branch]      Frontend-progress     -> origin/Frontend-progress
#1 1.970  * [new branch]      Implementació_Backend -> origin/Implementació_Backend
#1 1.970  * [new branch]      Implementación-fronten-Activitats -> origin/Implementación-fronten-Activitats
#1 1.971  * [new branch]      add_calendario        -> origin/add_calendario
#1 1.971  * [new branch]      main                  -> origin/main
#1 1.971  * [new branch]      maria                 -> origin/maria
#1 1.972  * [new branch]      maria_monis           -> origin/maria_monis
#1 1.972  * [new branch]      revert-5-maria        -> origin/revert-5-maria
#1 DONE 2.0s

#2 [internal] load metadata for docker.io/library/python:3.9-buster
#2 ...

#3 [auth] library/python:pull token for registry-1.docker.io
#3 DONE 0.0s

#2 [internal] load metadata for docker.io/library/python:3.9-buster
#2 DONE 0.8s

#4 [1/7] FROM docker.io/library/python:3.9-buster@sha256:bae5b428ebf32d01a902718b0a58874cbf33d7a4b6a65b7cd7b21d48b0d2e2f1
#4 resolve docker.io/library/python:3.9-buster@sha256:bae5b428ebf32d01a902718b0a58874cbf33d7a4b6a65b7cd7b21d48b0d2e2f1 done
#4 sha256:508cf9d1df6776c6d10cd077eb4546b9bf3bb774ed9c6051da6849961ea49fa2 242B / 242B 0.1s done
#4 sha256:b0eda9c97fd4a2d42571513f0c205e1ae4276f12b3700716064327bdd7a93000 2.10MB / 2.85MB 0.2s
#4 sha256:e4e5f05940354b6c226635bb38623cb858415f00f6f856b25d064a5891f887f8 0B / 18.00MB 0.2s
#4 sha256:0ebfe287e9761b9b7dd1703470ff3473a62fe75238f3de01282165f8725968af 0B / 6.15MB 0.2s
#4 sha256:b0eda9c97fd4a2d42571513f0c205e1ae4276f12b3700716064327bdd7a93000 2.85MB / 2.85MB 0.2s done
#4 sha256:0ebfe287e9761b9b7dd1703470ff3473a62fe75238f3de01282165f8725968af 6.15MB / 6.15MB 0.3s done
#4 sha256:a2e1e233599c00054fb839db78b4d42e6f12f36b64280aa62d482a3ad0ad7[109](https://github.com/chuancho22/PraePlan/actions/runs/6283074496/job/17063188528#step:5:114) 0B / 191.88MB 0.2s
#4 sha256:e4e5f05940354b6c226635bb38623cb858415f00f6f856b25d064a5891f887f8 18.00MB / 18.00MB 0.3s done
#4 sha256:a2e1e233599c00054fb839db78b4d42e6f12f36b64280aa62d482a3ad0ad7109 18.87MB / 191.88MB 0.3s
#4 sha256:b1e7e053c9f6f57c6d95002167a6d57aed6aacf04dd2f8e681cb4f74a7ca4381 0B / 51.87MB 0.2s
#4 sha256:a2e1e233599c00054fb839db78b4d42e6f12f36b64280aa62d482a3ad0ad7109 37.75MB / 191.88MB 0.5s
#4 sha256:3b1c264c0ad4598c25048a6dbd3030086cc5c74000e11d04ac27944cb[116](https://github.com/chuancho22/PraePlan/actions/runs/6283074496/job/17063188528#step:5:121)aabb 17.58MB / 17.58MB 0.2s done
#14 DONE 0.0s

#15 [auth] carloschuan/praeplan-backend:pull,push token for registry-1.docker.io
#15 DONE 0.0s

#16 [auth] carloschuan/praeplan-backend:pull,push token for registry-1.docker.io
#16 DONE 0.0s

#11 exporting to image
#11 ...

#17 [auth] carloschuan/praeplan-backend:pull,push token for registry-1.docker.io
#17 DONE 0.0s

#11 exporting to image
#11 pushing layers 0.9s done
#11 ERROR: failed to push carloschuan/praeplan-backend:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
------
 > exporting to image:
------
ERROR: failed to solve: failed to push carloschuan/praeplan-backend:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
Error: buildx failed with: ERROR: failed to solve: failed to push carloschuan/praeplan-backend:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

The dockerfile:

FROM python:3.9-buster

RUN mkdir app

WORKDIR /app

ENV PATH="${PATH}:/root/.local/bin"
ENV PYTHONPATH=.
ENV PRODUCTION=true

COPY services/backend/requirements.txt .

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

COPY services/backend/sources ./sources

The github actions .yml

name: Docker Image CI

on:
  push:
    branches: [ "main" ]

jobs:

  build:

    runs-on: ubuntu-latest

    steps:
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v3
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
      -
        name: Login to Docker Hub
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build and push
        uses: docker/build-push-action@v5
        with:
          push: true
          tags: carloschuan/praeplan-backend:latest
crazy-max commented 11 months ago
ERROR: failed to push carloschuan/praeplan-backend:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

That means you don't have permissions to push to carloschuan/praeplan-backend.

Did you check that the username is the right one in Login to Docker Hub? Do you repro locally when using the same credentials?

Closing in the meantime but let us know if you still have this issue.

nu11secur1ty commented 3 months ago

This problem one more time. Do you have some DDoS protection requests, or something else? I wanted to work and test, but suddenly everything stopped. Best Regards

ERROR: failed to solve: failed to push nu11secur1ty/bla:bla: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed