As of now if you're not familiar with the other error responses, you might not know why connection failed. Give common reasons for this particular error message.
Trivial: Add common failure cases for rpc server connection failure #9073
pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:rpcnoconnectstring changing 1 files +1 −1-
instagibbs commented at 1:57 PM on November 3, 2016: member
- MarcoFalke added the label Docs and Output on Nov 3, 2016
-
in src/bitcoin-cli.cpp:None in b765a71df2 outdated
239 | @@ -240,7 +240,7 @@ UniValue CallRPC(const string& strMethod, const UniValue& params) 240 | event_base_free(base); 241 | 242 | if (response.status == 0) 243 | - throw CConnectionFailed(strprintf("couldn't connect to server (%d %s)", response.error, http_errorstring(response.error))); 244 | + throw CConnectionFailed(strprintf("couldn't connect to server (make sure server is running and you are connecting to the correct RPC port : %d %s)", response.error, http_errorstring(response.error)));
paveljanik commented at 3:39 PM on November 3, 2016:nit: please remove space before
:.instagibbs force-pushed on Nov 3, 2016laanwj commented at 3:54 PM on November 3, 2016: memberConcept ACK, but I think this message is becoming too long to be crammed into one line. I think it'd make sense to write it out over multiple lines, e.g. leave the last line for the detailed error message (if any).
Add common failure cases for rpc server connection failure 8f329f991binstagibbs force-pushed on Nov 3, 2016instagibbs commented at 4:11 PM on November 3, 2016: memberadded newline to break it up some of the text
MarcoFalke commented at 4:47 PM on November 3, 2016: memberutACK 8f329f991bc81ddcfb4f51574e2003edde14e996
laanwj commented at 6:19 PM on November 3, 2016: memberTested ACK 8f329f9
laanwj merged this on Nov 3, 2016laanwj closed this on Nov 3, 2016laanwj referenced this in commit 82077ef6e4 on Nov 3, 2016laanwj commented at 7:12 AM on November 23, 2016: memberThis is a bit confusing now:
$ cli getinfo error: couldn't connect to server (make sure server is running and you are connecting to the correct RPC port: -1 unknown)If you don't know better it seems like the port is unknown. I think this would be better:
$ cli getinfo error: couldn't connect to server: unknown (-1) (make sure server is running and you are connecting to the correct RPC port)laanwj referenced this in commit fe37fbe606 on Dec 2, 2016zkbot referenced this in commit b0afc4ba1d on Mar 22, 2017zkbot referenced this in commit f9f48667be on Mar 25, 2017codablock referenced this in commit 5adb5b8e8a on Jan 13, 2018lateminer referenced this in commit a3810f39e9 on Jan 4, 2019andvgal referenced this in commit d5e7d65fc4 on Jan 6, 2019CryptoCentric referenced this in commit 3348f8023d on Feb 15, 2019MarcoFalke locked this on Sep 8, 2021ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me