apt-add-repository fails while adding ppa if signing_key_fingerprint does not exist

Bug #968756 reported by Pavol Klačanský
92
This bug affects 18 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

sudo apt-add-repository ppa:floaty-devs/ppa
You are about to add the following PPA to your system:

 More info: https://launchpad.net/~floaty-devs/+archive/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 95, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 117, in add_ppa_signing_key
    "--recv", signing_key_fingerprint])
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
TypeError: execv() arg 2 must contain only strings

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: apt 0.8.16~exp12ubuntu6
ProcVersionSignature: Ubuntu 3.2.0-20.33-generic 3.2.12
Uname: Linux 3.2.0-20-generic x86_64
ApportVersion: 1.95-0ubuntu1
Architecture: amd64
Date: Fri Mar 30 01:38:13 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120328)
ProcEnviron:
 TERM=xterm
 LANG=sk_SK.UTF-8
 SHELL=/bin/bash
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Pavol Klačanský (pavolzetor-deactivatedaccount) wrote :
Micah Gersten (micahg)
affects: apt (Ubuntu) → software-properties (Ubuntu)
Revision history for this message
Robert Roth (evfool) wrote :

Can you still reproduce this? I have tried it, and it worked for me without problems.

Changed in software-properties (Ubuntu):
status: New → Incomplete
Changed in software-properties (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
bruno.braga (bruno-braga) wrote :

I just had the same problem.

I realized that this same output error happens because even though I have just uploaded my package (sources), it is still in queue for building, and while this is unfinished, if I try to add the repository with the command add-apt-repository, as it also tries to handle the signatures, it ultimately fails.

So, this is not actually a problem.

My output:

$ sudo add-apt-repository ppa:bruno-braga/termsaver
[sudo] password for bruno:
You are about to add the following PPA to your system:
 A simple text-based terminal screensaver.
 More info: https://launchpad.net/~bruno-braga/+archive/termsaver
Press [ENTER] to continue or ctrl-c to cancel adding it

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 95, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 117, in add_ppa_signing_key
    "--recv", signing_key_fingerprint])
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
TypeError: execv() arg 2 must contain only strings

If I try to get any other PPA's that are valid, it works just fine:

$ sudo add-apt-repository ppa:dcaro/packages
You are about to add the following PPA to your system:

 More info: https://launchpad.net/~dcaro/+archive/packages
Press [ENTER] to continue or ctrl-c to cancel adding it

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.ve6b9w6CVX --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 0DCE2702C56392C6B0B97BFC47C98F3E02B8917F
gpg: requesting key 02B8917F from hkp server keyserver.ubuntu.com
gpg: key 02B8917F: public key "Launchpad PPA for David Caro" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

Revision history for this message
bruno.braga (bruno-braga) wrote :

As an improvement, the script could do a check and output something nicer than a stack-trace :-)

Revision history for this message
bruno.braga (bruno-braga) wrote :

As I suspected, once the build process was finished, the command worked fine:

 $ sudo add-apt-repository ppa:bruno-braga/termsaver
You are about to add the following PPA to your system:
 A simple text-based terminal screensaver.
 More info: https://launchpad.net/~bruno-braga/+archive/termsaver
Press [ENTER] to continue or ctrl-c to cancel adding it

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.SCEjavKMtV --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 47F2FDE734B30D075647EC43150358F9EE1A54BE
gpg: requesting key EE1A54BE from hkp server keyserver.ubuntu.com
gpg: key EE1A54BE: public key "Launchpad PPA for bruno.braga" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

Revision history for this message
pranith (bobby-prani) wrote :

This is a valid bug and needs to be fixed. A nice error message should be sufficient rather than printing a stack trace.

My error log:

pranith@labdesk:~/virtualbox/tmp/virtualbox-4.1.12-dfsg$ sudo add-apt-repository ppa:bobby-prani/virtualbox-precise
You are about to add the following PPA to your system:

 More info: https://launchpad.net/~bobby-prani/+archive/virtualbox-precise
Press [ENTER] to continue or ctrl-c to cancel adding it

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 99, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 127, in add_ppa_signing_key
    if len(signing_key_fingerprint) < 160/8:
