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

heimdall: better error logging for clerk/event-record/list nil response #9103

Merged
merged 4 commits into from
Dec 30, 2023

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Dec 29, 2023

Users reported this error

[bor.heimdall] an error while trying fetching path=clerk/event-record/list attempt=5 error="unexpected end of JSON input"

Which may happen if:

  1. Heimdall is behind and not sync-ed - for more info check clerk/client/rest :: add : blocktime check in recordListHandlerFn maticnetwork/heimdall#993
  2. Or the header time erigon is sending is far into the future

The logs in this PR will help us see which of the 2 is the culprit but most likely it is 1. We will investigate further 2. if it ever happens.

Changes:

  1. Improves logging upon heimdall client retries - prints out the full url that failed.
  2. Fixes a bug where the body was incorrectly checked if it is empty - len(body) == 0 vs body == nil
  3. Unit test for the bug regression
  4. Adds a log to indicate to users to check their heimdall process if they run into this scenario since that may be the culprit

Example output with new logs
Screenshot 2023-12-29 at 20 16 57

@taratorio taratorio changed the title Heimdall clerk unexpected end of json heimdall: better error logging for clerk/event-record/list error="unexpected end of JSON input" Dec 29, 2023
@taratorio taratorio changed the title heimdall: better error logging for clerk/event-record/list error="unexpected end of JSON input" heimdall: better error logging for clerk/event-record/list nil response Dec 29, 2023
@mh0lt mh0lt merged commit b562eff into devel Dec 30, 2023
7 checks passed
@mh0lt mh0lt deleted the heimdall-clerk-unexpected-end-of-json branch December 30, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants