cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛unable to configure repo for RPM package

Open kevingunn-wk opened this issue 1 year ago • 20 comments

Describe the bug Trying to update or repo to use the new GPG key, but the script to configure the repo points to a baseurl that does not resolve.

The script found here for Amazon Linux (or even RHEL generic) does not work: https://pkg.cloudflare.com/index.html#Amazon-Linux

The baseurl is configured as https://pkg-beta.tun.cfdata.org/cloudflared/rpm and does not resolve.

To Reproduce Steps to reproduce the behavior:

  1. Download script from https://pkg.cloudflare.com/index.html#Amazon-Linux as instructed
  2. Attempt to install with yum install
  3. See error

Expected behavior It seems the URL in the repo config script may be a beta or test URL and should be updated. Tried using hte "old" baseurl ofhttps://pkg.cloudflare.com/cloudflared/rpm, but this fails with mismatch of GPG keys. At this point, unable to install cloudflared using repo package.

Environment and versions

  • OS: Amazon LInux
  • Architecture: AMD
  • Version: 2

Logs and errors

"https://pkg-beta.tun.cfdata.org/cloudflared/rpm/repodata/repomd.xml: [Errno 14] curl#6 - \"Could not resolve host: pkg-beta.tun.cfdata.org\"\nTrying other mirror.\n\n\n One of the configured repositories failed (cloudflared stable),\n and yum doesn't have enough cached data to continue. At this point the only\n safe thing yum can do is fail. There are a few ways to work \"fix\" this:\n\n     1. Contact the upstream for the repository and get them to fix the problem.\n\n     2. Reconfigure the baseurl/etc. for the repository, to point to a working\n        upstream. This is most often useful if you are using a newer\n        distribution release than is supported by the repository (and the\n        packages for the previous distribution release still work).\n\n     3. Run the command with the repository temporarily disabled\n            yum --disablerepo=cloudflared-stable ...\n\n     4. Disable the repository permanently, so yum won't use it by default. Yum\n        will then just ignore the repository until you permanently enable it\n        again or use --enablerepo for temporary usage:\n\n            yum-config-manager --disable cloudflared-stable\n        or\n            subscription-manager repos --disable=cloudflared-stable\n\n     5. Configure the failing repository to be skipped, if it is unavailable.\n"

Additional context

kevingunn-wk avatar Oct 31 '25 19:10 kevingunn-wk

There was a "Public Key Rollover (30 October 2025)" New key URL: https://pkg.cloudflare.com/cloudflare-public-v2.gpg

rgrthat avatar Nov 01 '25 10:11 rgrthat

Same issue here. Ran into the key rollover issue when I was running normal update, so went to re-install the repo definition which points to the new key, but fails because the baseurl is configured for an internal only hostname of Cloudflare's which isn't publicly resolvable.

devondragon avatar Nov 01 '25 21:11 devondragon

So, combine https://github.com/kevingunn-wk & https://github.com/rgrthat.

Manually update /etc/yum.repos.d/cloudflared.repo to use baseurl=https://pkg.cloudflare.com/cloudflared/rpm

and directly download and install the new key.

"sudo dnf update" then worked for me...

SteveElliott avatar Nov 02 '25 01:11 SteveElliott

The usual amateur hour stuff from CF. For others facing this issue, use this .repo:

[cloudflared-stable] name=cloudflared-stable baseurl=https://pkg.cloudflare.com/cloudflared/rpm enabled=1 type=rpm gpgcheck=1 gpgkey=https://pkg.cloudflare.com/cloudflare-ascii-pubkey.gpg

sectary-want-holly avatar Nov 02 '25 05:11 sectary-want-holly

rollover could have been smoother. at the time of writing this .repo file is working fine.

[cloudflared-stable]
name=cloudflared-stable
baseurl=https://pkg.cloudflare.com/cloudflared/rpm
enabled=1
type=rpm
gpgcheck=1
gpgkey=https://pkg.cloudflare.com/cloudflare-public-v2.gpg

0xpsyduck avatar Nov 02 '25 06:11 0xpsyduck

Hi, Sorry for the inconvenience, but the roll out of the new key triggered some old pipelines which changed the .repo file. We have fixed it now, and everything should be working as intended.

jcsf avatar Nov 03 '25 13:11 jcsf

Still not sure this is resolved. The gpg key I'm getting appears to be invalid:

warning: /var/cache/yum/x86_64/2/cloudflared-stable/packages/cloudflared-linux-x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 8d4e5e73: NOKEY

Invalid GPG Key from https://pkg.cloudflare.com/cloudflare-public-v2.gpg: No key found in given key data

Repo file:

[cloudflared-stable]
name=cloudflared-stable
baseurl=https://pkg.cloudflare.com/cloudflared/rpm
enabled=1
type=rpm
gpgcheck=1
gpgkey=https://pkg.cloudflare.com/cloudflare-public-v2.gpg

kevingunn-wk avatar Nov 03 '25 19:11 kevingunn-wk

