-
Notifications
You must be signed in to change notification settings - Fork 500
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
ipfs daemon --offline returns 400 for /api/v0/stats/bw #853
Comments
We need to handle the situation where the The peers page will show 0 peers, so it'd be worth adding a message on that page that explains why. The connection indicator should be updated to denote that we are connected to IPFS but in offline mode. |
@olizilla is the current behavior satisfactory to close this issue or is something missing? |
@rafaelramalho19 I was revisiting this while testing ipfs/ipfs-companion#936 and this is still a problem. When I run daemon in offline mode ( So we need fix described in #853 (comment) and a smarter detection of the let peers
try {
peers = await ipfs.swarm.peers({ timeout: 2500 })
} catch (error) {
if (error.message.includes('action must be run in online mode')) {
// node is running in offline mode (ipfs daemon --offline)
// https://github.com/ipfs-shipyard/ipfs-companion/issues/790
return [] // ipfs daemon --offline
}
// actual error handling...
}
|
Fetching the bandwidth usage seems like it would of course error when offline. So some other method to check if the daemon is running should be used. Unfortunately, none of the commands in the documentation seem like simple pulse checks. Maybe |
If your run
ipfs daemon --offline
then the API responds to requests for
/api/v0/stats/bw
with a400
status code and the body:as we're using the bandwidth stats to determine if the connection is working, the Web UI asserts that the connection to IPFS has failed.
The text was updated successfully, but these errors were encountered: