branch/source builder: tries to open a browser

Bug #1283078 reported by Evan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu CI Engine
Fix Released
Low
Francis Ginther
Ubuntu CI Services
Fix Released
Low
Francis Ginther

Bug Description

The branch/source builder tries to open a browser to authenticate against Launchpad. Given that this is a daemon, I don't see this working :)

/var/log/upstart/bsb_worker.log (with a handler to print the stack on SIGQUIT installed):

INFO:root:Waiting for messages. ^C to exit.
INFO:__main__:on_message: {"progress_trigger": "lander_master-128-bsbuilder", "source_packages": ["https://swift.canonistack.canonical.com/v1/AUTH_c0136db8dc454f2d8523d9326bca2d78/ticket-system.1//tmp/whoopsie_0.2.24.4~ev1_source.changes", "https://swift.canonistack.canonical.com/v1/AUTH_c0136db8dc454f2d8523d9326bca2d78/ticket-system.1//tmp/whoopsie_0.2.24.4~ev1.tar.gz", "https://swift.canonistack.canonical.com/v1/AUTH_c0136db8dc454f2d8523d9326bca2d78/ticket-system.1//tmp/whoopsie_0.2.24.4~ev1.dsc"], "ppa": "ppa:ev/ci-pool-001", "state": "WAITING"}
INFO:__main__:The PPA is: ppa:ev/ci-pool-001
INFO:root:Upload to the ppa: ppa:ev/ci-pool-001
INFO:root:Retrieving source file: whoopsie_0.2.24.4~ev1_source.changes
INFO:root:Retrieving source file: whoopsie_0.2.24.4~ev1.tar.gz
INFO:root:Retrieving source file: whoopsie_0.2.24.4~ev1.dsc
ubuntu not set, will use login information.
Checking signature on .changes
gpg: fatal: can't create directory /nonexistent/.gnupg': No such file or directory
secmem usage: 0/0 bytes in 0/0 blocks of pool 0/32768
Error in finding signature verification status.
Uploading to ppa (via ftp to ppa.launchpad.net):
  Uploading whoopsie_0.2.24.4~ev1.dsc: done.
  Uploading whoopsie_0.2.24.4~ev1.tar.gz: done.
  Uploading whoopsie_0.2.24.4~ev1_source.changes: done.
Successfully uploaded packages.
INFO:__main__:upload_list: [{'files': [u'/tmp/tmpisdw3O/whoopsie_0.2.24.4~ev1_source.changes', u'/tmp/tmpisdw3O/whoopsie_0.2.24.4~ev1.dsc', u'/tmp/tmpisdw3O/whoopsie_0.2.24.4~ev1.tar.gz'], 'version': u'0.2.24.4~ev1', 'name': u'whoopsie', 'architecture': 'any'}]
The authorization page:
 (https://launchpad.net/+authorize-token?oauth_token=gtV2wBXt9XBR57QzVhTN&allow_permission=DESKTOP_INTEGRATION)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Press any key to continue or wait (5) seconds...
Waiting to hear from Launchpad about your decision...
Can't create config directory (/.w3m)!
[Continue]
User-requested stack trace:
---------------------------

# Thread: MainThread(140648939558656)
File: "./branch-source-builder/run_worker", line 94, in <module>
  amqp_utils.process_queue(config, 'bsbuilder', on_message)
File: "./branch-source-builder/../ci-utils/ci_utils/amqp_utils.py", line 106, in process_queue
  _run_forever(channel, queue, callback)
File: "./branch-source-builder/../ci-utils/ci_utils/amqp_utils.py", line 81, in _run_forever
  channel.wait()
File: "/usr/lib/python2.7/dist-packages/amqplib/client_0_8/abstract_channel.py", line 97, in wait
  return self.dispatch_method(method_sig, args, content)
File: "/usr/lib/python2.7/dist-packages/amqplib/client_0_8/abstract_channel.py", line 117, in dispatch_method
  return amqp_method(self, args, content)
File: "/usr/lib/python2.7/dist-packages/amqplib/client_0_8/channel.py", line 2060, in _basic_deliver
  func(msg)
File: "./branch-source-builder/run_worker", line 64, in on_message
  upload_list)
