#9240 src.fedoraproject.org api throwing 500s to package-owner-alias script
Closed: Fixed 7 months ago by pingou. Opened 7 months ago by kevin.

The package-owner-alias script cron ( running on bastion01/02: /usr/local/bin/lock-wrapper package-owner-aliases /usr/local/bin/package-owner-aliases.sh ) is failing with a 500 error trying to get the 10th page of package information. 09 and 11 seem fine, so perhaps some data is weird on that page?

The full traceback is:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 731, in urlopen
    body_pos=body_pos, **response_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 731, in urlopen
    body_pos=body_pos, **response_kw)
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 731, in urlopen
    body_pos=body_pos, **response_kw)
  [Previous line repeated 2 more times]
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 711, in urlopen
    retries = retries.increment(method, url, response=response, _pool=self)
  File "/usr/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='src.fedoraproject.org', port=443): Max retries exceeded with url: /api/0/projects?per_page=100&fork=false&page=10 (Caused
by ResponseError('too many 500 error responses',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/owner-email.py", line 62, in <module>
    for project in get_pagure_projects():
  File "/usr/local/bin/owner-email.py", line 44, in get_pagure_projects
    response = session.get(pagure_projects_url)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 507, in send
    raise RetryError(e, request=request)
requests.exceptions.RetryError: HTTPSConnectionPool(host='src.fedoraproject.org', port=443): Max retries exceeded with url: /api/0/projects?per_page=100&fork=false&page=10 (Caused by
ResponseError('too many 500 error responses',))
error creating owner-alias file

Metadata Update from @zlopez:
- Issue tagged with: groomed, medium-gain, medium-trouble

7 months ago

We need to investigate src.fp.o logs to find the root of this issue.

Metadata Update from @zlopez:
- Issue priority set to: Waiting on Assignee (was: Needs Review)

7 months ago

Metadata Update from @pingou:
- Issue assigned to pingou

7 months ago

Here is the traceback:

[2020-08-18 08:15:23,401] ERROR in flask_app: Error while processing request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.6/site-packages/pagure/api/__init__.py", line 252, in wrapper
    result = function(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/pagure/api/project.py", line 1227, in api_projects
    projects = [p.to_json(api=True, public=True) for p in projects]
  File "/usr/lib/python3.6/site-packages/pagure/api/project.py", line 1227, in <listcomp>
    projects = [p.to_json(api=True, public=True) for p in projects]
  File "/usr/lib/python3.6/site-packages/pagure/lib/model.py", line 1108, in to_json
    "access_groups": self.access_groups_json,
  File "/usr/lib/python3.6/site-packages/pagure/lib/model.py", line 1049, in access_groups_json
    for access, groups in self.access_groups.items():
  File "/usr/lib/python3.6/site-packages/pagure/lib/model.py", line 1071, in access_groups
    key=lambda x: x.group_name,
  File "/usr/lib/python3.6/site-packages/pagure/lib/model.py", line 1071, in <lambda>
    key=lambda x: x.group_name,
AttributeError: 'ProjectGroup' object has no attribute 'group_name'

This is likely a bug in pagure itself, I have a potential fix that I'm running through the test suite.

This is no longer happening, though I still need to commit and open the PR upstream

https://pagure.io/pagure/pull-request/4966 should fix this (and be a better one than the hotfix I've made on pkgs01)

Metadata Update from @pingou:
- Issue tagged with: dev

7 months ago

Metadata Update from @pingou:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

7 months ago

Login to comment on this ticket.

Metadata
Boards 1
dev Status: Done