dist: Errors when installing using the install guide
We’re seeing an error when attempting to install Caddy using the install steps for Debian etc.
root@e04c45b8ec2e:/# curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
# Source: Caddy
# Site: https://github.com/caddyserver/caddy
# Repository: Caddy / stable
# Description: Fast, multi-platform web server with automatic HTTPS
deb [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
deb-src [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
root@e04c45b8ec2e:/# apt update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease
Get:5 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease [7491 B]
Err:5 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
Reading package lists... Done
W: GPG error: https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
E: The repository 'https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version 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.
Is there currently an issue with the public key?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 39 (15 by maintainers)
Commits related to this issue
- chore: Fix Debian install instructions See https://github.com/caddyserver/dist/issues/83 for context — committed to caddyserver/xcaddy by francislavoie 2 years ago
- fix(caddy): Fix Caddy installation CloudSmith changed their debian.deb.txt format making previous installation comands fail. See https://github.com/caddyserver/dist/issues/83 — committed to TrAyZeN/homelab by TrAyZeN 2 years ago
- Updating with newer Caddy instructions (GPG steps were broken) - From: https://github.com/caddyserver/dist/issues/83 — committed to johnwyles/linode-docs by johnwyles a year ago
- [Update] Install and Configure the Caddy Web Server on Ubuntu 18.04 (#6252) Updating with newer Caddy instructions (GPG steps were broken) - From: https://github.com/caddyserver/dist/issues/83 (#6252... — committed to linode/docs by johnwyles a year ago
- [Release] v1.333.0 (#6320) * [NEW] How to Remove a Remote Git (#6245) * How to Remove a Remote Git * copy edits --------- Co-authored-by: Andy Stevens <taylorstevens@gmail.com> * [NEW]... — committed to linode/docs by nmelehan a year ago
Workaround; please use this until the docs update is pushed live:
I found a solution.
The problem was: executing the install script as root -> sets restrictive file permissions, which
aptcan’t useI can confirm that “Some people have stated that running the commands as root breaks the key, and a chmod 664 is required on the key.” fixed it for me (was running the script as root).
I did get the same output:
Spending too much time on this…I just decided to download the binary from https://caddyserver.com/download and it seemed to work. 🤷♀️ Thanks for trying to help.
Hey @lskillen Thanks so much. (Sorry I was out sick for a few days.) We’re very happy with Cloudsmith and would be able to help promote it more.
Hey folks, Lee from @cloudsmith-io here. First of all, sorry for the breakage; that’s never a fun thing to hear about. 😦
Talking to the team here and this change was made based on the previous
apt-keyusage being deprecated due to security issues (and then no longer supported on newer distributions going forward). It was likely a bit of a kneejerk reaction because of the impending impact, as there’s a small blog/product update on the way that hasn’t been made live yet to explain it.Part of the issue here is the compatibility to smooth this over was put into the automated script only, which Caddy isn’t using. That’s fine, of course, but it also means users with manual instructions need to update too. The blog will cover this, but the new instructions can also be found in the contextual setup within the repositories.
E.g. For our “demo” public repository, you can see the new instructions here: https://cloudsmith.io/~cloudsmith/repos/examples/setup/#formats-deb
In short (again, for the examples repository on Cloudsmith so don’t use this for Caddy anyone else):
I think you’ve pretty much got that as your current workaround, though!
Again, sorry for any inconvenience, pain and/or annoyance caused. 😃
/cc @francislavoie @mholt
Oh… looks like CloudSmith changed the format of the
debian.deb.txtfile 😬It used to look like this:
Now it looks like this:
So I think we need to adjust our install script to write the GPG key elsewhere.
/cc @lskillen
(I moved the issue to the dist repo, which is the right place for this)
Note for people that still have problems with this:
Keep in mind that the keyfile must have the “read” permission for “others” (e.g. by doing
chmod o+r) (as implicitly mentioned above with thechmod 664suggestion), but also that all parent folders of the keyfile must to have the “execute” permission for “others” (e.g. by doingchmod o+x). So, for example, if you put the keyfile in a folder you created yourself using the root account, you likely need to assign the missing permission as well.👀 Going to ask the team to have a look. I tried the standard route and it was fine (Ubuntu 20.10).
Then I decided I would be a bit more manual and use gpg directly to see what it reports.
Verifying without the public key:
Importing the key:
Verifying with the public key:
155B6D79CA56EA34which matches155B 6D79 CA56 EA34above.ABA1F9B8875A6661which matchesABA1 F9B8 875A 6661above.So it all checks out, however, noting a couple of observations:
NO_PUBKEYbut that might be somehow related to the method.chmod 664is required on the key.…
I did go off and check what our automated script is doing, and although I don’t think it is related, it’s worth saying that we vary the key functionality depending on the version of
aptinstalled. If the user has a version of apt that is at least1.1, then we use the standardsigned-by, otherwise it gets copied to/etc/apt/trusted.gpg.d. However, sinceapt 1.1is from, what, 2016 or around there, it just seems unlikely this is why.Example:
That code is a bit clunky, but it is sorting the
aptversion and the expected version, and see if the expected version is older than1.1(because it would appear first if1.0or something).Docs update is live: https://caddyserver.com/docs/install#debian-ubuntu-raspbian
💯 That’s an oversight on our part, and definitely not intentional. Normally we would communicate any change that may be breaking (it turns out that in the artifact/package management world, almost everything is a breaking change!) In this case, I think it was because of the belief that it wasn’t a breaking change due to the script, so that’s a learning lesson. Sorry again. Good excuse to signup for notifications on the changelog, and for us to be more vigilant. 😃
The fix works perfectly for us, thanks for the prompt reply and have a fantastic day!
Alright, I merged an update to the docs site in https://github.com/caddyserver/website/pull/219, just need @mholt to push it live as soon as he can.