TypeError: object of type 'NoneType' has no len()

Changed in software-properties (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Winfield Trail (sudowned) wrote :

Fixed the issue by catching the exception and adding reasonable error text - I've attached my patch. This bug gave me a real scare when I was testing a new PPA. ;)

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Catches the exception, provides sensible error text to stdout." of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for the patch I modified the error message slightly to more accurately reflect the situation.

+ print("Error: signing key fingerprint does not exist")

I've committed this to the upstream version of software-properties.

Changed in software-properties (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
summary: - apt-add-repository fails while adding ppa
+ apt-add-repository fails while adding ppa if signing_key_fingerprint
+ does not exist
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.92.15

---------------
software-properties (0.92.15) raring; urgency=low

  [ Manish Sinha (मनीष सिन्हा) ]
  * lp:~manishsinha/software-properties/fix-874766-updates-tab-failed-auth:
    - Fixes LP: #874766 where after a failed authentication on Updates tab
      didn't revert the older values in ComboBox

  [ Brian Murray ]
  * To add-apt-repository add a patch from Winfield Trail for when the case a
    PPA does not have a signing key yet (LP: #968756)

  [ Shih-Yuan Lee (FourDollars) ]
  * Fix a typo in CountryInformation.py. (LP: #1138121)
 -- Michael Vogt <email address hidden> Tue, 12 Mar 2013 09:35:08 +0100

Changed in software-properties (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Dan Lipsitt (danlipsitt) wrote :

What would it take to get this patch into Precise?

Revision history for this message
Chapin Bryce (cbryce) wrote :

Just encountered the same issue within Precise. Please fix!!

Revision history for this message
Mark Woon (markwoon) wrote :

A bit late to the party, but if the root cause is that the package hasn't finished building yet, it would be nice to see that noted in the error message.

I still had to google "signing key fingerprint does not exist" to figure out what was going on.

Revision history for this message
Norbert (nrbrtx) wrote :

I see the same issue with my PPA.

Revision history for this message
Winfield Trail (sudowned) wrote : Re: [Bug 968756] Re: apt-add-repository fails while adding ppa if signing_key_fingerprint does not exist

Really? I wrote a patch for this two years ago. What distro are you using?

On Tuesday, March 12, 2013, Launchpad Bug Tracker <email address hidden>
wrote:

> ** Branch linked: lp:ubuntu/raring-proposed/software-properties
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/968756
>
> Title:
> apt-add-repository fails while adding ppa if signing_key_fingerprint
> does not exist
>
> Status in “software-properties” package in Ubuntu:
> In Progress
>
> Bug description:
> sudo apt-add-repository ppa:floaty-devs/ppa
> You are about to add the following PPA to your system:
>
> More info: https://launchpad.net/~floaty-devs/+archive/ppa
> Press [ENTER] to continue or ctrl-c to cancel adding it
>
> Exception in thread Thread-1:
> Traceback (most recent call last):
> File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
> self.run()
> File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py",
> line 95, in run
> self.add_ppa_signing_key(self.ppa_path)
> File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py",
> line 117, in add_ppa_signing_key
> "--recv", signing_key_fingerprint])
> File "/usr/lib/python2.7/subprocess.py", line 493, in call
> return Popen(*popenargs, **kwargs).wait()
> File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
> errread, errwrite)
> File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
> raise child_exception
> TypeError: execv() arg 2 must contain only strings
>
> ProblemType: Bug
> DistroRelease: Ubuntu 12.04
> Package: apt 0.8.16~exp12ubuntu6
> ProcVersionSignature: Ubuntu 3.2.0-20.33-generic 3.2.12
> Uname: Linux 3.2.0-20-generic x86_64
> ApportVersion: 1.95-0ubuntu1
> Architecture: amd64
> Date: Fri Mar 30 01:38:13 2012
> EcryptfsInUse: Yes
> InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64
> (20120328)
> ProcEnviron:
> TERM=xterm
> LANG=sk_SK.UTF-8
> SHELL=/bin/bash
> SourcePackage: apt
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/968756/+subscriptions
>

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.