bzr file view/download broken

Bug #1886576 reported by Selene ToyKeeper
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Tom Wardill
loggerhead
Fix Released
Undecided
Tom Wardill

Bug Description

It looks like something recent broke the ability to view or download files in bzr repositories.

For example, go to any project which uses bzr, browse the code, and click on a file to view or download it.

1. Go to https://bazaar.launchpad.net/~adamreichold/qpdfview/trunk/files
2. Click "README" or "TODO" or any other file.

Actual result: OOPS-f4a815585986ab48bc2f8727b6985bf6

Expected result: Display the contents of the file.

Related branches

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Traceback:

https://paste.ubuntu.com/p/Y3yGDV78c8/

TypeError: README

    Traceback (most recent call last):
  Module oops_wsgi.middleware, line 210, in oops_middleware
    app(environ, oops_start_response))
  Module paste.deploy.config, line 291, in __call__
    return self.app(environ, start_response)
  Module launchpad_loggerhead.wsgi, line 70, in wrapped
    app, environ, start_response, request_done_err, request_done_ok)
  Module paste.wsgilib, line 185, in catch_errors
    app_iter = application(environ, start_response)
  Module launchpad_loggerhead.session, line 39, in __call__
    return self.cookie_handler(environ, start_response)
  Module paste.auth.cookie, line 322, in __call__
    return self.application(environ, response_hook)
  Module launchpad_loggerhead.session, line 66, in _process
    return self.application(environ, response_hook)
  Module paste.httpexceptions, line 640, in __call__
    return self.application(environ, start_response)
  Module launchpad_loggerhead.app, line 291, in __call__
    return view.app(environ, start_response)
  Module loggerhead.apps.branch, line 207, in app
    return c(environ, start_response)
  Module loggerhead.controllers, line 110, in __call__
    values = self.get_values(path, self.kwargs, headers)
  Module loggerhead.controllers.view_ui, line 160, in get_values
    'contents': self.file_contents(path, revid),
  Module loggerhead.controllers.view_ui, line 92, in file_contents
    file_lines = self.text_lines(path, revid)
  Module loggerhead.controllers.view_ui, line 64, in text_lines
    tree = self.tree_for(path, revid)
  Module loggerhead.controllers.view_ui, line 54, in tree_for
    raise TypeError(path)
TypeError: README

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

The OOPS reads:

  TypeError: README

    Traceback (most recent call last):
  Module oops_wsgi.middleware, line 210, in oops_middleware
    app(environ, oops_start_response))
  Module paste.deploy.config, line 291, in __call__
    return self.app(environ, start_response)
  Module launchpad_loggerhead.wsgi, line 70, in wrapped
    app, environ, start_response, request_done_err, request_done_ok)
  Module paste.wsgilib, line 185, in catch_errors
    app_iter = application(environ, start_response)
  Module launchpad_loggerhead.session, line 39, in __call__
    return self.cookie_handler(environ, start_response)
  Module paste.auth.cookie, line 322, in __call__
    return self.application(environ, response_hook)
  Module launchpad_loggerhead.session, line 66, in _process
    return self.application(environ, response_hook)
  Module paste.httpexceptions, line 640, in __call__
    return self.application(environ, start_response)
  Module launchpad_loggerhead.app, line 291, in __call__
    return view.app(environ, start_response)
  Module loggerhead.apps.branch, line 207, in app
    return c(environ, start_response)
  Module loggerhead.controllers, line 110, in __call__
    values = self.get_values(path, self.kwargs, headers)
  Module loggerhead.controllers.view_ui, line 160, in get_values
    'contents': self.file_contents(path, revid),
  Module loggerhead.controllers.view_ui, line 92, in file_contents
    file_lines = self.text_lines(path, revid)
  Module loggerhead.controllers.view_ui, line 64, in text_lines
    tree = self.tree_for(path, revid)
  Module loggerhead.controllers.view_ui, line 54, in tree_for
    raise TypeError(path)
TypeError: README

Revision history for this message
Tom Wardill (twom) wrote :

There was an update to loggerhead rolled out in the latest deployment. Looks like something has gone a bit wrong.
Looking at a fix now.

Changed in launchpad:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Tom Wardill (twom)
Revision history for this message
Tom Wardill (twom) wrote :

Latest update:
This is caused by r498.1.2 of loggerhead, which ironically, I can't link here as it can't be displayed due to this bug.

Looks like a change to using file paths rather than file ids, when the file path is somehow not a `str`.

It works in staging and development, but not in production. Investigating why production set up appears to be different enough to cause this.

Revision history for this message
Tom Wardill (twom) wrote :

Configuration was a mistaken reading of the OOPS, it's a py2/py3 compatibility error in string types.

Proposed a fix.

Tom Wardill (twom)
Changed in launchpad:
status: Confirmed → Fix Committed
Changed in loggerhead:
status: New → Fix Committed
assignee: nobody → Tom Wardill (twom)
Revision history for this message
Tom Wardill (twom) wrote :

The fix for this was just deployed.
Sorry for the delay, we had an unfortunate clash with the timing to upgrade some of our CI systems.

Changed in launchpad:
status: Fix Committed → Fix Released
Changed in loggerhead:
status: Fix Committed → Fix Released
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

> Sorry for the delay...

No, thanks for the quick fix! :)

Revision history for this message
DanglingPointer (ferncasado) wrote :

Thanks for sorting this out quickly!

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.