requestsync crashed with LPUrlError in _safe_urlopen()

Bug #208808 reported by Julian Andres Klode
8
Affects Status Importance Assigned to Milestone
ubuntu-dev-tools (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: ubuntu-dev-tools

I was trying to request a sync using requestsync with python-launchpad-bugs (--lp).

I edited the report, it asked if I want to send it, I answered yes, and it crashed.

ProblemType: Crash
Architecture: amd64
Date: Sat Mar 29 15:52:10 2008
DistroRelease: Ubuntu 8.04
ExecutablePath: /usr/bin/requestsync
InterpreterPath: /usr/bin/python2.5
Package: ubuntu-dev-tools 0.29 [modified: usr/bin/pbuilder-dist]
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/requestsync -s --lp ndisgtk hardy
ProcEnviron:
 SHELL=/bin/bash
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=de_DE.UTF-8
PythonArgs: ['/usr/bin/requestsync', '-s', '--lp', 'ndisgtk', 'hardy']
SourcePackage: ubuntu-dev-tools
Title: requestsync crashed with LPUrlError in _safe_urlopen()
Uname: Linux 2.6.24-12-generic x86_64
UserGroups: adm admin audio cdrom dialout dip floppy fuse lpadmin mythtv netdev plugdev powerdev scanner vboxusers video

ERROR:
Traceback (most recent call last):
  File "/usr/bin/requestsync", line 350, in <module>
    if post_bug(srcpkg, subscribe, mapping[status], title, report):
  File "/usr/bin/requestsync", line 225, in post_bug
    bug = Bug.New(product = product, summary = bugtitle, description = bugtext)
  File "/usr/lib/python2.5/site-packages/launchostnameadbugs/connector.py", line 101, in New
    return getattr(self.module, "create_new_bugreport")(connection=self.connection, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/launchostnameadbugs/html_bug.py", line 1385, in create_new_bugreport
    result = connection.post(url, args)
  File "/usr/lib/python2.5/site-packages/launchostnameadbugs/http_connection.py", line 129, in post
    return self._safe_urlopen(url, data, True)
  File "/usr/lib/python2.5/site-packages/launchostnameadbugs/http_connection.py", line 171, in _safe_urlopen
    raise Error.LPUrlError(error, url)
LPUrlError: 'An internal server error occurred. Please try again later. (url: https://bugs.launchostnamead.net/ubuntu/+source/ndisgtk/+filebug-advanced)'

Tags: apport-crash
Revision history for this message
Julian Andres Klode (juliank) wrote :
Revision history for this message
Daniel Hahler (blueyed) wrote :

It's likely that the required Launchpad cookie is missing.
I, for myself, had to create a cookie text file, containing the "lp" and "edge" cookie, using the curl method described at https://wiki.ubuntu.com/SponsorshipProcess/ppaput.
That won't help you with the current requestsync, because it only uses the old-style Firefox cookies (~/.mozilla/*/*/cookies.txt).

Try changing the following line in /usr/bin/requestsync from:
        cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0]
to:
        cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.sqlite'))[0]

and make sure, that you're logged into launchpad.net and edge.launchpad.net (if you're member of the launchpad-beta team).

But, as I've just seen on my system, that might also not work correctly:
$ ls -1 ~/.mozilla/*/*/cookies.sqlite
/home/daniel/.mozilla/firefox-3.0..abandoned/4cz7eaqf.default/cookies.sqlite
/home/daniel/.mozilla/firefox/4cz7eaqf.default/cookies.sqlite

The first match looks like some obsolete profile, which you might not have access to easily.

I have a local branch, where requestsync tries the following globs for setting the required cookie file:
1. ~/.lpcookie
2. ~/.mozilla/*/*/cookies.sqlite
3. ~/.mozilla/*/*/cookies.txt

Changed in ubuntu-dev-tools:
assignee: nobody → blueyed
status: New → Incomplete
description: updated
Revision history for this message
Michael Bienia (geser) wrote :