File: "/srv/bsb_worker/branch-source-builder/watch_ppa.py", line 69, in watch_ppa
  lp_series = launchpadmanager.get_series(series)
File: "/srv/bsb_worker/branch-source-builder/cupstream2distro/launchpadmanager.py", line 70, in get_series
  return get_ubuntu().getSeries(name_or_version=series_name)
File: "/srv/bsb_worker/branch-source-builder/cupstream2distro/launchpadmanager.py", line 60, in get_ubuntu
  return lp.distributions['ubuntu']
File: "/usr/lib/python2.7/dist-packages/lazr/restfulclient/resource.py", line 948, in __getitem__
  shim_resource._ensure_representation()
File: "/usr/lib/python2.7/dist-packages/lazr/restfulclient/resource.py", line 357, in _ensure_representation
  representation = self._root._browser.get(self._wadl_resource)
File: "/usr/lib/python2.7/dist-packages/lazr/restfulclient/_browser.py", line 386, in get
  response, content = self._request(url, extra_headers=headers)
File: "/usr/lib/python2.7/dist-packages/lazr/restfulclient/_browser.py", line 337, in _request
  str(url), method=method, body=data, headers=headers)
File: "/usr/lib/python2.7/dist-packages/lazr/restfulclient/_browser.py", line 306, in _request_and_retry
  url, method=method, body=body, headers=headers)
File: "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1444, in request
  (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File: "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 127, in _request
  return self.retry_on_bad_token(response, content, *args)
File: "/usr/lib/python2.7/dist-packages/launchpadlib/launchpad.py", line 139, in retry_on_bad_token
  self.launchpad.credentials, self.launchpad.credential_store)
File: "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 492, in __call__
  self.make_end_user_authorize_token(credentials, request_token_string)
File: "/usr/lib/python2.7/dist-packages/launchpadlib/credentials.py", line 582, in make_end_user_authorize_token
  webbrowser.open(authorization_url)
File: "/usr/lib/python2.7/webbrowser.py", line 61, in open
  if browser.open(url, new, autoraise):
File: "/usr/lib/python2.7/webbrowser.py", line 179, in open
  return not p.wait()
File: "/usr/lib/python2.7/subprocess.py", line 1291, in wait
  pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
File: "/usr/lib/python2.7/subprocess.py", line 478, in _eintr_retry_call
  return func(*args)

Tags: airline
Evan (ev)
tags: added: airline
Revision history for this message
Paul Larson (pwlars) wrote :

This is exactly what was hitting me. I would add that I did give full access to the token I generated, and I can see that it shows up in the unit_config on the bsb worker, as well as in /tmp/launchpad.creds

Changed in ubuntu-ci-services-itself:
status: New → Confirmed
Revision history for this message
Evan (ev) wrote :

If the token is bad, we should be catching that and signaling to the webui (for it to consume some method directly from the bsb) that we are in a misconfigured state.

Revision history for this message
Francis Ginther (fginther) wrote :

To solve the misconfigured state, you just need to supply tokens that have gone through the full process. I think Vincent has a script to help with this now.

The issue of the bsb reporting that it is in a bad state is worth fixing. I believe the PPA assigned may have this same concern.

Evan (ev)
Changed in ubuntu-ci-services-itself:
assignee: nobody → Francis Ginther (fginther)
importance: High → Low
Vincent Ladeuil (vila)
Changed in ubuntu-ci-services-itself:
milestone: none → backlog
Andy Doan (doanac)
Changed in ubuntu-ci-services-itself:
status: Confirmed → Fix Released
Changed in ubuntu-ci-services-itself:
milestone: backlog → phase-0
Ursula Junque (ursinha)
Changed in uci-engine:
assignee: nobody → Francis Ginther (fginther)
importance: Undecided → Low
milestone: none → phase-0
status: New → 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.