[Bug 1687122] Re: /usr/bin/add-apt-repository:OSError:/usr/bin/add-apt-repository at 168:add_source_from_shortcut:/usr/bin/add-apt-repository at 172

Brian Murray brian at ubuntu.com
Fri Apr 28 22:32:58 UTC 2017


This is a crash that recently started appearing in the Error Tracker the
Traceback contains the following:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 168, in <module>
    if not sp.add_source_from_shortcut(shortcut, options.enable_source):
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 777, in add_source_from_shortcut
    raise shortcuts.ShortcutException(msg)
softwareproperties.shortcuts.ShortcutException: Failed to add key.

Looking at the code added in the SRU to xenial
(https://launchpadlibrarian.net/309920080/software-
properties_0.96.24.7_0.96.24.7.1.diff.gz) we can see the following:

@@ -753,6 +769,13 @@
     if worker:
         # wait for GPG key to be downloaded
         worker.join(30)
+        if worker.isAlive():
+            # thread timed out.
+            raise shortcuts.ShortcutException("Error: retrieving gpg key timed out.")
+        result, msg = self.myqueue.get()
+        if not result:
+            raise shortcuts.ShortcutException(msg)
+
     if self.options and self.options.update:
         import apt
         cache = apt.Cache()

It looks to me like this ShortcutException is raised when for whatever
reason the client application fails to retrieve the key. I don't think
there is anything we can do about this and as such don't think it should
be reported to the Error Tracker at all.

The apport package hook for software-properties could filter out
Tracebacks with this error.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/1687122

Title:
  /usr/bin/add-apt-repository:OSError:/usr/bin/add-apt-
  repository at 168:add_source_from_shortcut:/usr/bin/add-apt-
  repository at 172

Status in software-properties package in Ubuntu:
  New

Bug description:
  The Ubuntu Error Tracker has been receiving reports about a problem regarding software-properties.  This problem was most recently seen with package version 0.96.24.13, the problem page at https://errors.ubuntu.com/problem/01a945aed47dfff0cdfea51c5923f51cadeafb00 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 you can request it at http://forms.canonical.com/reports/.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1687122/+subscriptions



More information about the foundations-bugs mailing list