Electrs stuck at "connecting to Electrs server..."

I still use Bitcoin Node Core 28.1.0 on Umbrel OS 0.5.4 (don´t want to update my old raspi since it works nicely ever since).

However I updated Electrs today (0.11.0) an ran into the same issue.

The problem is caused by a broken environment variable in the Electrs app configuration: the P2P address uses an unresolved variable like ${APP_BITCOIN_P2P_…}, which results in an invalid address and makes the electrs_electrs_1 container crash in a loop. Fixing the docker-compose.yml for Electrs and restarting Umbrel solves it.

1. SSH into the Umbrel node

  1. Open a terminal on your computer.

  2. Connect via SSH (replace the IP with your Umbrel node’s IP if needed):

    ssh umbrel@umbrel.local
    

    or

    ssh umbrel@<UMBREL-IP>
    
  3. Enter the password for the umbrel user when prompted.

If you see a warning that the host key has changed, remove the old entry from your local known_hosts file and try again.

2. Go to the Electrs app directory

  1. After logging in, change to the Umbrel base directory:

    cd ~/umbrel
    
  2. Go into the Electrs app data directory:

    cd app-data/electrs
    

You should now be in /home/umbrel/umbrel/app-data/electrs.

3. Open the Electrs docker-compose file

  1. Open the docker-compose.yml file with a text editor (e.g. nano):

    nano docker-compose.yml
    
  2. Inside this file, find the electrs: service section. It will look similar to this:

    electrs:
      image: getumbrel/electrs:v0.11.0@sha256:...
      restart: always
      environment:
        ELECTRS_LOG_FILTERS: "INFO"
        ELECTRS_NETWORK: "${APP_BITCOIN_NETWORK_ELECTRS}"
        ELECTRS_DAEMON_RPC_ADDR: "${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_RPC_PORT}"
        ELECTRS_DAEMON_P2P_ADDR: "${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_P2P_WHITEB...}"
        ELECTRS_ELECTRUM_RPC_ADDR: "0.0.0.0:${APP_ELECTRS_NODE_PORT}"
        ELECTRS_SERVER_BANNER: "Umbrel Electrs (${APP_VERSION})"
        ELECTRS_DB_DIR: "/data/db"
      volumes:
        - "${APP_BITCOIN_DATA_DIR}:/data/.bitcoin:ro"
        - "${APP_DATA_DIR}/data/electrs:/data"
      ports:
        - "${APP_ELECTRS_NODE_PORT}:${APP_ELECTRS_NODE_PORT}"
      networks:
        default:
          ipv4_address: $APP_ELECTRS_NODE_IP
    

The important line is ELECTRS_DAEMON_P2P_ADDR.

4. Fix the broken P2P address

  1. In the environment: block, replace the line

    ELECTRS_DAEMON_P2P_ADDR: "${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_P2P_WHITEB...}"
    

    (or any variant using ${APP_BITCOIN_P2P...}) with a static, working value pointing to the Bitcoin container, for example:

    ELECTRS_DAEMON_P2P_ADDR: "bitcoin_bitcoind_1:8333"
    
  2. Make sure you do not change the indentation or other lines.

This forces Electrs to connect to the internal bitcoin_bitcoind_1 service on the standard P2P port 8333 instead of using the broken Umbrel variable.

5. Save the file and exit

In nano:

  1. Press Ctrl + O to write the changes.
  2. Press Enter to confirm the filename.
  3. Press Ctrl + X to exit the editor.

6. Stop and start Umbrel services

  1. Go back to the Umbrel base directory (if you are not already there):

    cd ~/umbrel
    
  2. Stop all Umbrel services:

    sudo ./scripts/stop
    

    Enter the umbrel password when prompted.

  3. Start all Umbrel services again:

    sudo ./scripts/start
    

Wait a few minutes for all containers to come up.

7. Verify Electrs is running and syncing

  1. Check the running containers:

    docker ps
    

    You should see electrs_electrs_1 with status Up (not Restarting).

  2. In the Umbrel web UI, open the Electrs app. The previous “Connecting to Electrs server…” message should be replaced by a real sync progress value (percentage).

  3. If you look at the Electrs logs, you should see it indexing blocks (messages like “indexing 2000 blocks” and increasing heights), which indicates the index is being built.

1 Like

@fryday Thank you, your tutorial was spot-on. Resolved it for me!

But now, when I restart the Electrs app - the very first connection works for me. The Umbrel Electrs up get fully runnig. If I close the browser tab, try to open the app again…its always stucked with the " Connecting to Electrs server…"
If I restart the Electrs app, the very first connection works, but thats it…
No errors or issues in log…
Any idea?

Here’s what I found. This line in the docker-compose.yml for electrs was the problem.

ELECTRS_DAEMON_P2P_ADDR: “${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_P2P_WHITEBIND_PORT-${APP_BITCOIN_P2P_PORT}}”

After some research, I found that ‘-’ is a fallback: if the first variable isn’t defined, take the value after the ‘-’. The 0.5.4 release of Umbrel is using docker compose 1.29.2, and it seems there may be issues with using another variable as a fallback. I suspect it’s not evaluating the second variable but just using the literal ‘${APP_BITCOIN_P2P_PORT}’ which isn’t what we want. As a result, electrs won’t start, and the container keeps getting restarted again and again.

I removed the fallback and only used APP_BITCOIN_NODE_IP:

ELECTRS_DAEMON_P2P_ADDR: “${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_P2P_PORT}”

I used the second approach, and I was able to get the container started and it’s synchronizing. I prefer using the environment variables to hard-coding the port number, but obviously hard-coding the port number would also get around this.

1 Like