CircleCI-Public / cimg-gcp

The CircleCI GCP Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/gcp
MIT License
3 stars 2 forks source link

Bug Report: error when running `apt update` command #27

Closed pkhadka56 closed 8 months ago

pkhadka56 commented 8 months ago

Describe the bug Got the following error when running apt update image: cimg/gcp:2023.12

E: The repository 'https://apt.kubernetes.io kubernetes-xenial Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: GPG error: https://packages.cloud.google.com/apt cloud-sdk InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C0BA5CE6DC6315A3
E: The repository 'https://packages.cloud.google.com/apt cloud-sdk InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Exited with code exit status 100

To Reproduce Use the image and run sudo apt update -y

Expected behavior Command runs successfully

Screenshots and Build Links

image
vironeen commented 8 months ago

I am currently experiencing the "packages.cloud.google.com" error and the "apt.kubernetes.io" error.

I also experienced this same "packages.cloud.google.com" error back on 12/19/2023. After about an hour, the issue went away.

peterwwillis commented 8 months ago

Could be related to https://github.com/kubernetes/release/issues/3485

As announced previously, the legacy Kubernetes package repositories (apt.kubernetes.io and yum.kubernetes.io, also known as packages.cloud.google.com) have been shut down (removed) as of 2024-03-04.

vironeen commented 8 months ago

It appears that adding this command before the apt commands has resolved the packages.cloud.google.com error for me.

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/cloud.google.gpg

Note this is the gpg file specified in the gcloud docs. https://cloud.google.com/sdk/docs/install-sdk#deb

vironeen commented 8 months ago

Adding this appears to have addressed the apt.kubernetes.io error

        echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list
        curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg

This code is from the steps to migrate page for migrating away from apt.kubernetes.io https://kubernetes.io/blog/2023/08/15/pkgs-k8s-io-introduction/#how-to-migrate

peterwwillis commented 8 months ago

For those running into this, appears a new container has been issued with a fix: cimg/gcp:2024.03.1

mahadzar81 commented 5 months ago

This appear same issue to me recently Below command works for me

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/cloud.google.gpg