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

[2.6][T4] Occassional 503 and 422 errors when opening last page of /api/delegates/{username|address|publicKey}/blocks #2885

Closed
Lemii opened this issue Aug 22, 2019 · 7 comments

Comments

@Lemii
Copy link
Contributor

Lemii commented Aug 22, 2019

When navigating to the last page of a /api/delegates/{username|address|publicKey}/blocks query, the API occassionally returns a 503 or 422 error.

It mostly happens after a couple of dozen requests done in a short time.

Expected Behavior
The API should return the last page of results of the query.

Current Behavior
The API occassionally returns a 503 or 422 error after processing a number of requests.

Steps to Reproduce (for bugs)
I've created a simple script that demonstrates the issue, you can find it here: https://github.com/Lemii/first-forged-block

The script logs the date of the first forged block of each of the first 100 delegates. It usually starts out fine, but half way through the API starts returning errors.

You can tweak with the limiter settings to see how it affects the performance. However, even at 1 concurrent request with a high minTime, it will still return errors in the end.

Context
See tool above.

Your Environment
W10
NodeJS v12.8.0
Latest
https://github.com/Lemii/first-forged-block

@ghost
Copy link

ghost commented Aug 22, 2019

Thanks for opening this issue! A maintainer will review this in the next few days and explicitly select labels so you know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

@ghost
Copy link

ghost commented Aug 23, 2019

This issue or pull request needs further investigation. Please wait for further information, thank you.

@spkjp
Copy link
Contributor

spkjp commented Aug 27, 2019

@Lemii
422 means your query violates a schema. E.g.

?page=0 would trigger:
{"statusCode":422,"error":"Unprocessable Entity","message":"child \"page\" fails because [\"page\" must be a positive number]"}

But I'm unable to reproduce 503 errors with your script. Any more clues?

Edit: Nevermind I can reproduce it on mainnet.

@faustbrian
Copy link
Contributor

@Lemii could you check if this is still an issue? 422 means you send invalid data and 503 means the cache couldn't return data fast enough (usually only happens on low-spec machines).

@Lemii
Copy link
Contributor Author

Lemii commented Oct 29, 2019

@faustbrian I've done some tests with 2.6 and it doesn't occur any more 👍

@faustbrian
Copy link
Contributor

Thanks, will close this issue for now. If it starts to happen again just reopen it.

@ghost
Copy link

ghost commented Oct 29, 2019

This issue has been closed. If you wish to re-open it please provide additional information.

@faustbrian faustbrian changed the title Occassional 503 and 422 errors when opening last page of /api/delegates/{username|address|publicKey}/blocks [2.6][T4] Occassional 503 and 422 errors when opening last page of /api/delegates/{username|address|publicKey}/blocks Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants