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

Error 500 on package versions #908

Open
yzislin opened this issue Oct 17, 2024 · 8 comments
Open

Error 500 on package versions #908

yzislin opened this issue Oct 17, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@yzislin
Copy link

yzislin commented Oct 17, 2024

Hello,
First of all, I want to thank you for this great service. It contains enormous amount of useful data and information.

I am experiencing a lot of 500 errors when trying to pull package versions (sometimes on packages as well).
This is my api endpoint:
https://packages.ecosyste.ms/api/v1/registries/npmjs.org/versions

These are parameters that I pass:
params = {"page": 1, "per_page": 1000, "sort": "updated_at", "order": "asc", "updated_after": "2004-10-18T00:00:00.000Z"}

I use python requests to perform these operations.
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.get(url, params=params, headers=headers, timeout=20)

Thank you for taking a look.

@andrew andrew added the bug Something isn't working label Nov 5, 2024
@andrew
Copy link
Member

andrew commented Nov 5, 2024

I saw this error come in today, there's some invalid data showing up:

File: | app/models/version.rb:25:in `download_url'
-- | --
web.1
/api/v1/registries/npmjs.org/versions

MESSAGE

undefined method `registry' for nil

SUMMARY

File:	
app/models/version.rb:25:in `download_url'
Host:	
web.1
Path:	
/api/v1/registries/[npmjs.org/versions](http://npmjs.org/versions)

@yzislin
Copy link
Author

yzislin commented Nov 5, 2024

I've noticed if I change the timestamp by a minute or so, it will work. To me it feels like there is corruption in data or something. Maybe pagination issue.

@andrew
Copy link
Member

andrew commented Nov 5, 2024

I suspect it's that a version is being created and then displayed before it's been fully synced, I'm going to investigate further later today

@andrew
Copy link
Member

andrew commented Nov 10, 2024

Deploying an extra filter to avoid rendering invalid versions now.

@yzislin
Copy link
Author

yzislin commented Nov 10, 2024

Great. Thank you. I will give it a try.
I believe I've seen this error on different API calls like advisories as well.

@yzislin
Copy link
Author

yzislin commented Nov 12, 2024

I am still experiencing 500 errors on the same package versions API call. Thx

@andrew
Copy link
Member

andrew commented Nov 12, 2024

I recommend dropping the per_page value down, there’s a max timeout of 30 seconds

@yzislin
Copy link
Author

yzislin commented Nov 13, 2024

It is not helping. Today for some reason it is really slow and eventually I get 500.
curl -v "https://packages.ecosyste.ms/api/v1//registries/npmjs.org/versions?page=1&per_page=4&sort=updated_at&order=asc&updated_after=2022-04-23T22:11:40Z"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants