bitcoin-cli RPC client doesn't support HTTP chunked encoding. #6623

issue msgilligan opened this issue on September 2, 2015
  1. msgilligan commented at 9:01 PM on September 2, 2015: none

    I'm working on a bitcoinj-based Bitcoin JSON-RPC server and discovered that bitcoin-cli will return:

    error: no response from server
    

    when the JSON-RPC server returns an HTTP chunked response. curl and my Java client work correctly with the server -- and if I modify the server to not send chunked responses bitcoin-cli works.

    I can provide links to more info or to a test server if needed.

    p.s. I tested on Mac OS X with a client built from source that reports v0.10.2.0-390ea20

  2. msgilligan commented at 9:44 PM on September 2, 2015: none

    For reference here is the issue I opened against jsonrpc4j which shows the workaround code I used to get bitcoin-cli to work: https://github.com/briandilley/jsonrpc4j/issues/80

  3. msgilligan commented at 10:16 PM on September 2, 2015: none

    To reproduce make sure you have JDK 8+ installed, then download and run an early version of bitcoinj-daemon:

    curl -O -L https://bintray.com/artifact/download/msgilligan/maven/com/msgilligan/bitcoinj-daemon/0.0.2/bitcoinj-daemon-0.0.2.jar
    java -jar bitcoinj-daemon-0.0.2.jar
    

    Then run the client:

    bitcoin-cli -rpcport=8080 getblockcount
    

    You should get the following output:

    error: no response from server
    
  4. laanwj commented at 10:56 AM on September 3, 2015: member

    As bitcoind doesn't ever send chunked encoding, that's not really a design goal either.

    Having said that, try the bitcoin-cli from #5677, it is based on a more extensive HTTP implementation.

  5. msgilligan commented at 11:56 AM on September 3, 2015: none

    Thanks @laanwj

    I'm developing a Bitcoin JSON-RPC server in Java (using bitcoinj) and my plan is to help make the server-side library (jsonrpc4j) configurable to not send chunked encoding. But I thought I'd open this issue to at least document it. I was using bitcoin-cli to test the Java server when I discovered this issue.

    I'll try the new bitcoin-cli when it is merged in to master. I have written (with help from @dexX7 ) a Java Bitcoin RPC client and RegTest-mode integration tests for some of the RPCs. I'm in the process of moving the code from OmniLayer/OmniJ to msgilligan/bitcoinj-addons. You may want to consider running the client and integration tests against the new server implementation. Sometimes running a different implementation of the client can bring out issues in the server.

  6. laanwj commented at 2:00 PM on September 4, 2015: member

    It's been merged. I think it should work now.

  7. laanwj added the label RPC on Sep 4, 2015
  8. msgilligan commented at 5:30 PM on September 4, 2015: none

    I pulled the latest master, built and ran bitcoin-cli against bitcoinj-daemon and it worked!

    Thanks!

  9. msgilligan closed this on Sep 4, 2015

  10. MarcoFalke locked this on Sep 8, 2021
Contributors

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 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me