JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
780 stars 549 forks source link

[Bug] JSON decode failed(1): '[' or '{' expected near 'HTTP' #408

Closed GregTonoski closed 11 months ago

GregTonoski commented 11 months ago
cpuminer-avx512-sha-vaes.exe -a sha256d -o 127.0.0.1:8332 -u user -p pass --coinbase-addr=bc1q74nxlgjv8w384gssnxp8evnjlw3utm8zm3ctpe -P

         **********  cpuminer-opt 23.15  ***********
     A CPU miner with multi algo support and optimized for CPUs
     with AVX512, SHA and VAES extensions by JayDDee.
     BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT

CPU: 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
SW built on Nov 30 2023 with GCC-9.3.0 Windows
CPU features:  x86_64 AVX512 VAES SHA256
SW features:   x86_64 AVX512 VAES SHA256
Algo features:        AVX512
[2023-12-13 18:04:06] Enabled optimizations: AVX512
[2023-12-13 18:04:06] CPU affinity [!!!!!!!!!!!!]
[2023-12-13 18:04:06] Stratum connect stratum+tcp://127.0.0.1:8332
[2023-12-13 18:04:06] 12 of 12 miner threads started using 'sha256d' algorithm
*   Trying 127.0.0.1:8332...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8332 (#0)
* Connection #0 to host 127.0.0.1 left intact
[2023-12-13 18:04:06] > {"id": 1, "method": "mining.subscribe", "params": ["cpuminer-opt-23.15-x64W"]}
[2023-12-13 18:04:06] < HTTP/1.1 400 Bad Request
[2023-12-13 18:04:06] JSON decode failed(1): '[' or '{' expected near 'HTTP'
[2023-12-13 18:04:06] > {"id": 1, "method": "mining.subscribe", "params": []}
[2023-12-13 18:04:06] < Content-Type: text/html
[2023-12-13 18:04:06] JSON decode failed(1): '[' or '{' expected near 'Content'
[2023-12-13 18:04:06] ...retry after 10 seconds
*   Trying 127.0.0.1:8332...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8332 (#0)
* Connection #0 to host 127.0.0.1 left intact
[2023-12-13 18:04:16] > {"id": 1, "method": "mining.subscribe", "params": ["cpuminer-opt-23.15-x64W"]}
[2023-12-13 18:04:16] < HTTP/1.1 400 Bad Request
[2023-12-13 18:04:16] JSON decode failed(1): '[' or '{' expected near 'HTTP'
[2023-12-13 18:04:16] > {"id": 1, "method": "mining.subscribe", "params": []}
[2023-12-13 18:04:16] < Content-Type: text/html
[2023-12-13 18:04:16] JSON decode failed(1): '[' or '{' expected near 'Content'
[2023-12-13 18:04:16] ...retry after 10 seconds
*   Trying 127.0.0.1:8332...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8332 (#0)
* Connection #0 to host 127.0.0.1 left intact
[2023-12-13 18:04:26] > {"id": 1, "method": "mining.subscribe", "params": ["cpuminer-opt-23.15-x64W"]}
[2023-12-13 18:04:26] < HTTP/1.1 400 Bad Request
[2023-12-13 18:04:26] JSON decode failed(1): '[' or '{' expected near 'HTTP'
[2023-12-13 18:04:26] > {"id": 1, "method": "mining.subscribe", "params": []}
[2023-12-13 18:04:26] < Content-Type: text/html
[2023-12-13 18:04:26] JSON decode failed(1): '[' or '{' expected near 'Content'
[2023-12-13 18:04:26] ...retry after 10 seconds
[2023-12-13 18:04:34] CTRL_C_EVENT received, exiting
GregTonoski commented 11 months ago

It seems that prefixing with http:// solves the issue, i.e.

cpuminer-avx512-sha-vaes.exe -a sha256d -o http://127.0.0.1:8332 -u user -p pass --coinbase-addr=bc1q74nxlgjv8w384gssnxp8evnjlw3utm8zm3ctpe -P

JayDDee commented 11 months ago

The default is stratum+tcp when not specified because it's more common and saves typing, "http://" is shorter than "stratum+tcp://".:) Glad you found the problem, troubleshootting GBT is a pain.

JayDDee commented 11 months ago

[2023-12-13 18:04:06] Stratum connect stratum+tcp://127.0.0.1:8332

This should be enough of a clue.

It's the type of error that's only ever made once so checking for it is isn't worth the effort.