Skip to content
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

unauthorized: Your request could not be authenticated by the GitHub Packages service #8124

Closed
dumbdonkey opened this issue May 13, 2020 · 7 comments · Fixed by #8225
Closed
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. needs-solution-message Issues where where offering a solution for an error would be helpful priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@dumbdonkey
Copy link

dumbdonkey commented May 13, 2020

Steps to reproduce the issue:

  1. minikube start

Full output of failed command:

[zuoca@localhost .docker]$ minikube start
* minikube v1.10.1 on Centos 7.8.2003
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
E0514 03:56:34.874421   60981 cache.go:129] Error downloading kic artifacts:  getting remote image: GET https://docker.pkg.github.com/v2/kubernetes/minikube/kicbase/manifests/v0.0.10: UNAUTHORIZED: GitHub Docker Registry needs login
* docker "minikube" container is missing, will recreate.
E0514 03:56:35.263407   60981 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"
* Creating docker container (CPUs=2, Memory=972MB) ...
! StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=972mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10: exit status 125
stdout:

stderr:
Unable to find image 'docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10' locally
docker: Error response from daemon: unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
See 'docker run --help'.

docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10* docker "minikube" container is missing, will recreate.
E0514 03:57:09.480425   60981 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"
* Creating docker container (CPUs=2, Memory=972MB) ...
* Failed to start docker container. "minikube start" may fix it: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=972mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10: exit status 125
stdout:

stderr:
Unable to find image 'docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10' locally
docker: Error response from daemon: unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
See 'docker run --help'.

* 
X error provisioning host: Failed to start host: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=972mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10: exit status 125
stdout:

stderr:
Unable to find image 'docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10' locally
docker: Error response from daemon: unauthorized: Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
See 'docker run --help'.

Full output of minikube start command used, if not already included:

Optional: Full output of minikube logs command:

So, how can I login to docker.pkg.github.com? this really confuses me a lot

@afbjorklund
Copy link
Collaborator

This is a bug with the fallback registry, introduced in 7914d05

But there also must have been some issue with the primary ?

You can try pulling it manually, maybe get better messages...

docker pull gcr.io/k8s-minikube/kicbase:v0.0.10

@afbjorklund afbjorklund added co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. labels May 13, 2020
@medyagh
Copy link
Member

medyagh commented May 13, 2020

@dumbdonkey I suspect you are in a restricted network !
you can try to do this
minikube start --driver=docker --base-image= gcr.io/k8s-minikube/kicbase:v0.0.10

replace gcr.io/k8s-minikube/kicbase:v0.0.10 with your country's image repository.

@medyagh medyagh changed the title cannot pull docker image Can not pull base image in china May 13, 2020
@medyagh medyagh added this to the v.1.12.0 milestone May 13, 2020
@medyagh medyagh changed the title Can not pull base image in china Can not pull base image in china May 13, 2020
@medyagh
Copy link
Member

medyagh commented May 13, 2020

@dumbdonkey can you please try this?

docker pull docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10

@afbjorklund
Copy link
Collaborator

afbjorklund commented May 13, 2020

I get:

 docker pull docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10
Error response from daemon: Get https://docker.pkg.github.com/v2/kubernetes/minikube/kicbase/manifests/v0.0.10: no basic auth credentials

I think you need to authenticate for all GitHub Packages access, but only need read:packages

https://help.github.com/en/packages/publishing-and-managing-packages/about-github-packages

They got some (deserved) feedback that this was very unclear from the text on the help site...

You need an access token to publish, install, and delete packages in GitHub Packages

https://gh.neting.ccmunity/t5/GitHub-Actions/docker-pull-from-public-GitHub-Package-Registry-fail-with-quot/td-p/32782

Yes, at present you do need to authenticate to read even publicly available packages.

@1067511899
Copy link