Oh, does python-launchpad-bugs already support the Firefox 3.0 cookie files?
When this problem arised for me, I took a script from Kees Cook (http://people.ubuntu.com/~kees/scripts/cookies-sql2txt) to extract the LP cookie from the sqlite cookie file from Firefox 3.0 and stored it in a file and modified requestsync to use that file instead.

Revision history for this message
Daniel Hahler (blueyed) wrote :

requestsync (which uses python-launchpad-bugs), did only support the Firefox 2 cookie. I've added support for ~/.lpcookie.txt and Firefox 3 in my bzr branch for ubuntu-dev-tools, which hopefully gets merged soon into trunk and then released.
I'll link the branch here, so you can take a look, if you're interested in the fix.

Changed in ubuntu-dev-tools:
assignee: blueyed → nobody
status: Incomplete → Triaged
importance: Undecided → Medium
Changed in ubuntu-dev-tools:
status: Triaged → Fix Committed
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

Using trunk @ commit 96, which contains Daniel's requestsync fixes, I get this:

Do you want to edit the report before sending [y/N]? Press Control-C to abort.

Traceback (most recent call last):
  File "/u/mok/devel/ubuntu-dev-tools/requestsync", line 428, in <module>
    if post_bug(srcpkg, subscribe, mapping[status], title, report):
  File "/u/mok/devel/ubuntu-dev-tools/requestsync", line 289, in post_bug
    bug.commit()
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_bug.py", line 1268, in commit
    result = i.component.commit(force_changes, ignore_lp_errors)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_bug.py", line 945, in commit
    self._add(i)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_bug.py", line 959, in _add
    raise ValueError, "Unknown error while subscribe %s to %s" %(lplogin, url)
ValueError: Unknown error while subscribe ubuntu-archive to https://bugs.edge.launchpad.net/ubuntu/+bug/236260/+addsubscriber

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

The above action did indeed file the bug (#236260) but ubuntu-archive was not subscribed (I suppose this is what requestsync is attempting when it fails). I subsequently did that manually.

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

This bug was fixed in the package ubuntu-dev-tools - 0.31

---------------
ubuntu-dev-tools (0.31) intrepid; urgency=low

  [ Siegfried-Angel Gevatter Pujals (RainCT) ]
  * pbuilder-dist.new:
     - Rewrite the script in Python to make it more robust and faster.
  * what-patch:
     - If cdbs-edit-patch is used, output "cdbs (patchsys.mk)" instead of
       just "cdbs" (LP: #195795).
  * check-symbols:
     - Add a brief explanation about why sudo privilegies are required
       in order to run this script (LP: #194622).
     - End with exit code 1 if there's an error.
  * suspicious-source:
     - Whitelist C# files (LP: #225691): *.cs.
     - Whitelist manpages: *.[0-9].

  [ Daniel Hahler ]
  * requestsync:
     - Use debian_bundle.changelog.Version for version comparison in
       debian_changelog.
     - Fix --lp for Firefox 3 (LP: #208808):
       It now tries ~/.lpcookie.txt, ~/.mozilla/*/*/cookies.sqlite and
       ~/.mozilla/*/*/cookies.txt to find a Launchpad cookie file.
       Also added a hint that you can create a valid file, by logging into
       Launchpad with Firefox.
     - Added confirm loops, which displays the message to be send/posted and
       either allows to edit (or forces to, in case of Ubuntu changes).
       (LP: #194613, #194615)
       This adds a convient edit_report method, which gets used both from the
       Launchpad and mail code path.
     - Do not fallback to submitting by email, if posting to Launchpad failed.
       This hasn't been requested and therefore should not get done.
     - post_bug: Catch IOError when setting bug importance (LP: #190061)
     - mail_bug: Catch socket.error (LP: #190739)

  [ Kees Cook ]
  * mk-sbuild-lv
    - don't install recommended packages during chroot install.
    - allow customization of schroot.conf suffix and LV/snapshot sizes.
  * what-patch:
    - restore previous output behavior, added logic to verbose test instead.
    - added details for each patch system report.
  * pull-debian-debdiff:
    - parse .dsc file for required source files.
    - switch to GPLv3
  * debian/control: add Depends needed for pull-debian-debdiff.
  * debian/copyright:
    - updated pull-debian-debdiff, which is now GPLv3.
    - adjusted Copyright lines to make lintian happy.

 -- Kees Cook <email address hidden> Fri, 13 Jun 2008 11:43:24 -0700

Changed in ubuntu-dev-tools:
status: Fix Committed → Fix Released
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.