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

Debian repository signing key for packages.element.io expires on 2023-04-15 #807

Closed
Tracked by #24263
richvdh opened this issue Nov 17, 2022 · 43 comments · Fixed by #584
Closed
Tracked by #24263

Debian repository signing key for packages.element.io expires on 2023-04-15 #807

richvdh opened this issue Nov 17, 2022 · 43 comments · Fixed by #584
Assignees
Labels
T-Task Tasks for the team like planning

Comments

@richvdh
Copy link
Member

richvdh commented Nov 17, 2022

See #807 (comment)

The debian installation instructions for element desktop, at https://element.io/get-started#linux-details, suggest downloading the key at https://packages.element.io/debian/element-io-archive-keyring.gpg and configuring apt to trust it.

This key will expire on 2023-04-15. Before then it will be necessary to update the key and get everyone to download it again.

See element-hq/element-web#16960 for the last time this happened.

@richvdh
Copy link
Member Author

richvdh commented Nov 17, 2022

One way to get everyone to update would be to build and distribute a keyring package containing the key and the apt config.

@richvdh
Copy link
Member Author

richvdh commented Nov 17, 2022

See also matrix-org/synapse#10389

@robintown robintown added the T-Task Tasks for the team like planning label Nov 18, 2022
@t3chguy t3chguy self-assigned this Nov 18, 2022
@davidegirardi
Copy link

davidegirardi commented Nov 18, 2022

One way to get everyone to update would be to build and distribute a keyring package containing the key and the apt config.

So a keyring package signed by the current key, containing the old and new key at first, then just the (future) current key until it is time to renew again?

@richvdh
Copy link
Member Author

richvdh commented Nov 18, 2022

Typically we don't replace the key, just reissue the same on with an extended validity period. So: a keyring package signed by the current key, containing the current key.

@davidegirardi
Copy link

But having a package would help us in case we need to rotate a key too, right?

@richvdh
Copy link
Member Author

richvdh commented Nov 18, 2022

yes

@davidegirardi
Copy link

Two birds with one stone then.

@Nurmagoz

This comment was marked as off-topic.

@t3chguy

This comment was marked as outdated.

@t3chguy

This comment was marked as outdated.

@richvdh
Copy link
Member Author

richvdh commented Mar 16, 2023

Just for clarity, since it confused me for a while:

The debian installation instructions for element desktop, at https://element.io/get-started#linux-details, suggest downloading the key at https://packages.element.io/debian/element-io-archive-keyring.gpg

This is different to the key at https://packages.element.io/element-release-key.gpg.

@t3chguy
Copy link
Member

t3chguy commented Mar 17, 2023

Thanks for your help with this @richvdh - new keyring has been deployed, along with a keyring package included in 1.11.25 onwards, I will ensure some announcement/docs are available for anything updating from <1.11.25 after the expiration date of the old keyring

@t3chguy
Copy link
Member

t3chguy commented Apr 11, 2023

The previous GPG key securing our Debian repository packages.element.io expires on the 15th April 2023, we've reissued the same key with an extended validity period.

If when running apt update you see a message like the following

Err:4 https://packages.element.io/debian default InRelease
  The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages <[email protected]>
Reading package lists... Done
W: GPG error: https://packages.element.io/debian default InRelease: The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages <[email protected]>
E: The repository 'https://packages.element.io/debian default 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.

image

Run sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg and apt update should work once again

@philclifford
Copy link

@t3chguy Sadly not working for me :

W: Failed to fetch https://packages.riot.im/debian/dists/default/InRelease  The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages <[email protected]>
W: Some index files failed to download. They have been ignored, or old ones used instead.
gpg -k --no-default-keyring --keyring /usr/share/keyrings/element-io-archive-keyring.gpg
/usr/share/keyrings/element-io-archive-keyring.gpg
--------------------------------------------------
pub   rsa4096 2019-04-15 [SC] [expires: 2033-03-13]
      12D4CD600C2240A9F4A82071D7B0B66941D01538
uid           [ unknown] riot.im packages <[email protected]>
sub   rsa3072 2019-04-15 [S] [expires: 2025-03-15]

@stayen
Copy link

stayen commented Apr 17, 2023

@t3chguy Alas, that didn't compute:

W: GPG error: https://packages.element.io/debian default Release: The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages <[email protected]>
E: The repository 'https://packages.riot.im/debian default Release' is no longer signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

@t3chguy
Copy link
Member

t3chguy commented Apr 17, 2023

@philclifford & @stayen what does your /etc/apt/sources.list.d/element-io.list say? Likely the path to the keyring it is pointing to is different than the instructions at https://element.io/download#linux

