stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Broken Pipe (code: 32) Failed to handshake

Open nixfreak opened this issue 1 year ago • 6 comments

I followed the miner docs step-by-step here -> https://github.com/stacksfoundation/miner-docs/tree/main

Describe the bug Stacks error out trying to connect to local bitcoin node.

Steps To Reproduce

  1. compile most recent stacks-node and stacks lib
  2. Enable systemd stacks.service tail -f /stacks-blockchain/miner.log

Trying to sync mainnet stacks chain tip

WARN [1719696366.075455] [stackslib/src/burnchains/bitcoin/network.rs:194] [main] Failed to handshake with 127.0.0.1:8333: SerializationError(Io(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }))
WARN [1719696366.075504] [stackslib/src/burnchains/bitcoin/network.rs:194] [main] Failed to handshake with 127.0.0.1:8333: SerializationError(Io(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }))
WARN [1719696366.075562] [stackslib/src/burnchains/bitcoin/network.rs:194] [main] Failed to handshake with 127.0.0.1:8333: SerializationError(Io(Os { code: 32, kind: BrokenPipe, message:
INFO [1719767101.844079] [testnet/stacks-node/src/run_loop/boot_nakamoto.rs:205] [epoch-2/3-boot] Failed to open Sortition DB while checking current burn height, assuming height = 0
INFO [1719767102.844281] [testnet/stacks-node/src/run_loop/boot_nakamoto.rs:205] [epoch-2/3-boot] Failed to open Sortition DB while checking current burn height, assuming height = 0

Expected behavior Expected for stacks to sync

Environment (please complete the following information):

  • OS: Debian 12 x86_64 release 12
  • Rust version: rustc 1.79.0 (129f3b996 2024-06-10)

Port 8333 is open and has other peers connecting

4430       73.157.162.10:8333      ESTABLISHED
4122       46.10.115.237:8333      ESTABLISHED
60510      167.88.11.203:8333      ESTABLISHED
...

Bitcoin sync tip at 850124

Verified bitcoin synced to tip

2024-06-30T17:23:08Z UpdateTip: new best=0000000000000000000070af91b9ce3dcccf024fba947c43ecb254e81ecd9baa height=850124 version=0x200e2000 log2_work=95.012855 tx=1032780000 date='2024-06-30T17:22:49Z' progress=1.000000 cache=149.5MiB(1294593txo)

nixfreak avatar Jun 27 '24 21:06 nixfreak

Trying ... again

cd /stacks-blockchain ; cargo clean; cargo build --features monitoring_prom,slog_json --release --bin stacks-node sudo systemctl start stacks.service

`● stacks.service - Stacks Blockchain Loaded: loaded (/etc/systemd/system/stacks.service; enabled; preset: enabled) Active: active (running) since Mon 2024-07-01 14:39:13 CDT; 8s ago Process: 35083 ExecStartPost=/bin/sh -c umask 022; sleep 2 && pgrep -f "/usr/local/bin/s> Main PID: 35082 (sh) Tasks: 4 (limit: 9442) Memory: 41.0M CPU: 5.110s CGroup: /system.slice/stacks.service ├─35082 /bin/sh -c "/usr/local/bin/stacks-node start --config /etc/stacks-block> └─35085 /usr/local/bin/stacks-node start --config /etc/stacks-blockchain/Config>

Jul 01 14:39:11 stacks-node-01 systemd[1]: Starting stacks.service - Stacks Blockchain... Jul 01 14:39:13 stacks-node-01 systemd[1]: Started stacks.service - Stacks Blockchain `

WARN [1719862813.367322] [stackslib/src/burnchains/bitcoin/network.rs:194] [main] Failed to handshake with 0.0.0.0:8333: SerializationError(Io(Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" })) WARN [1719862813.367401] [stackslib/src/burnchains/bitcoin/network.rs:194] [main] Failed to handshake with 0.0.0.0:8333: SerializationError(Io(Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" })) INFO [1719862813.480841] [testnet/stacks-node/src/run_loop/boot_nakamoto.rs:205] [epoch-2/3-boot] Failed to open Sortition DB while checking current burn height, assuming height = 0 INFO [1719862814.480987] [testnet/stacks-node/src/run_loop/boot_nakamoto.rs:205] [epoch-2/3-boot] Failed to open Sortition DB while checking current burn height, assuming height = 0

nixfreak avatar Jul 01 '24 19:07 nixfreak

Your Bitcoin node is refusing to talk to your Stacks node. Can you confirm you're on Bitcoin 25.0 (which is what the docs say)? Also, can you post the [burnchain] portion of your Stacks node's config file (sans credentials)?

jcnelson avatar Jul 02 '24 19:07 jcnelson

Thanks for replying .. I am using Bitcoin node version 27

Below is burnchain

[burnchain]
chain = "bitcoin"
mode = "mainnet"
peer_host = "127.0.0.1"
#peer_host = "0.0.0.0"
username = "btcuser" # bitcoin rpc username from bitcoin config
password = "btcpass" # bitcoin rpc password from bitcoin config
rpc_port = 8332      # bitcoin rpc port from bitcoin config
peer_port = 8333     # bitcoin p2p port from bitcoin config
satoshis_per_byte = 100
#burn_fee_cap = 20000
burn_fee_cap = 450000

nixfreak avatar Jul 03 '24 12:07 nixfreak

burnchain] chain = "bitcoin" mode = "mainnet" peer_host = "127.0.0.1" #peer_host = "0.0.0.0" username = "btcuser" # bitcoin rpc username from bitcoin config password = "btcpass" # bitcoin rpc password from bitcoin config rpc_port = 8332 # bitcoin rpc port from bitcoin config peer_port = 8333 # bitcoin p2p port from bitcoin config satoshis_per_byte = 100 #burn_fee_cap = 20000 burn_fee_cap = 450000

nixfreak avatar Jul 03 '24 12:07 nixfreak

Your Bitcoin node is refusing to talk to your Stacks node. Can you confirm you're on Bitcoin 25.0 (which is what the docs say)? Also, can you post the [burnchain] portion of your Stacks node's config file (sans credentials)?

So your saying stacks doesn't work with the newest node version 27? ... It was working before though .. hmm I wonder if something changed on stacks end ? .. I guess doesn't matter .. so can I change versions of btc node without having to re-index everything again?

nixfreak avatar Jul 03 '24 12:07 nixfreak

Going through step-by-step to setup stacks-blockchain node..

cd /stacks-blockchain/ cargo clean output: warning: `/home/stacks1/stacks-blockchain/.cargo/config` is deprecated in favor of `config.toml` note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` Removed 3925 files, 2.3GiB total

nixfreak avatar Jul 04 '24 15:07 nixfreak