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

Improve error handling for no archiver empty cycle info #61

Open
chrypnotoad opened this issue Sep 5, 2024 · 1 comment
Open

Improve error handling for no archiver empty cycle info #61

chrypnotoad opened this issue Sep 5, 2024 · 1 comment

Comments

@chrypnotoad
Copy link
Contributor

When getting archiver stats if the archiver has no cycleinfo it is an empty array and fails with a not very useful error undefined => undefined

When this is most likely to happen is when starting up a local network if you start the RPC before the network is processing you get this error. This could be logged more gracefully

Unreachable Archiver @ 127.0.0.1:4000 | Error-code: undefined => undefined

const res = await axios.get(`http://${url.ip}:${url.port}/cycleinfo/1`)
if (res?.data?.cycleInfo[0].counter > maxCycleValue) {
maxCycleValue = res?.data?.cycleInfo[0].counter
}
return { url: `http://${url.ip}:${url.port}`, cycle_value: res?.data?.cycleInfo[0].counter }
} catch (error: unknown) {
console.error(
`Unreachable Archiver @ ${url.ip}:${url.port} | Error-code: ${(error as NodeJSError).errno} => ${
(error as NodeJSError).code
}`
)
return { url: `http://${url.ip}:${url.port}`, cycle_value: null }

image

@agentjacker
Copy link

i am facing this issue right now while trying to run it locally, i have shardus and shardeum running and monitoring it on localhost:3000 but when i try to run the jsonrpcserver it guves this error how did you fix it?

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

2 participants