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

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

Closed
msgilligan opened this Issue Sep 2, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@msgilligan

msgilligan commented Sep 2, 2015

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

@msgilligan

This comment has been minimized.

Show comment
Hide comment
@msgilligan

msgilligan Sep 2, 2015

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

msgilligan commented Sep 2, 2015

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

@msgilligan

This comment has been minimized.

Show comment
Hide comment
@msgilligan

msgilligan Sep 2, 2015

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

msgilligan commented Sep 2, 2015

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
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 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.

Member

laanwj commented Sep 3, 2015

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.

@msgilligan

This comment has been minimized.

Show comment
Hide comment
@msgilligan

msgilligan Sep 3, 2015

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.

msgilligan commented Sep 3, 2015

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.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 4, 2015

Member

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

Member

laanwj commented Sep 4, 2015

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

@laanwj laanwj added the RPC/REST/ZMQ label Sep 4, 2015

@msgilligan

This comment has been minimized.

Show comment
Hide comment
@msgilligan

msgilligan Sep 4, 2015

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

Thanks!

msgilligan commented Sep 4, 2015

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

Thanks!

@msgilligan msgilligan closed this Sep 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment