mass-sync.py unable to auth

Bug #664178 reported by Dustin Kirkland 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-archive-tools
Won't Fix
Undecided
Unassigned

Bug Description

kirkland@x200:/local/source/ubuntu-archive-tools$ ./mass-sync.py < /tmp/backports.txt
The authorization page:
   (https://edge.launchpad.net/+authorize-token?oauth_token=xxxxxx)
should be opening in your browser. After you have authorized
this program to access Launchpad on your behalf you should come
back here and press <Enter> to finish the authentication process.
Created new window in existing browser session.
Traceback (most recent call last):
  File "./mass-sync.py", line 299, in <module>
    main()
  File "./mass-sync.py", line 233, in main
    launchpad = lputils.lpfactory(options.launchpad_instance, CONSUMER_KEY)
  File "/local/source/ubuntu-archive-tools/lputils.py", line 30, in lpfactory
    consumer_key, service_root=service_root)
  File "/usr/lib/pymodules/python2.6/launchpadlib/launchpad.py", line 294, in login_with
    max_failed_attempts=max_failed_attempts, version=version)
  File "/usr/lib/pymodules/python2.6/launchpadlib/launchpad.py", line 214, in get_token_and_login
    credentials.exchange_request_token_for_access_token(web_root)
  File "/usr/lib/pymodules/python2.6/launchpadlib/credentials.py", line 142, in exchange_request_token_for_access_token
    raise HTTPError(response, content)
lazr.restfulclient.errors.HTTPError: HTTP Error 401: Unauthorized
Response headers:
---
content-length: 57
content-type: text/plain;charset=utf-8
date: Wed, 20 Oct 2010 21:31:34 GMT
server: zope.server.http (HTTP)
status: 401
vary: Cookie,Authorization,Accept-Encoding
via: 1.1 edge.launchpad.net
www-authenticate: OAuth realm="https://api.launchpad.net"
x-content-type-warning: guessed from content
x-powered-by: Zope (www.zope.org), Python (www.python.org)
---
Response body:
---
Request token has not yet been reviewed. Try again later.
---

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Still having this issue ... any suggestions?

Changed in ubuntu-archive-tools:
status: New → Confirmed
Revision history for this message
Steve Kowalik (stevenk) wrote :

I just came across this myself. It looks like it doesn't wait long enough for a response.

I was able to work-around it by running the following in a python shell:

>>> import lputils
>>> lputils.lpfactory('production', 'mass-sync.py')

Revision history for this message
Colin Watson (cjwatson) wrote :

You generally need to run it first with no redirection, if you haven't authenticated it before. Relying on stdin redirection here was probably a mistake.

But, since mass-sync is basically deprecated today and is just to clean up the odd case where somebody doesn't realise they can use syncpackage directly, I don't think it's worth rearranging its interface to fix this. I expect this script will be removed at some point in the next six months or so.

Changed in ubuntu-archive-tools:
status: Confirmed → Won't Fix
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.