KDE: Discover can't fetch updates

I discovered a special scenario where this error can happen. When you have initially installed Ubuntu without a desktop environment, Ubuntu's netplan configuration tool will use networkd instead of NetworkManager by default. If you then later manually install a desktop environment, some graphical tools such as KDE's Discover will fail because they expect a working NetworkManager. Check the netplan configuration file to see what your system is using:

sudo nano /etc/netplan/01-netcfg.yaml

If it says renderer: networkd, this is likely the cause. Change it to renderer: NetworkManager and apply the new setting with sudo netplan apply.