system-config-printer.py crashed with NameError in /usr/share/system-config-printer/jobviewer.py: name 'Secret' is not defined

Bug #1760027 reported by errors.ubuntu.com bug bridge
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Fix Released
High
Till Kamppeter
Bionic
Fix Released
High
Till Kamppeter

Bug Description

New error with 1.5.11-1ubuntu1

The Ubuntu Error Tracker has been receiving reports about a problem regarding system-config-printer. This problem was most recently seen with package version 1.5.11-1ubuntu1, the problem page at https://errors.ubuntu.com/problem/75b6b655c24028fea9fef2b4f2bde9d4a134f3a8 contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

Traceback
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 84, in <module>
    import jobviewer
  File "/usr/share/system-config-printer/jobviewer.py", line 76, in <module>
    NETWORK_PASSWORD = Secret.Schema.new("org.system.config.printer.store", Secret.SchemaFlags.NONE,
NameError: name 'Secret' is not defined

Tags: bionic
summary: - /usr/share/system-config-printer/system-config-
- printer.py:NameError:/usr/share/system-config-printer/system-config-
- printer.py@84:/usr/share/system-config-printer/jobviewer.py@76
+ system-config-printer.py (NameError) /usr/share/system-config-
+ printer/system-config-printer.py@84 → /usr/share/system-config-
+ printer/jobviewer.py@76
description: updated
description: updated
summary: - system-config-printer.py (NameError) /usr/share/system-config-
- printer/system-config-printer.py@84 → /usr/share/system-config-
- printer/jobviewer.py@76
+ system-config-printer.py crashed with NameError in /usr/share/system-
+ config-printer/jobviewer.py: name 'Secret' is not defined
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in system-config-printer (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I think it happens because gir1.2-secret-1 is not installed on the system.

There is code in jobviewer.py to handle this case:
  56 try:
  57 gi.require_version('Secret', '1')
  58 from gi.repository import Secret
  59 USE_SECRET=True
  60 except ValueError:
  61 USE_SECRET=False

But there are several locations in the code where the value of USE_SECRET is not checked before using Secret. For example:
  76 NETWORK_PASSWORD = Secret.Schema.new("org.system.config.printer.store", Secret.SchemaFlags.NONE,

But also
  90 class ServiceGet:
  91 service = Secret.Service()
  92
  93 def on_get_service(self, source, result, unused):
  94 service = Secret.Service.get_finish(result)
  95
  96 def __init__(self):
  97 Secret.Service.get(0,

 109 def on_search_item(self, source, result, unused):
 110 items = Secret.Service.search_finish(None, result)
 111
 112 def __init__(self, service, attrs):
 113 Secret.Service.search(service,

...

Changed in system-config-printer (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
tags: added: rls-bb-incoming
Will Cooke (willcooke)
Changed in system-config-printer (Ubuntu):
assignee: nobody → Till Kamppeter (till-kamppeter)
tags: removed: rls-bb-incoming
Changed in system-config-printer (Ubuntu Bionic):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package system-config-printer - 1.5.11-1ubuntu2

---------------
system-config-printer (1.5.11-1ubuntu2) bionic; urgency=low

  * Let the binary package system-config-printer-common depend
    on gir1.2-secret-1 (LP: #1760027).

 -- Till Kamppeter <email address hidden> Tue, 3 Apr 2018 16:50:12 +0200

Changed in system-config-printer (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.