packetfence icon indicating copy to clipboard operation
packetfence copied to clipboard

Deprecate useless Debian packages for v12 installations

Open nqb opened this issue 2 years ago • 1 comments

Describe the bug After a v12 upgrade on a Debian 11 system, you can see that following packages are still present at 11.2 version:

  • packetfence-captive-portal-javascript
  • packetfence-doc
  • packetfence-pfappserver-javascript

We don't build anymore those packages for v12 because related code is provided through container images.

However, if somebody is trying to rebuild an image using code on server itself, it could generate issue.

I think we could:

  • remove these packages during upgrade process
  • deprecate these packages (involve a rebuild of v12 packages)

nqb avatar Oct 04 '22 14:10 nqb

Wouldn't this cause an issue if you try to rebuild the docker image of the portal on the PF server?

Like to add some debug or adjust the style

julsemaan avatar Oct 04 '22 15:10 julsemaan

Using the documented upgrade procedure for 11.0 documented in 31.2, we ran the run-upgrade.sh script on a Debian 11.6 system that was fully uptodate with OS and PF 11.0 packages.

During the install it presented a default option to go right to 12.1

The result is a broken system mid-upgrade, caught on the above-mentioned package with a dependency problem.

Unpacking packetfence (12.1.0+20230117101649+749647141+0011+maintenance~12~1+bullseye1) over (11.0.0+20230117101814+750157424+0011+maintenance~11.0+bullseye1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-2roP46/00-packetfence_12.1.0+20230117101649+749647141+0011+maintenance~12~1+bullseye1_all.deb (--unpack):
 trying to overwrite '/usr/local/pf/html/common/styles.css', which is also in package packetfence-captive-portal-javascript 11.0.0+20230117101814+750157424+0011+maintenanc
e~11.0+bullseye1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
....
Errors were encountered while processing:
 /tmp/apt-dpkg-install-2roP46/00-packetfence_12.1.0+20230117101649+749647141+0011+maintenance~12~1+bullseye1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

At this point, a bunch of changes have already occurred, and installation of packages that prevent restarting the process and selecting v11.1

The latest stable PacketFence version is 12.1, enter 'y' to upgrade to this version or 'n' to specify the version manually (y/n): n
Please enter the PacketFence version to which you wish to upgrade: 11.1
Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://inverse.ca/downloads/PacketFence/debian/11.1 bullseye InRelease [4,527 B]
Hit:3 http://security.debian.org bullseye-security InRelease
Get:4 http://inverse.ca/downloads/PacketFence/debian/11.1 bullseye/bullseye amd64 Packages [43.4 kB]
Fetched 48.0 kB in 0s (121 kB/s)   
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
packetfence-upgrade was already set on hold.
Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 packetfence : PreDepends: packetfence-perl (= 1.1.2) but 1.2.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

It would seem some work needs to be done to this upgrade script to avoid deprecated packages from breaking upgrades.

ianbmacdonald avatar Jan 22 '23 03:01 ianbmacdonald

Not sure if it worked, but I seem to have stepped through the package installations (accepting new conf files) using the following commands

# dpkg --force-depends -r packetfence-captive-portal-javascript 
# apt --fix-broken install
# /usr/local/pf/addons/full-upgrade/run-upgrade.sh

Some details on output of the above commands is below, which did complete DB changes from 11.0 thru 12.1; Not really sure what cruft might still be hanging around, but seems okay.

pf3:/usr/local/pf/logs# dpkg --force-depends -r packetfence-captive-portal-javascript 
dpkg: packetfence-captive-portal-javascript: dependency problems, but removing anyway as you requested:
 packetfence depends on packetfence-captive-portal-javascript (>= 11.0.0+20230117101814+750157424+0011+maintenance~11.0+bullseye1).

(Reading database ... 130813 files and directories currently installed.)
Removing packetfence-captive-portal-javascript (11.0.0+20230117101814+750157424+0011+maintenance~11.0+bullseye1) ...

...

pf3:/usr/local/pf/logs# apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  packetfence-doc packetfence-pfappserver-javascript
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  packetfence
The following packages will be upgraded:
  packetfence
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
33 not fully installed or removed.

...

pf3:/usr/local/pf/logs# /usr/local/pf/addons/full-upgrade/run-upgrade.sh

Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages were automatically installed and are no longer required:
  packetfence-doc packetfence-pfappserver-javascript
Use 'apt autoremove' to remove them.
The following packages have been kept back:
  packetfence-upgrade
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Canceled hold on packetfence-upgrade.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  packetfence-doc* packetfence-pfappserver-javascript*
0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
After this operation, 59.3 MB disk space will be freed.
(Reading database ... 130942 files and directories currently installed.)
Removing packetfence-doc (11.0.0+20230117101814+750157424+0011+maintenance~11.0+bullseye1) ...
Removing packetfence-pfappserver-javascript (11.0.0+20230117101814+750157424+0011+maintenance~11.0+bullseye1) ...
=================================================================================
Database pf runs version 11.0
Found upgrade path: /usr/local/pf/db/upgrade-11.0-11.1.sql /usr/local/pf/db/upgrade-11.1-11.2.sql /usr/local/pf/db/upgrade-11.2-12.0.sql /usr/local/pf/db/upgrade-12.0-12.1.sql

ianbmacdonald avatar Jan 22 '23 04:01 ianbmacdonald

It seems these packages are now preventing upgrades, so I opened up a separate issue https://github.com/inverse-inc/packetfence/issues/7473

ianbmacdonald avatar Jan 25 '23 23:01 ianbmacdonald