Cockpit: packagekit: Debian 10 Buster without NetworkManager: Cannot refresh cache whilst offline

Created on 17 Oct 2019  路  10Comments  路  Source: cockpit-project/cockpit

Cockpit version: 188
OS: Debian GNU/Linux 10 (buster)
Page: Software Updates

I've installed Cockpit on two Debian 10 systems. While everything works fine, I cannot seem to get the software updates page running. It reports that the system is offline (even though it's obviously not).

8477 referred to this earlier, however on an Ubuntu 16.04 installation. @martinpitt said this issue got fixed in later Ubuntu / NetworkManager versions.

Any idea regarding Debian 10? I've already tried completely disabling NetworkManager (since I don't use it anyways), still no luck.

Most helpful comment

This is still an issue on Ubuntu 19. Disabling NetworkManager doesn't help.

All 10 comments

This is still an issue on Ubuntu 19. Disabling NetworkManager doesn't help.

I am running Debian 10 and had this issue. I resolved it by disabling the NetworkManager.service and re-booting. After this action, I was able to update my installation.

Our tests have some hacks to work on ubuntu 18.04 and 19.10, which disables NetworkManager. But this is mostly becuase our test VMs are offline. We don't have nor need such a hack on Debian, so I'm afraid I don't know a good workaround either. This is a packagekit bug (you will see the same issue with pkcon get-updates), I'm afraid we can't really "fix" this in cockpit.

I have tested this on Ubuntu 19.10 and I still get the "Cannot refresh cache whilst offline" when NetworkManager is disabled.

pkcon get-updates works without issues:

stuts@test:~$ sudo pkcon get-updates
Getting updates               [=========================]
Loading cache                 [=========================]
Finished                      [=========================]
Bug fix         linux-generic-5.3.0.24.28.amd64 (ubuntu-eoan-updates-main)      Complete Generic Linux kernel and headers
Bug fix         linux-headers-generic-5.3.0.24.28.amd64 (ubuntu-eoan-updates-main)      Generic Linux kernel headers
Bug fix         linux-image-generic-5.3.0.24.28.amd64 (ubuntu-eoan-updates-main)        Generic Linux kernel image

I tell a lie, it fails here:

root@test:/home/stuts# pkcon update
Getting updates               [=========================]
Finished                      [=========================]
Loading cache                 [=========================]
Testing changes               [=========================]
Finished                      [                         ] (0%)
The following packages have to be installed:
 linux-headers-5.3.0-24-5.3.0-24.26.all Header files related to Linux kernel version 5.3.0
 linux-headers-5.3.0-24-generic-5.3.0-24.26.amd64       Linux kernel headers for version 5.3.0 on 64 bit x86 SMP
 linux-image-5.3.0-24-generic-5.3.0-24.26.amd64 Signed kernel image generic
 linux-modules-5.3.0-24-generic-5.3.0-24.26.amd64       Linux kernel extra modules for version 5.3.0 on 64 bit x86 SMP
 linux-modules-extra-5.3.0-24-generic-5.3.0-24.26.amd64 Linux kernel extra modules for version 5.3.0 on 64 bit x86 SMP
The following packages have to be updated:
 linux-generic-5.3.0.24.28.amd64        Complete Generic Linux kernel and headers
 linux-headers-generic-5.3.0.24.28.amd64        Generic Linux kernel headers
 linux-image-generic-5.3.0.24.28.amd64  Generic Linux kernel image
Proceed with changes? [N/y] y

                              [=========================]
Updating packages             [=========================]
Loading cache                 [=========================]
Finished                      [=========================]
Fatal error: Cannot download packages whilst offline

@martinpitt I have found a workaround for Ubuntu 19.10 and others:

Edit /etc/PackageKit/PackageKit.conf and add this to the [Daemon] section:

UseNetworkManager = false

I needed to reboot but now everything works perfectly with no extra network interfaces needed.

@lukestuts: Note that get-updates only uses the cache. What will fail is pkcon refresh force.

Really nice trick with PackageKit.conf! I'll adjust our tests to use that, this is cleaner indeed.

@lukestuts : Do you use some kind of modified packagekit? The official git repo does not know about the UseNetworkManager option, and neither does the Ubuntu 19.10 package:

dpkg -L packagekit | xargs strings | grep -i UseNetwo

The error is generated in the aptcc backend, using pk_backend_is_online(), which in turn calls g_network_monitor_get_network_available (). This really tests for a default route.

@martinpitt Yes, my mistake, I got confused. Disabling the network-manager service completely is what actually made it work on my server. I just created another server and the PackageKit.conf line did nothing. Sorry! This is where I got it from: https://fedoraproject.org/wiki/PackageKit_Frequently_Asked_Questions#PackageKit_won.27t_work_without_NetworkManager

I had this exact issue on both of my Ubuntu 19.10 servers and although disabling NetworkManager and rebooting resolved the error, the Networking page on Cockpit is just a blank page, is there any way to get that back?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vazquezrodjoel picture vazquezrodjoel  路  8Comments

bachradsusi picture bachradsusi  路  4Comments

gorgitko picture gorgitko  路  6Comments

digitalformula picture digitalformula  路  3Comments

jacksnodgrass picture jacksnodgrass  路  6Comments