electrs: electrs exits with code 135

I have the following Docker Compose setup:

version: "2"
services:

  bitcoind:
    image: lukechilds/bitcoind:v0.19.1
    stop_grace_period: 10m
    restart: always
    expose:
      - "8332"
    volumes:
      - ./data/bitcoind:/data/.bitcoin
    command: >-
      -rpcbind=0.0.0.0
      -rpcallowip=0.0.0.0/0
      -disablewallet=1

  electrs:
    image: electrs-app:latest
    stop_grace_period: 10m
    restart: always
    user: root
    ports:
      - "50001:50001"
    volumes:
      - ./data/bitcoind:/root/.bitcoin:ro
      - ./data/electrs:/root
    command: >-
      electrs
      -vvvv
      --timestamp
      --db-dir /root/db
      --daemon-rpc-addr bitcoind:8332

Changed to run as root user because lukechilds/bitcoind currently runs as root so electrs-app needs to be root to read .bitcoin/.cookie. I know I should fix that but it’s fine for just playing around.

Anyway, I don’t think it should be root that’s causing issues, I’m sure (I think?) this exact config has worked before, but for some reason when I try to run it now I get:

pi@pinode:~ $ docker-compose up electrs
Starting pi_electrs_1 ... done
Attaching to pi_electrs_1
electrs_1   | Config { log: StdErrLog { verbosity: Trace, quiet: false, timestamp: Millisecond, modules: [], writer: "stderr", color_choice: Auto }, network_type: bitcoin, db_path: "/root/db/mainnet", daemon_dir: "/root/.bitcoin", daemon_rpc_addr: V4(172.18.0.2:8332), electrum_rpc_addr: V4(127.0.0.1:50001), monitoring_addr: V4(127.0.0.1:4224), jsonrpc_import: false, index_batch_size: 100, bulk_index_threads: 4, tx_cache_size: 10485760, txid_limit: 100, server_banner: "Welcome to electrs 0.8.3 (Electrum Rust Server)!", blocktxids_cache_size: 10485760 }
electrs_1   | 2020-03-30T18:49:48.987+00:00 - DEBUG - Server listening on 127.0.0.1:4224
electrs_1   | 2020-03-30T18:49:48.989+00:00 - DEBUG - Running accept thread
electrs_1   | 2020-03-30T18:49:48.996+00:00 - INFO - NetworkInfo { version: 190100, subversion: "/Satoshi:0.19.1/", relayfee: 0.00001 }
electrs_1   | 2020-03-30T18:49:48.997+00:00 - INFO - BlockchainInfo { chain: "main", blocks: 623645, headers: 623645, bestblockhash: "0000000000000000000f359f884320a688b7c9d29b2aa3d77e25b40d0c2d149a", pruned: false, initialblockdownload:
false }
electrs_1   | 2020-03-30T18:49:48.998+00:00 - DEBUG - opening DB at "/root/db/mainnet"
pi_electrs_1 exited with code 135

Is there any way to get any more debug to see why it’s failing? Does code 135 mean something specific?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 51 (51 by maintainers)

Commits related to this issue

Most upvoted comments

Many thanks for reporting and debugging this issue! Updated Dockerfile to use rust:1.42.0-slim at 7d23da5.

I believe 135 means killed by a signal (didn’t find the code in electrs source). I guess this comes from rocksdb (crashes right after log mentioning opening it). I think there were some issues with rocksdb on RPi which you seem to be using.

core file is definitely a coredump. I don’t have the appropriate RPi at hand, so I’d suggest to run gdb electrs core (maybe you’ll need to specify the paths and install gdb somehow, I have no clue what kind of magic Docker does around that) and then type bt command and send us the output.

Resolved via #235 - thanks for the help 😃

I believe you only need to add:

[patch.crates-io]
cc = { git = "https://github.com/Kixunil/cc-rs", branch = "fix-alignment" }

to Cargo.toml of electrs to test it

Thanks, late here now but I’ll try llvm-dev in the morning!

AFAIK @romanz had a good reason to keep Rust 1.34 - due to it being the latest supported Rust version in Debian Buster. But maybe if we could change the underlying OS to Buster while keeping 1.34 that might work.

So I wrote the patch, please note the fix-alignment branch. Try to swap cc dependency with the changed code and compile in release mode.

Also, maybe a good idea to run rustc --print cfg and paste the output here. I’d like to check if the output is what I’d expect.

Ok, testing debug = true first:

diff --git a/Cargo.toml b/Cargo.toml
index a5f2ca5..c18ea1c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,7 @@ spec = "config_spec.toml"

 [profile.release]
 lto = true
+debug = true

 [features]
 latest_rust = []  # use latest Rust features (otherwise, support Rust 1.34)

By this do you mean whether it’s electrs or RocksDB?

Yes.

Hmmn, this is very odd.

With the following change:

diff --git a/Dockerfile b/Dockerfile
index 228b4f1..b3798be 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,8 +10,8 @@ USER user
 WORKDIR /home/user
 COPY ./ /home/user

-RUN cargo build --release
-RUN cargo install --path .
+RUN cargo build
+RUN cargo install --debug --path .

 # Electrum RPC
 EXPOSE 50001

I can build the Docker image and attempt to start the sync with the exact same command as before and it works without crashing.

I’ll let it sync and then try rebuilding without those flag changes and see if it’s still stable. 🤷‍♂️