zabbly / incus

Incus package repository
176 stars 14 forks source link

Failed to update on Pop_OS 22.04 LTS #33

Closed nalakawula closed 4 months ago

nalakawula commented 4 months ago

I tried apt update this morning and encounter following error:

Setting up incus-base (0.7-202403261636-ubuntu22.04) ...
Failed to restart incus.service: Unit incus.service not found.
dpkg: error processing package incus-base (--configure):
 installed incus-base package post-installation script subprocess returned error exit status 5
dpkg: dependency problems prevent configuration of incus:
 incus depends on incus-base (= 0.7-202403261636-ubuntu22.04); however:
  Package incus-base is not configured yet.

dpkg: error processing package incus (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 incus-base
 incus
E: Sub-process /usr/bin/dpkg returned an error code (1)

It was solved by removing incus and incus-base then reinstall them.

I am using stable repo

/etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: jammy
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/zabbly.asc

Thank you

stgraber commented 4 months ago

Would have been interesting to get some of the systemd state before removing and reinstalling the packages as there's now no way to figure out what caused the issue :(

stgraber commented 4 months ago

Closing as there's no further action we can take once the packages have been removed and reinstalled.

It's almost certainly an issue with a local override (manual or automatic) of one of the units in /etc which didn't get automatically cleaned on upgrade, but we'll need someone else to hit the same situation to be able to figure it out.

broizter commented 4 months ago

@stgraber I just hit the same issue on Debian 12 using the stable repo. I have not reinstalled yet in case you want me to help troubleshoot.

3 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  incus incus-base incus-client
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 81.0 MB of archives.
After this operation, 13.2 MB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 https://pkgs.zabbly.com/incus/stable bookworm/main amd64 incus amd64 0.7-202403261638-debian12 [23.5 MB]
Get:2 https://pkgs.zabbly.com/incus/stable bookworm/main amd64 incus-base amd64 0.7-202403261638-debian12 [53.1 MB]
Get:3 https://pkgs.zabbly.com/incus/stable bookworm/main amd64 incus-client amd64 0.7-202403261638-debian12 [4,409 kB]
Fetched 81.0 MB in 4s (18.4 MB/s)
(Reading database ... 55546 files and directories currently installed.)
Preparing to unpack .../incus_0.7-202403261638-debian12_amd64.deb ...
Unpacking incus (0.7-202403261638-debian12) over (0.6-202403181631-debian12) ...
Preparing to unpack .../incus-base_0.7-202403261638-debian12_amd64.deb ...
Unpacking incus-base (0.7-202403261638-debian12) over (0.6-202403181631-debian12) ...
Preparing to unpack .../incus-client_0.7-202403261638-debian12_amd64.deb ...
Unpacking incus-client (0.7-202403261638-debian12) over (0.6-202403181631-debian12) ...
Setting up incus-client (0.7-202403261638-debian12) ...
Setting up incus-base (0.7-202403261638-debian12) ...
Removed "/etc/systemd/system/multi-user.target.wants/incus-lxcfs.service".
Created symlink /etc/systemd/system/multi-user.target.wants/incus-lxcfs.service → /lib/systemd/system/incus-lxcfs.service.
Removed "/etc/systemd/system/sockets.target.wants/incus.socket".
Created symlink /etc/systemd/system/sockets.target.wants/incus.socket → /lib/systemd/system/incus.socket.
Removed "/etc/systemd/system/sockets.target.wants/incus-user.socket".
Created symlink /etc/systemd/system/sockets.target.wants/incus-user.socket → /lib/systemd/system/incus-user.socket.
Removed "/etc/systemd/system/multi-user.target.wants/incus-startup.service".
Created symlink /etc/systemd/system/multi-user.target.wants/incus-startup.service → /lib/systemd/system/incus-startup.service.
Failed to restart incus.service: Unit incus.service not found.
dpkg: error processing package incus-base (--configure):
 installed incus-base package post-installation script subprocess returned error exit status 5
dpkg: dependency problems prevent configuration of incus:
 incus depends on incus-base (= 0.7-202403261638-debian12); however:
  Package incus-base is not configured yet.

dpkg: error processing package incus (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.36-9+deb12u4) ...
Errors were encountered while processing:
 incus-base
 incus

E: Sub-process /usr/bin/dpkg returned an error code (1)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up incus-base (0.7-202403261638-debian12) ...
Failed to restart incus.service: Unit incus.service not found.
dpkg: error processing package incus-base (--configure):
 installed incus-base package post-installation script subprocess returned error exit status 5
dpkg: dependency problems prevent configuration of incus:
 incus depends on incus-base (= 0.7-202403261638-debian12); however:
  Package incus-base is not configured yet.

dpkg: error processing package incus (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.36-9+deb12u4) ...
Errors were encountered while processing:
 incus-base
 incus
E: Sub-process /usr/bin/dpkg returned an error code (1)

Now when I run systemctl status incus I get this output.

● incus.service
     Loaded: not-found (Reason: Unit incus.service not found.)
     Active: active (running) since Tue 2024-03-19 16:07:51 CET; 1 week 0 days ago
TriggeredBy: ● incus.socket
   Main PID: 2775117 (incusd)
        CPU: 2h 10min 15.021s
     CGroup: /system.slice/incus.service
             └─2775117 incusd --group incus-admin --logfile /var/log/incus/incusd.log

Mar 27 11:08:32 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:08:50 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:08:55 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:08:55 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:08:55 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:08:56 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:11:48 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:11:48 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:11:48 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
Mar 27 11:11:49 tank systemd[1]: incus.service: Failed to open /etc/systemd/system/incus.service: No such file or directory
stgraber commented 4 months ago

Can you show ls -lh /etc/systemd/system/incus* ?

broizter commented 4 months ago
❯ ls -lh /etc/systemd/system/incus*
lrwxrwxrwx 1 root root 43 Dec  3 10:11 /etc/systemd/system/incus.service -> /opt/incus/lib/systemd/system/incus.service
stgraber commented 4 months ago

Okay, thanks. Can you delete that file and then try the update again?

broizter commented 4 months ago

Just to make sure, the one in /etc or the one in /opt?

stgraber commented 4 months ago

/etc/systemd/system/incus.service

broizter commented 4 months ago

Success!

~ root@tank
❯ rm /etc/systemd/system/incus.service

~ root@tank
❯ apt install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up incus-base (0.7-202403261638-debian12) ...
Setting up incus (0.7-202403261638-debian12) ...
Processing triggers for libc-bin (2.36-9+deb12u4) ...

~ root@tank 12s
❯ echo $status
0
stgraber commented 4 months ago

Pushed the fix for it, I'll release the package to stable once it's built.

It's odd because incus.service and incus-user.service are socket-activated so they should never have had their units symlinked into /etc/systemd/system to begin with, it's also not a thing that I've noticed on any of my test systems. Anyway, the updated logic will take care of it.

broizter commented 4 months ago

Great!

If I remember correctly I have not done any overrides of the Incus systemd services and I've used this repository from the very beginning.

Anyways, I've been a long time user of LXD and now Incus so I'm happy I could be of any help, however small it was. Keep up the great work!