[developer@kubernetestest ~]$ minikube start

  • Centos 7.8.2003 上的 minikube v1.10.1
  • 根据现有的配置文件使用 docker 驱动程序
  • Starting control plane node minikube in cluster minikube
  • Pulling base image ...
    E0514 18:00:39.534977 9696 cache.go:129] Error downloading kic artifacts: getting remote image: GET https://docker.pkg.github.com/v2/kubernetes/minikube/kicbase/manifests/v0.0.10: UNAUTHORIZED: GitHub Docker Registry needs login

1、I use docker login like this:
docker login https://docker.pkg.github.com --username 1067511899 --password ce5455257(the token I get from https://github.com/settings/tokens).
2、I use docker pull and the result is:
docker pull docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10
v0.0.10: Pulling from kubernetes/minikube/kicbase
Digest: sha256:966cb63dd675235b2bf3146c98aae41a30ce62484c6da58190099389b7e8ff2d
Status: Image is up to date for docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10
docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10

so,what can I do to solve the UNAUTHORIZED problem?

thanks a lot.

@medyagh
Copy link
Member

medyagh commented May 15, 2020

we need to add a solution message that if we fall back to github image, the use needs to login

"docker login docker.pkg.github.com"

I would accept any PR that would fix this by adding a solution message, only if the error is unauthorized

@medyagh medyagh changed the title Can not pull base image in china China: can't pull github packages images if can not login May 15, 2020
@medyagh medyagh added needs-solution-message Issues where where offering a solution for an error would be helpful priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels May 15, 2020
@medyagh medyagh changed the title China: can't pull github packages images if can not login add solution message: login to github packages May 17, 2020
@jitendrawas33
Copy link

I was able to get minikube started after referencing locally downloaded image.
Hope it helps !

[krishna@vaikunth ~]$ minikube start --driver=docker --base-image= gcr.io/k8s-minikube/kicbase:v0.0.10

  • minikube v1.10.1 on Centos 7.8.2003
  • Using the docker driver based on existing profile
  • Starting control plane node minikube in cluster minikube
  • docker "minikube" container is missing, will recreate.
    E0519 17:30:18.670926 4852 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
    stdout:

stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"

  • Creating docker container (CPUs=2, Memory=2200MB) ...
    ! StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=2200mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 : exit status 125
    stdout:

stderr:
/usr/bin/docker-current: Error parsing reference: "" is not a valid repository/tag: repository name must have at least one component.
See '/usr/bin/docker-current run --help'.

  • docker "minikube" container is missing, will recreate.
    E0519 17:31:00.105503 4852 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
    stdout:

stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"

  • Creating docker container (CPUs=2, Memory=2200MB) ...
  • Failed to start docker container. "minikube start" may fix it: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=2200mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 : exit status 125
    stdout:

stderr:
/usr/bin/docker-current: Error parsing reference: "" is not a valid repository/tag: repository name must have at least one component.
See '/usr/bin/docker-current run --help'.

X error provisioning host: Failed to start host: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=2200mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 : exit status 125
stdout:

stderr:
/usr/bin/docker-current: Error parsing reference: "" is not a valid repository/tag: repository name must have at least one component.
See '/usr/bin/docker-current run --help'.

  • minikube is exiting due to an error. If the above message is not useful, open an issue:
  • minikube v1.10.1 on Centos 7.8.2003
  • Using the docker driver based on existing profile
  • Starting control plane node minikube in cluster minikube
  • docker "minikube" container is missing, will recreate.
    E0519 17:31:57.544900 5425 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
    stdout:

stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"

  • Creating docker container (CPUs=2, Memory=2200MB) ...
  • Preparing Kubernetes v1.18.2 on Docker 19.03.2 ...
    • kubeadm.pod-network-cidr=10.244.0.0/16
  • Enabled addons: default-storageclass, storage-provisioner
  • Done! kubectl is now configured to use "minikube"

@medyagh medyagh changed the title add solution message: login to github packages login to github packages is needed May 20, 2020
@medyagh medyagh changed the title login to github packages is needed fallback image: login to github packages is needed May 20, 2020
@tstromberg tstromberg changed the title fallback image: login to github packages is needed unauthorized: Your request could not be authenticated by the GitHub Packages service May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. needs-solution-message Issues where where offering a solution for an error would be helpful priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants