Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 when trying to get all packages from database #1081

Closed
Zlopez opened this issue Apr 9, 2021 · 4 comments
Closed

500 when trying to get all packages from database #1081

Zlopez opened this issue Apr 9, 2021 · 4 comments
Labels
type.api API related change type.bug

Comments

@Zlopez
Copy link
Contributor

Zlopez commented Apr 9, 2021

There is issue in API v2 when retrieving all packages, it looks like there is at least one package that is not associated to any project. This shouldn't happen anymore after #608, but it seems that there are still a few packages left that weren't deleted.

[2021-04-09 12:01:55,131 anitya.app ERROR] Exception on /api/v2/packages/ [GET]
Traceback (most recent call last):
   File "/usr/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
     rv = self.dispatch_request()
   File "/usr/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
     return self.view_functions[rule.endpoint](**req.view_args)
   File "/usr/lib/python3.8/site-packages/flask_restful/__init__.py", line 468, in wrapper
     resp = resource(*args, **kwargs)
   File "/usr/lib/python3.8/site-packages/flask/views.py", line 89, in view
     return self.dispatch_request(*args, **kwargs)
   File "/usr/lib/python3.8/site-packages/flask_restful/__init__.py", line 583, in dispatch_request
     resp = meth(*args, **kwargs)
   File "/usr/local/lib/python3.8/site-packages/anitya/api_v2.py", line 140, in get
     "items": [
   File "/usr/local/lib/python3.8/site-packages/anitya/api_v2.py", line 144, in <listcomp>
     "project": package.project.name,
AttributeError: 'NoneType' object has no attribute 'name'
@Zlopez
Copy link
Contributor Author

Zlopez commented Jun 7, 2021

I tried today curl https://release-monitoring.org/api/v2/packages/ and didn't encounter this issue. I'm not sure what was changed, but this could be closed now.

@Zlopez Zlopez closed this as completed Jun 7, 2021
@Zlopez
Copy link
Contributor Author

Zlopez commented Jun 7, 2021

This is still happening, it just not hit any of those packages on page 1.

@Zlopez Zlopez reopened this Jun 7, 2021
@Zlopez
Copy link
Contributor Author

Zlopez commented Jun 7, 2021

I prepared a query to fix this on local database and created https://pagure.io/fedora-infrastructure/issue/10019 to fix this on production database.

@Zlopez
Copy link
Contributor Author

Zlopez commented Jun 8, 2021

With the https://pagure.io/fedora-infrastructure/issue/10019 done, this is no longer an issue.

@Zlopez Zlopez closed this as completed Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type.api API related change type.bug
Projects
None yet
Development

No branches or pull requests

1 participant