@eighthave
Copy link

This worked for me:

$ grep signed-by /etc/apt/sources.list.d/packages_riot_im_debian.list 
deb [arch=amd64 signed-by=/usr/share/keyrings/element-desktop-keyring.gpg] https://packages.riot.im/debian/ bullseye main
$ sudo gpg --no-default-keyring \
	     --keyring /usr/share/keyrings/element-desktop-keyring.gpg \
	     --refresh-keys

@philclifford
Copy link

philclifford commented Apr 17, 2023

Thanks @eighthave : the --refresh-keys was key !
@t3chguy I have the same new keyring in /usr/share/keyrings/element-io-archive-keyring.gpgand /usr/share/keyrings/element-desktop-archive-keyring.gpg and my current sources.list.d entry points to the first of those :

grep '^deb.*elemen' /etc/apt/sources.list.d/*list
/etc/apt/sources.list.d/element-io.list:deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main

As shown above that file was already the new keyring. Only after the sudo .. --refresh-keys apt is finally happy again.

@richvdh
Copy link
Member Author

richvdh commented Apr 17, 2023

@t3chguy:

sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg \ 
          https://packages.element.io/debian/element-io-archive-keyring.gpg
sudo gpg --no-default-keyring \
	     --keyring /usr/share/keyrings/element-desktop-keyring.gpg \
	     --refresh-keys

The second step seems like it should be unnecessary - the apt sources list only refers to /usr/share/keyrings/element-io-archive-keyring.gpg so it should be unnecessary to import the key into a second keyring file.

@philclifford and @eighthave appear to have apt-sources lists (or some other apt configuration) which refer to the wrong keyring file. I'd recommend fixing that problem and deleting the second keyring file, otherwise you're going to have the same problem next time the key gets updated.

@stayen
Copy link

stayen commented Apr 18, 2023

@t3chguy

# cat /etc/apt/sources.list.d/element-io.list
deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main

On https://element.io/download#linux

echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main" | sudo tee /etc/apt/sources.list.d/element-io.list

Looks like I'm in sync. The trick with "--refresh-keys" from @eighthave comment above worked for me, though: after importing the keys, no complaints from apt.

Thanks.

@eighthave
Copy link

eighthave commented Apr 18, 2023 via email

@t3chguy t3chguy pinned this issue Apr 18, 2023
@t3chguy t3chguy transferred this issue from element-hq/element-web Apr 18, 2023
@trancephorm
Copy link

None of the solutions here offered are working here, I still get "The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages [email protected]"

Using Ubuntu 22.04, anyone has the same system?

@hex-m
Copy link

hex-m commented Apr 19, 2023

@trancephorm I had that issue because in addition to the element-repo, I still had the old packages.riot.im-repo configured. Check all the files in /etc/apt/sources.list.d/.

@trancephorm
Copy link

Yes I noticed that in the meantime and deleted old repo. Now it's ok, thank you... Isn't it possible that this repository information is also updated with .deb packages? It's a must if you ask me.

@bielsnohr
Copy link

In case anyone else ends up down this internet rabbit hole like me, the easier fix is simply

sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg

Assuming that is the key that has been used to sign in the output of

grep signed-by /etc/apt/sources.list.d/packages_riot_im_debian.list
# or if on ubuntu
grep signed-by /etc/apt/sources.list.d/element-io.list

@richvdh
Copy link
Member Author

richvdh commented Apr 25, 2023

In case anyone else ends up down this internet rabbit hole like me, the easier fix is simply

sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg

Isn't that exactly what it says at #807 (comment)? Or am I missing some detail?

@bielsnohr
Copy link

Isn't that exactly what it says at #807 (comment)? Or am I missing some detail?

Nope, you are correct. I missed that line at the end of that answer. I think I saw the image and then my brain thought "this is just someone reporting the same issue I am having".

I'm happy to delete my answer if you think that is appropriate.

@richvdh
Copy link
Member Author

richvdh commented Apr 25, 2023

I'm happy to delete my answer if you think that is appropriate.

Just wanted to check I wasn't missing something.

@hedaniel7
Copy link

hedaniel7 commented Apr 28, 2023

I tried every solution here, twice, still no luck. I still get
`W: GPG error: https://packages.element.io/debian default Release: The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages [email protected]

E: The repository 'https://packages.riot.im/debian default Release' 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.
`
Anybody got some new ideas?

@Sweellie
Copy link

Sweellie commented May 1, 2023

I tried every solution here, twice, still no luck. I still get `W: GPG error: https://packages.element.io/debian default Release: The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages [email protected]

E: The repository 'https://packages.riot.im/debian default Release' 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. ` Anybody got some new ideas?

I am still confronted with the same issue. Have tried all the above and more, but none really helped.

@joho1968
Copy link

joho1968 commented May 2, 2023

Same here. None of the suggested fixes work for me. Using Ubuntu 20.04.LTS.

@Nixon-Joseph
Copy link

Also running into the same issue. Tried all the suggestions, but am unable to move forward. Does anyone know a good way we could simply start over?

@richvdh
Copy link
Member Author

richvdh commented May 4, 2023

Those still having trouble:

  1. Check your /etc/apt/sources.list.d/element-io.list. Check that it matches the documentation. It should contain exactly the following:

    deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.element.io/debian/ default main
    

    If it has something else, fix it.

  2. Check that you do not have any other files in /etc/apt/sources.list.d, or /etc/apt/sources.list itself, which reference packages.element.io or packages.riot.im. If you do, remove those lines or files.

  3. Make sure you have followed the instructions above, ie:

    sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg
    sudo apt update
    
  4. If it's still not working, and you have double-checked all the steps above: paste the output of each of the following into a pastebin (such as https://gist.github.com/) and share the link here:

    • grep -r --include '*.list' '^deb' /etc/apt/sources.list /etc/apt/sources.list.d
      
    • gpg /usr/share/keyrings/element-io-archive-keyring.gpg
      
    • sudo apt update
      

@Nixon-Joseph
Copy link

@richvdh Thank you for this - looks like the part of this that worked for me specifically was the second step:

Check that you do not have any other files in /etc/apt/sources.list.d, or /etc/apt/sources.list itself, which reference packages.element.io or packages.riot.im. If you do, remove those lines or files.

@joho1968 take a look and see if these help you out as well.

@Sweellie
Copy link

Sweellie commented May 5, 2023

@richvdh . thank you for the tip! It helped to remove the files first. Now sudo apt update runs fine again! 👍

@mYnDstrEAm
Copy link

Had the same problem. The quick solution was:

  • Rerun these steps: https://element.io/download#linux
  • sudo rm /etc/apt/sources.list.d/riot-im.list (if that doesn't solve it search in the /etc/apt/sources.list.d folder)

@timdonovanuk
Copy link

Way to overcomplicate this. Don't break things for users if you can't publish steps to easily remedy it. Linking to private internal docs or letting users post 10 different workarounds is not good software engineering.

@t3chguy
Copy link
Member

t3chguy commented May 15, 2023

Linking to private internal docs

What private internal docs?

Users which were relatively up to date (2 months or less) would have had zero interruption as long as they followed instructions on element.io to begin with, as element-io-archive-keyring would have been a recommended install which would have used the updated keyring.

Other users can follow #807 (comment) assuming they installed following the instructions at element.io. There's an infinite number of ways you can modify your apt sources and gpg keyrings configurations to vary from the official installation instructions in which case no off the shelf instructions will help you.

@joho1968
Copy link

@richvdh Thank you for this - looks like the part of this that worked for me specifically was the second step:

Check that you do not have any other files in /etc/apt/sources.list.d, or /etc/apt/sources.list itself, which reference packages.element.io or packages.riot.im. If you do, remove those lines or files.

@joho1968 take a look and see if these help you out as well.

Yeah, I had some old riot stuff lying around apparently. After following the post you were quoting and removing *riot*, things started working.

@teapot9
Copy link

teapot9 commented Aug 20, 2023

I had the issue where apt update would have the GPG issue: W: GPG error: https://packages.element.io/debian default InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2850B265AC085BD

The solution was to chmod 644 /usr/share/keyrings/element-io-archive-keyring.gpg because I had configured umask to be 0027 so wget was creating /usr/share/keyrings/element-io-archive-keyring.gpg with mode 640 and apt could not read it.

@t3chguy
Copy link
Member

t3chguy commented Jan 18, 2024

@Master-Koy its literally complaining about a different repository.

W: GPG error: https://deb.leap.se/client release InRelease: The following signatures were invalid: EXPKEYSIG 1E34A1828E207901 LEAP archive signing key <[email protected]>
E: The repository 'https://deb.leap.se/client release InRelease' is not signed.

Remove the faulty repository to unbreak your apt-get.

@t3chguy
Copy link
Member

t3chguy commented Jan 18, 2024

No, as it depends on how you added deb.leap.se, I suggest asking them for help.

@t3chguy
Copy link
Member

t3chguy commented Jan 18, 2024

How would I know, they're in your computer's apt sources. Our instructions don't mention deb.leap.se whatsoever.

@t3chguy t3chguy unpinned this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging a pull request may close this issue.