pivpn/pivpn

dhcpcd5 dependency breaks Pi OS Bookworm

Soriiin opened this issue ยท 17 comments

In raising this issue I confirm that

Describe the issue

The latest release of Pi OS is based on Debian Bookworm. This version has switched from dhcpcd to network-manager: https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/

The PiVPN installation of the base dependency dhcpcd5 (install.sh line 579: BASE_DEPS+=(dhcpcd5)) forces the removal of several core Pi OS packages: pi-bluetooth piwiz raspberrypi-sys-mods raspberrypi-ui-mods rpd-plym-splash userconf-pi

The following packages will be REMOVED:
  pi-bluetooth piwiz raspberrypi-sys-mods raspberrypi-ui-mods rpd-plym-splash userconf-pi

This breaks the normal functioning of the OS.

The script installs this dependency at line 786 by generating the command: sudo apt-get --yes --no-install-recommends install dnsutils grepcidr bsdmainutils dhcpcd5 iptables-persistent from ${SUDO} ${PKG_INSTALL} "${TO_INSTALL[@]}"

Checking the dhcpcd5 package:

user@raspberrypi:~ $ sudo apt satisfy dhcpcd5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 raspberrypi-sys-mods : Breaks: dhcpcd5 (< 1:8.1.2-1+rpt2) but 9.4.1-24~deb12u2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Removing dhcpcd5 from BASE_DEPS no longer targets those OS packages for removal but breaks the install.sh script.

Expected behavior

The normal functioning of the OS must not be affected by the installation of PiVPN.

The script must support both the legacy distros and the new the Bookworm-based Raspberry Pi OS distro.

Please describe the steps to replicate the issue

  1. Create a bootable SD card with "Raspberry Pi OS Full (64-bit)" Released: 2023-10-10
  2. Boot from the card and install the OS, along with all the updates
  3. Open a terminal and run the standard PiVPN install script: curl -L https://install.pivpn.io | bash
  4. Notice that the install script decides it will have to remove several core Pi OS packages, before it pops up the Welcome screen
  5. Finish the PiVPN installation and reboot
  6. Notice that the login screen is now no longer Pi OS themed and that your login is rejected

Have you taken any steps towards solving your issue?

No quick solution is possible because the script is heavily reliant on dhcpcd.

Screenshots

bookworm_login

Where did you run pivpn?

Raspberry Pi 4 B 8GB

Please provide your output from uname -a

Linux raspberrypi 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linux

Details about Operative System

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Installation

The following packages will be REMOVED:
  pi-bluetooth piwiz raspberrypi-sys-mods raspberrypi-ui-mods rpd-plym-splash userconf-pi

Profile / Client creation

No response

Debug output

::: Generating Debug Output
::::            PiVPN debug              ::::
=============================================
::::            Latest commit            ::::
Branch: master
Commit: f9ae9662ecc49896d09cdb38e177d2efa90e7119
Author: camdenAR
Date: Thu Oct 19 18:56:19 2023 -0500
Summary: fix(scripts): Match full client name when disabling
=============================================
::::        Installation settings        ::::
PLAT=Debian
OSCN=bookworm
USING_UFW=0
IPv4dev=wlan0
IPv6dev=wlan0
dhcpReserv=1
IPv4addr=CENSORED
IPv4gw=CENSORED
install_user=CENSORED
install_home=/home/CENSORED
VPN=wireguard
pivpnPORT=CENSORED
pivpnDNS1=CENSORED
pivpnDNS2=CENSORED
pivpnHOST=REDACTED
INPUT_CHAIN_EDITED=0
FORWARD_CHAIN_EDITED=0
INPUT_CHAIN_EDITEDv6=0
FORWARD_CHAIN_EDITEDv6=0
pivpnPROTO=udp
pivpnMTU=1420
pivpnDEV=wg0
pivpnNET=CENSORED
subnetClass=24
pivpnenableipv6=1
pivpnNETv6="CENSORED"
subnetClassv6=64
ALLOWED_IPS="0.0.0.0/0, ::0/0"
UNATTUPG=1
INSTALLED_PACKAGES=(dnsutils grepcidr bsdmainutils dhcpcd5 iptables-persistent wireguard-tools qrencode unattended-upgrades)
=============================================
::::  Server configuration shown below   ::::
[Interface]
PrivateKey = server_priv
Address = CENSORED,CENSORED
MTU = 1420
ListenPort = CENSORED
=============================================
::::  Client configuration shown below   ::::
::: There are no clients yet
=============================================
::::    Recursive list of files in       ::::
::::    /etc/wireguard shown below       ::::
/etc/wireguard:
configs
keys
wg0.conf

/etc/wireguard/configs:
clients.txt

/etc/wireguard/keys:
server_priv
server_pub
=============================================
::::            Self check               ::::
:: [OK] IP forwarding is enabled
:: [OK] Iptables MASQUERADE rule set
:: [OK] WireGuard is running
:: [OK] WireGuard is enabled
(it will automatically start on reboot)
:: [OK] WireGuard is listening on port CENSORED/udp
=============================================
:::: Having trouble connecting? Take a look at the FAQ:
:::: https://docs.pivpn.io/faq
=============================================
:::: WARNING: This script should have automatically masked sensitive       ::::
:::: information, however, still make sure that PrivateKey, PublicKey      ::::
:::: and PresharedKey are masked before reporting an issue. An example key ::::
:::: that you should NOT see in this log looks like this:                  ::::
:::: YIAoJVsdIeyvXfGGDDadHh6AxsMRymZTnnzZoAb9cxRe                          ::::
=============================================
::::            Debug complete           ::::
:::
::: Debug output completed above.
::: Copy saved to /tmp/debug.log
:::

Well this is pretty critical.

