Page MenuHomePhabricator

Viewing php extensions on libup's package overview results in an 500 Internal Server Error
Closed, ResolvedPublic

Description

At https://libraryupgrader2.wmflabs.org/library, there are several non-php packages such as php extensions or php itself listed.
Clicking on these results in a 500 Internal Server Error: for example for the curl extension: https://libraryupgrader2.wmflabs.org/library/composer/ext-curl.

You'd expect to see an overview like for https://libraryupgrader2.wmflabs.org/library/composer/wikimedia/at-ease, where all the repositories using it are listed.

This is less useful for php itself, but for php extensions, it's quite useful.

Bonus: the overview mentioned above seems to have a broken title. All it lists is - libup. I'd imagine it should say something like composer: wikimedia/at-ease - libup, like the H1 element.

Event Timeline

Legoktm triaged this task as High priority.Jul 17 2019, 4:52 PM
Legoktm added a subscriber: Legoktm.

Here's the traceback. Looks like the code is trying to look it up in packagist, where it obviously doesn't exist. We'll need some special casing for it.

1Jul 17 16:51:10 upgrader-05 gunicorn[20402]: Traceback (most recent call last):
2Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/app.py", line 2446, in wsgi_app
3Jul 17 16:51:10 upgrader-05 gunicorn[20402]: response = self.full_dispatch_request()
4Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/app.py", line 1951, in full_dispatch_request
5Jul 17 16:51:10 upgrader-05 gunicorn[20402]: rv = self.handle_user_exception(e)
6Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/app.py", line 1820, in handle_user_exception
7Jul 17 16:51:10 upgrader-05 gunicorn[20402]: reraise(exc_type, exc_value, tb)
8Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/_compat.py", line 39, in reraise
9Jul 17 16:51:10 upgrader-05 gunicorn[20402]: raise value
10Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/app.py", line 1949, in full_dispatch_request
11Jul 17 16:51:10 upgrader-05 gunicorn[20402]: rv = self.dispatch_request()
12Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/app.py", line 1935, in dispatch_request
13Jul 17 16:51:10 upgrader-05 gunicorn[20402]: return self.view_functions[rule.endpoint](**req.view_args)
14Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/web/__init__.py", line 179, in library_
15Jul 17 16:51:10 upgrader-05 gunicorn[20402]: library=found,
16Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/templating.py", line 140, in render_template
17Jul 17 16:51:10 upgrader-05 gunicorn[20402]: ctx.app,
18Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask/templating.py", line 120, in _render
19Jul 17 16:51:10 upgrader-05 gunicorn[20402]: rv = template.render(context)
20Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
21Jul 17 16:51:10 upgrader-05 gunicorn[20402]: return self.environment.handle_exception(exc_info, True)
22Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
23Jul 17 16:51:10 upgrader-05 gunicorn[20402]: reraise(exc_type, exc_value, tb)
24Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
25Jul 17 16:51:10 upgrader-05 gunicorn[20402]: raise value.with_traceback(tb)
26Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/web/templates/library.html", line 1, in top-level template code
27Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {% extends "base.html" %}
28Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/web/templates/base.html", line 1, in top-level template code
29Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {% extends "bootstrap/base.html" %}
30Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 1, in top-level template code
31Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {% block doc -%}
32Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 4, in block "doc"
33Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {%- block html %}
34Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 20, in block "html"
35Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {% block body -%}
36Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/flask_bootstrap/templates/bootstrap/base.html", line 23, in block "body"
37Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {% block content -%}
38Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/web/templates/base.html", line 5, in block "content"
39Jul 17 16:51:10 upgrader-05 gunicorn[20402]: {% block main %}{% endblock %}
40Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/web/templates/library.html", line 5, in block "main"
41Jul 17 16:51:10 upgrader-05 gunicorn[20402]: <p><a href="{{library.link}}">{{library.description()}}</a></p>
42Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/library.py", line 58, in description
43Jul 17 16:51:10 upgrader-05 gunicorn[20402]: return self._metadata()['description']
44Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/library.py", line 46, in _metadata
45Jul 17 16:51:10 upgrader-05 gunicorn[20402]: }[self.manager](self.name)
46Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/libup/library.py", line 98, in _get_composer_metadata
47Jul 17 16:51:10 upgrader-05 gunicorn[20402]: resp = r.json()['package']
48Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/srv/libraryupgrader/venv/lib/python3.5/site-packages/requests/models.py", line 897, in json
49Jul 17 16:51:10 upgrader-05 gunicorn[20402]: return complexjson.loads(self.text, **kwargs)
50Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
51Jul 17 16:51:10 upgrader-05 gunicorn[20402]: return _default_decoder.decode(s)
52Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
53Jul 17 16:51:10 upgrader-05 gunicorn[20402]: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
54Jul 17 16:51:10 upgrader-05 gunicorn[20402]: File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
55Jul 17 16:51:10 upgrader-05 gunicorn[20402]: raise JSONDecodeError("Expecting value", s, err.value) from None
56Jul 17 16:51:10 upgrader-05 gunicorn[20402]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Change 524356 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[labs/libraryupgrader@master] Don't fatal if a composer dep isn't in packagist

https://gerrit.wikimedia.org/r/524356

Change 524356 merged by jenkins-bot:
[labs/libraryupgrader@master] Don't fatal if a composer dep isn't in packagist

https://gerrit.wikimedia.org/r/524356

Legoktm closed this task as Resolved.Jul 18 2019, 9:51 PM
Legoktm claimed this task.