FWIW. My repo file is the same as yours. I did the following, which prompted me to confirm importing the new key and then it upgraded cloudflared package.

dnf clean packages
dnf upgrade --refresh

I'm running Rocky Linux release 9.6 on a Hetzner VM.

lovette avatar Nov 04 '25 02:11 lovette

Still not sure this is resolved. The gpg key I'm getting appears to be invalid:

warning: /var/cache/yum/x86_64/2/cloudflared-stable/packages/cloudflared-linux-x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 8d4e5e73: NOKEY

Invalid GPG Key from https://pkg.cloudflare.com/cloudflare-public-v2.gpg: No key found in given key data

I've got the same issue on a clean Amazon Linux install

deepy avatar Nov 04 '25 09:11 deepy

Hello! We have tested installing in both RHEL and Amazon Linux instances. Please make sure you're following the correct process for your distribution

https://pkg.cloudflare.com/index.html#Amazon-Linux

GoncaloGarcia avatar Nov 04 '25 14:11 GoncaloGarcia

@GoncaloGarcia the following cloud-init setup produces the above error, it is as far as I can tell correct according to the instructions

yum_repos:
  cloudflared-stable:
    name: cloudflared-stable
    baseurl: https://pkg.cloudflare.com/cloudflared/rpm
    enabled: true
    gpgcheck: true
    gpgkey: https://pkg.cloudflare.com/cloudflare-public-v2.gpg

packages:
  - cloudflared

deepy avatar Nov 04 '25 14:11 deepy

@deepy Do you know how is the key imported by the cloud-init? It seems the issue might be with the encoding of the key. But in our manual tests it seems to work, so maybe there is some limitation on the tool used by cloud-init.

jcsf avatar Nov 04 '25 15:11 jcsf

@jcsf sadly I'm not too familiar with the internals of cloud-init, but the previous ascii key worked just fine For testing I'd recommend running cloud-init directly on an Amazon Linux 2 instance

deepy avatar Nov 04 '25 15:11 deepy

Using the above configuration, it works on AL2023, but not on AL2 (seems like maybe the key format changed and is no longer compatible with AL2).

kevingunn-wk avatar Nov 04 '25 16:11 kevingunn-wk

We have updated the key format. Please try again using this key path: gpgkey=https://pkg.cloudflare.com/cloudflare-ascii-pubkey.gpg

jcsf avatar Nov 04 '25 16:11 jcsf

Ignoring the continued amateur hour here from Cloudflare (how many outages this year?)....

@kevingunn-wk Did you fail to see my prior comment? https://github.com/cloudflare/cloudflared/issues/1545#issuecomment-3477460731 - I gave you (and others) the correct GPG key, yet you refused to utilise it.

sectary-want-holly avatar Nov 05 '25 04:11 sectary-want-holly

@sectary-want-holly the key you linked to is the one that expired, the reason it's working now is because it was updated

If that key was working for you 17 hours ago I'd check to make sure your yum repo is configured to check the gpg key

@jcsf https://pkg.cloudflare.com/cloudflare-ascii-pubkey.gpg works great now, thanks for the quick turnaround!

deepy avatar Nov 05 '25 08:11 deepy

@deepy Just total nonsense. I received the key error. The URL i cited was not the original one referenced in the repo.

sectary-want-holly avatar Nov 05 '25 08:11 sectary-want-holly

I have no idea what key was referenced in the repo previously, but the cloudflare-ascii-pubkey.gpg expired and when I tried upgrading it following the repository I ended up with this issue And with this issue resolved I'm going to happily step out 🙂

deepy avatar Nov 05 '25 08:11 deepy

@sectary-want-holly - I did see your comment and that was what my original repo config looked like for Cloudflare. However, on Oct 31 when I tried installing Cloudflared on a new server, it started failing due to a key issue (the day following CF rolling their key). I tried the ascii-key URL and the public-v2 url, but both keys were failing at one point.

All that said, I just tried the https://pkg.cloudflare.com/cloudflare-ascii-pubkey.gpg key again on Amazon Linux 2 and it is working again (as @deepy said, CF must've updated both keys). Looking at the repo config from https://pkg.cloudflare.com/index.html#Amazon-Linux, looks like CF updated that config (again) and is pointing at the ascii-key url now.

In any case, I have CF installing again on both Amazon Linux 2 and Amazon Linux 2023 hosts.

On AL2, repo config:

[cloudflared-stable]
name=cloudflared-stable
baseurl=https://pkg.cloudflare.com/cloudflared/rpm
enabled=1
type=rpm
gpgcheck=1
gpgkey=https://pkg.cloudflare.com/cloudflare-ascii-pubkey.gpg

On AL2023, same as AL2 or:

[cloudflared-stable]
name=cloudflared-stable
baseurl=https://pkg.cloudflare.com/cloudflared/rpm
enabled=1
type=rpm
gpgcheck=1
gpgkey=https://pkg.cloudflare.com/cloudflare-public-v2.gpg

kevingunn-wk avatar Nov 06 '25 03:11 kevingunn-wk