Just happened to me, latest stable bookworm (64 bit) , Pi 3B+. I had no choice but to wipe SD card and start again. I'll install again when it's fixed (this time I've backed up).

If anyone really needs to stay on Bookworm for some reason but also needs Wireguard, wg-easy is a docker implementation that works. Note it's also quite slow compared to a bare metal WG install, like 75Mbps versus 750Mbps, but that may be good enough for some users until pivpn is fixed. If it's fixed.

I would suggest the script gets altered straight away to detect bookworm and abort until it is resolved.

If I am going to put time I don't have won't be to abort, but rather to fix!
if anyone has the time to make a pull request ill accept it

This being said, next time you have a suggestion anywhere on a opensource project, better to make a valid one or maybe with some code.

ill take a look at this if I have time during the weekend

I think it's a pretty good suggestion as it literally breaks raspbian (showstopper) and I wouldn't want it to happen to anybody else. At the very least a warning in big characters and getting somebody to press Yes to continue. i've been spending the day rebuilding the pi from scratch (I had other software which I found tricky to configure, and I don't regard myself as an expert). Lesson learned, keep backups up to date.

That being said thankyou for supplying/contributing to this and trying to sort it out. I know it's time consuming.

Took a quick second to look at this now, and I am not so sure if this is at all a pivpn related issue .. .bookworm is supported by pivpn since Jully 2.

commit ef6b0e825d30b43306af999fbb9af6119ea370db (tag: v4.4.0-test.1)
Author: 4s3ti <4s3ti@4s3ti.net>
Date:   Sun Jul 2 11:19:29 2023 +0200

    feat: Support debian 12(Bookworm)

The package raspberrypi-sys-mods that breaks dhcpcd5, which tells me that in the meantime something changed on that particular packaged ... or .. something should have changed in dhcpcd5 that didn't and causes this to break

this being said it sounds very raspberry pi specific, not sure if I have one at hand at the moment I can use to test this out, but will see what I can do over the weekend.

Dhcpcd has been replaced by Networkmanager in all versions of RaspiOS bookworm.
I have tried to roll back to dhcpcd(5), but without success, so I'll stick with Bullseye for now.

Dhcpcd has been replaced by Networkmanager in all versions of RaspiOS bookworm.
I have tried to roll back to dhcpcd(5), but without success, so I'll stick with Bullseye for now.

This doesn't seem to be the problem.

Unfortunately I cannot test and replicate the issue because raspbian os bookworm only runs on raspberry pi 4 or 5, and I currently don't own any of them to test.

The issue does not happen when running on pure Debian bookworm VMs, which confirms my suspicion of something weird going on with the Raspbian OS Version of it.

So as it was suggested before "should just detect bookworm and exit" is not an option because Bookworm is effectively supported but raspbian os is breaking it and without a valid method of testing I can't either fix the issue or find a reliable way to exit, therefore, this will keep being an issue until someone decides to help and submit a PR to endorse this issue or until maybe I buy a rpi5 which is not really something where I wish to spend money at the moment.

Maybe if someone send me the output of the following commands I can come up with something to give a warning and exit:

  • cat /etc/os-release
  • lsb_release -si
  • lsb_release -sc

FYI 64 bit (and probably 32 bit) Bookworm runs on Pi 3B+. With PI imager you need to select "no filtering". Apparently it works with 3B and 3A+ models as well.

Hei, I am not really expert, but I try to help you.
I have a RPi4 with Bookworm 64but

  • lsb_release -si
    No LSB modules are available.
    Debian
  • lsb_release -sc
    No LSB modules are available.
    bookworm

FYI 64 bit (and probably 32 bit) Bookworm runs on Pi 3B+. With PI imager you need to select "no filtering". Apparently it works with 3B and 3A+ models as well.

๐Ÿคฆ yeah saw it now, got it working, and running tests.

@leimsiv thanks! I managed to get it working on the rpi3 thanks to the @TheCakeGit tip.

will run some tests and get back soon

There's a fix on the test branch, adding support for NetworkManager on Bookworm for devices where chaning the Ip address is a possibility.

I am going to run some more tests before merging it to main branch, but if you guys are keen into trying and testing it too feel free.

The fix has been merged into the master branch, and NetworkManager is now supported on Bookworm running on Raspberry Pi OS. However, our pipelines are currently experiencing issues, as Travis CI frequently interrupts them. It might be time for a change!

Now that I've resolved the issue, let me provide some additional context and further clarify my previous response.

English is not the first language for most people, so the way we communicate here holds significant importance.

Few things demotivate me (and I believe many open-source project maintainers) more than someone jumping into an issue and dictating what the maintainers should or should not do. If you have a clear idea of what should be done, then I encourage you to take the initiative yourself.

If you lack knowledge about the codebase and have no valuable insights to share, please refrain from adding empty suggestions or "shoulds" and "shouldn'ts."

Open-source projects are often sustained through the generosity of individuals who invest their time and money, often at the expense of spending time with their families. So, the next time you want to comment on a GitHub issue, pull request, or, honestly, anywhere on the internet, please avoid making demands or providing empty suggestions.

For instance, a comment like, "I too encountered this issue, which severely disrupted my Raspberry Pi's normal functionality. It seems it might affect a broader user base. Is there anyone available to investigate this further, and how can I assist in expediting the resolution?" is a much more polite and motivating way to notify contributors of your issue.

Let's all strive to be better humans and remember that there's always someone on the other side doing their best to solve problems so that you don't have to.

The conversation will be locked now. If you encounter additional issues, please feel free to open a discussion or a new issue if it's relevant, and this time, approach it with a more humane attitude.

Thank you all for using PiVPN! โค๏ธ

๐ŸŽ‰ This issue has been resolved in version 4.5.0-test.1 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 4.5.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€