add-apt-repository fails to add repository with no explanation; --massive-debug doesn't show debugging

Bug #1364176 reported by Paul Gear
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Example run:

paulgear@peleg:~/.juju$ sudo apt-add-repository --massive-debug ppa:juju/stable
Cannot add PPA: 'ppa:juju/stable'.
Please check that the PPA name or format is correct.

This is on a network with egress filtering, and this appears to be the cause of the issue. Running wireshark shows that apt-add-repository is attempting a direct connection to launchpad.net on port 443.

Bugs as I see them:
1. apt-add-repository requires direct access to Internet
2. It is undocumented that apt-add-repository requires direct access to Internet
3. apt-add-repository offers no indication that it has attempted access to the Internet, nor why it failed
4. Adding --massive-debug offers no diagnostics at all
5. apt-add-repository doesn't honour the proxy settings in /etc/apt/apt.conf

Several users have reported this previously, but I couldn't find any matching bug. References:
- http://ubuntuforums.org/showthread.php?t=1599832
- http://askubuntu.com/questions/53146/how-do-i-get-add-apt-repository-to-work-through-a-proxy

Workaround that worked for me:
- add -E to sudo command to pass environment variables through, which then allows https_proxy to be honoured.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: software-properties-common 0.92.37.1
ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
Uname: Linux 3.13.0-35-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Sep 2 09:14:43 2014
PackageArchitecture: all
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Paul Gear (paulgear) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

This is recreatable by just disabling your network connection.

Changed in software-properties (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Rares Vernica (rares) wrote :

I ran into this today. So annoying. I kept getting "Please check that the PPA name or format is correct." This error message is so misleading... The Internet is littered with people working around the "add-apt-repository" script since no one can really figure out the real reason for this error message.

In my case, I was running this script in a container and had the Docker DNS in Fedora 32 issue.

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

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

Changed in software-properties (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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