software-properties-gtk does not run at all!

Bug #1830914 reported by dexter
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Low
Unassigned

Bug Description

software-properties-gtk does not even start!

$ software-properties-gtk --debug

ENABLED COMPS: {'universe', 'main'}
INTERNET COMPS: {'universe', 'main'}
MAIN SOURCES
 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['main']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu
 BaseURI: http://archive.ubuntu.com/ubuntu

 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['universe']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu
 BaseURI: http://archive.ubuntu.com/ubuntu

CHILD SOURCES
 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['main']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu
 BaseURI: None

 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['universe']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu
 BaseURI: None

 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['main']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu|security.ubuntu.com
 BaseURI: http://security.ubuntu.com/ubuntu/

 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['universe']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu|security.ubuntu.com
 BaseURI: http://security.ubuntu.com/ubuntu/

 URI: http://archive.ubuntu.com/ubuntu
 Comps: ['universe', 'main']
 Enabled: True
 Valid: True
 MatchURI: archive.ubuntu.com/ubuntu
 BaseURI: None

CDROM SOURCES
SOURCE CODE SOURCES
DISABLED SOURCES
ISV
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 100, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 200, in __init__
    self.init_livepatch()
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 1482, in init_livepatch
    self.livepatch_page = LivepatchPage(self)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/LivepatchPage.py", line 51, in __init__
    self._lps = LivepatchService()
  File "/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__
    self._session = requests_unixsocket.Session()
NameError: name 'requests_unixsocket' is not defined

{Exited with code 1.}

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco

$ dpkg-query -l software-properties-gtk python3-requests-unixsocket

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-============-============-===============================================================
ii python3-requests-unixsocket 0.1.5-3 all Use requests to talk HTTP via a UNIX domain socket - Python 3.x
ii software-properties-gtk 0.97.11 all manage the repositories that you install software from (gtk)

$ sudo apt-get update
{Works.}

$ sudo apt-get dist-upgrade
{Works.}

Revision history for this message
dexter (rekoghllgsuz) wrote :

I found that if I move a bit the "import requests_unixsocket" line (in file LivepatchService.py), then the software-properties-gtk call *works*.
Please somebody either propagate this solution (if it is a true solution), or tell me how to propagate.
(I do not know shat is exactly happening. Whether the try-clause partly succeeds, then rolls back?..)

$ sudo -s

# cd /usr/lib/python3/dist-packages/softwareproperties

# diff -u4 LivepatchService.py.ORI LivepatchService.py.MY
--- LivepatchService.py.ORI 2019-06-24 14:46:07.000000000 +0200
+++ LivepatchService.py.MY 2019-06-24 14:54:31.000000000 +0200
@@ -23,13 +23,12 @@
 import logging

 import gi
 from gi.repository import Gio, GLib, GObject
+import requests_unixsocket

 try:
     import dateutil.parser
- import requests_unixsocket
-
     gi.require_version('Snapd', '1')
     from gi.repository import Snapd
 except(ImportError, ValueError):
     pass

# cp LivepatchService.py.MY LivepatchService.py

$ software-properties-gtk

{OK, works! The dialog is popping up.}

Revision history for this message
dexter (rekoghllgsuz) wrote :

The software-properties-gtk starts, but the last tab (which is a new tab), captioned "Livepatch", does not work.

The text says "Checking availability...", then, after a while an "internal error detected" dialog comes up.

So "livepatch" does not work (at least does not seem to).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, what's the output of

$ python3 -c 'import dateutil.parser'
and
$ python3 -c 'import requests_unixsocket'

?

Changed in software-properties (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Sved (sveddevs) wrote :

@seb128
I am seeing the same issue after I upgraded to 19.04.

The output of both the commands you requested is a new line (shown below)
sved@sveddt:~$ python3 -c 'import dateutil.parser'
sved@sveddt:~$ python3 -c 'import requests_unixsocket'
sved@sveddt:~$

Revision history for this message
Sebastien Bacher (seb128) wrote :

weird, why would that change makes a difference if the imports are not failing? are you sure it's the same issue?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for software-properties (Ubuntu) because there has been no activity for 60 days.]

Changed in software-properties (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Tim Richardson (tim-richardson) wrote :

I have this problem in one Ubuntu 18.04

journalctl -e

Sep 06 17:54:28 ubuntu dbus-daemon[723]: [system] Activating service name='com.ubuntu.SoftwareProperties' requested by ':1.106' (uid=1000 pid=6185 comm="/usr/bin/python3 /usr/bin/software-properties-gtk " label="unconfined") (using servicehelper)
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: Unable to init server: Could not connect: Connection refused
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: Unable to init server: Could not connect: Connection refused
Sep 06 17:54:28 ubuntu dbus-daemon[723]: [system] Successfully activated service 'com.ubuntu.SoftwareProperties'
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: Traceback (most recent call last):
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: File "/usr/lib/software-properties/software-properties-dbus", line 68, in <module>
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: server = SoftwarePropertiesDBus(bus, datadir=datadir)
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: File "/usr/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 66, in __init__
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: self._livepatch_service = LivepatchService()
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: File "/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: self._session = requests_unixsocket.Session()
Sep 06 17:54:28 ubuntu com.ubuntu.SoftwareProperties[723]: NameError: name 'requests_unixsocket' is not defined

Revision history for this message
Tim Richardson (tim-richardson) wrote :

>>> import dateutil.parser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/dateutil/parser.py", line 40, in <module>
    from six import text_type, binary_type, integer_types
ModuleNotFoundError: No module named 'six'

Revision history for this message
Tim Richardson (tim-richardson) wrote :

I had the module python3-six installed but after I reinstalled it, software-properties-gtk started working again.

Revision history for this message
Gunawan Wibisono (gunse) wrote :

it also happened with me on focal and it was fixed by reinstall python3-six and python3-certifi

Revision history for this message
SunBear (sunbear-c22) wrote :

I enquired about this issue in Aug 2020 (see https://askubuntu.com/q/1271611/541417). @SteveLanders solution worked for me. https://askubuntu.com/a/1312345/541417.

The following reinstallation procedure that he had shared worked for me:
sudo apt install --reinstall python3-six python3-certifi python3-requests python3-idna
sudo apt install --reinstall software-properties-gtk
software-properties-gtk

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers