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

Ceramic daemon should return a promise rejection if cannot connect to ipfs node #799

Open
Schwartz10 opened this issue Jan 14, 2021 · 4 comments
Labels

Comments

@Schwartz10
Copy link

For bash scripting purposes, it would be helpful if the ceramic daemon would more gracefully fail, returning non-zero exit codes.

When the IPFS node is starting up, if we start the ceramic daemon too early, we get:

Executing command in 1 package: "ceramic daemon --ipfs-api http://localhost:5011"
(node:39087) UnhandledPromiseRejectionWarning: FetchError: request to http://localhost:5011/api/v0/id failed, reason: socket hang up
    at ClientRequest.<anonymous> (/Users/jonathanschwartz/Documents/daemon-land/js-sdk/services/api/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (events.js:314:20)
    at Socket.socketOnEnd (_http_client.js:493:9)
    at Socket.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1244:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:39087) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:39087) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

For some reason this still seems to register as a successfully run command. This makes it hard to gracefully script deployments.

@oed
Copy link
Member

oed commented Jan 15, 2021

Thanks for reporting this @Schwartz10 Seems like a very reasonable change to make!

@stbrody stbrody added the good first issue Good for newcomers label Feb 11, 2021
@stbrody
Copy link
Contributor

stbrody commented Apr 25, 2021

Possibly related to #9?

@btme0011
Copy link

can i work on this issue?

@oed
Copy link
Member

oed commented Nov 7, 2023

@btme0011 This issue is pretty old so not sure if it's still a problem actually. If you can replicate it then feel free!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants