RPC: Calls to Bitcoin RPC are truncated. #24945

issue leffw opened this issue on April 22, 2022
  1. leffw commented at 2:55 PM on April 22, 2022: none

    RPC: Calls to Bitcoin RPC are truncated.

    I'm having a problem making batching calls to Bitcoin RPC it is returning a truncated JSON, my suspicions is that there is some max-size for the response of requests, if that is true it should return a message error.

    Bitcoin Core Version: 22.0

    To reproduce the problem:

    curl -X POST http://user:password@127.0.0.1:8332 -d '[{"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000000b3f09b8c8543f319154284e73974313edf8cc0fadefb", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000005fd813bc5abf8406a428fdc2d998ae1fcda34c618282b", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["000000000000000000056f516b8d0c5810f6d22d5172093fd4b9ccdb5a5b51c3", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["0000000000000000000677330a2cb375a6b4098e79f6c5c5de147ec7007a05e6", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["0000000000000000000076b356851724eafeb9e402d8ca3d28876c811e64822f", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["000000000000000000070b1e3f9ed6b431dd31e4e2c6715aa0a0adb4a358bc12", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000008e0074bc06cf8f802c1f78de66782d9555688e3fe8b2f", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["0000000000000000000990e84241724e4cbd313f6a50dd9c6e7fa8cb0a186e8f", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["0000000000000000000362f6e349459fe90a1aeddc9c24cae12377146db32e54", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000006c9812479c7c1e3b352e3347830cae56cef62713ac070", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000006d5ca16560698cf9452715fad427a1b8fe371d23794c6", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000000081808279c53523533773e56593d8dc383c01764ac64", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["000000000000000000002f582f11911747441be90bb63337079d39b7a844f4e4", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000003017b46d0da7ff6865b79248510656997108a00db1855", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["000000000000000000068bea85c817bf7ebb3128126e5c6ed50d514c81356835", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["0000000000000000000196fc11d94c524ae490382c8ed5ea383e8c8a5fd6998c", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000003ea4bc617c404920643c75b94ffc090304b19a9d51391", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["000000000000000000078c80926de91a3b6b7b8572acf09ca80b945789fe55b7", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["000000000000000000059710e78d84f7e3e35e61b0e254b957d58b7c325bf2d2", 0]}, {"jsonrpc": "2.0", "method": "getblock", "params": ["00000000000000000000b054a83708138c04ab9c97f5d9983e34b9f145d24f73", 0]}]' -H 'Content-Type:application/json' --silent
    
  2. leffw added the label Bug on Apr 22, 2022
  3. achow101 commented at 3:49 PM on April 22, 2022: member

    Are you sure that it isn't your terminal?

  4. leffw commented at 4:20 PM on April 22, 2022: none

    Are you sure that it isn't your terminal?

    Yes, the python requests library returns the same problem the JSON is broken.

    requests.exceptions.JSONDecodeError: [Errno Unterminated string starting at] [{"result":"0400ff3f7a798706ff6b6dad67747b5c4a314094390359e37c3108000000000000000000bc080e6c671cc05da93de4cb203f091a5c6710cabff5e79ccaee576563b3bbe6f4bc6162d9f809173c87394afd5407020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4e03f32e0b ...
    
  5. promag commented at 1:47 PM on April 25, 2022: member

    I don't have this issue.

    curl -v ...
    < HTTP/1.1 200 OK
    < Content-Type: application/json
    < Date: Mon, 25 Apr 2022 13:35:40 GMT
    < Content-Length: 45231752
    

    the JSON response seems fine

    curl ... --silent | jq length
    20
    

    please check if you get the same result as:

    curl .... --silent | wc
           1       1 45231752
    
  6. leffw commented at 3:07 PM on April 25, 2022: none

    I don't have this issue.

    curl -v ...
    < HTTP/1.1 200 OK
    < Content-Type: application/json
    < Date: Mon, 25 Apr 2022 13:35:40 GMT
    < Content-Length: 45231752
    

    the JSON response seems fine

    curl ... --silent | jq length
    20
    

    please check if you get the same result as:

    curl .... --silent | wc
           1       1 45231752
    

    Different result.

    curl .... --silent | wc
    0       1 34218902
    
  7. promag commented at 3:09 PM on April 25, 2022: member

    What version are you running? Is this a local build or something installed/downloaded?

  8. leffw commented at 3:14 PM on April 25, 2022: none

    What version are you running? Is this a local build or something installed/downloaded?

    Version: 22.0 ~ Ubuntu (Downloaded binary not compiled).

  9. leffw commented at 3:17 PM on April 25, 2022: none

    What version are you running? Is this a local build or something installed/downloaded?

    Version: 22.0 ~ Ubuntu (Downloaded binary not compiled).

    Other relevant information I am using a Proxy and the bitcoin server is in Cloud.

  10. sipa commented at 3:18 PM on April 25, 2022: member

    Could it be that the proxy is truncating the results?

    Can you reproduce the problem without the proxy?

  11. leffw closed this on Apr 28, 2022

  12. DrahtBot locked this on Apr 28, 2023
Labels

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-05-03 15:13 UTC

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