start-os icon indicating copy to clipboard operation
start-os copied to clipboard

[bug]: Embassy UI became unresponsive during electrs initial index

Open BBlackwo opened this issue 3 years ago • 8 comments

Prerequisites

  • [X] I have searched for existing issues that already report this problem, without success.

EmbassyOS Version

0.3.0.3

Device

Laptop/Desktop

Device OS

Linux

Device OS Version

Pop!_OS 21.10

Browser

Brave

Browser Version

Version 1.38.119

Current Behavior

During the initial electrs indexing my Embassy UI became unresponsive. I could still SSH into the embassy, but I could not use the UI. I could still click around in the UI but it wasn't loading properly. I was connecting through the .local address.

Expected Behavior

I would have expected it to not become unresponsive

Steps to Reproduce

  1. Install electrs
  2. Start electrs
  3. After about 10-15mins the Embassy UI became unresponsive

Anything else?

Thanks to @chrisguida who helped me debug the issue.

Unresponsive UI example

I could still click around the UI but actions didn't work. When trying to stop a service with the UI, it had a spinner and said Stopping... but never finished.

The monitor page was like this, forever loading.

Screenshot from 2022-05-25 13-56-26

htop output

As you can see embassyd was maxing out one of the CPUs.

Screenshot from 2022-05-25 10-55-25

docker ps output

(Removed ports and container IDs from output)

IMAGE                            COMMAND                  CREATED        STATUS        NAMES
start9/electrs/main:0.9.7        "docker_entrypoint.sh"   13 hours ago   Up 13 hours   electrs.embassy
start9/mempool/main:2.3.1.4      "docker_entrypoint.sh"   13 days ago    Up 13 days    mempool.embassy
start9/vaultwarden/main:1.22.2   "/usr/local/bin/dock…"   13 days ago    Up 13 days    vaultwarden.embassy
start9/synapse/main:1.42.0       "docker_entrypoint.sh"   13 days ago    Up 13 days    synapse.embassy
start9/bitcoind/main:22.0.1      "docker_entrypoint.sh"   13 days ago    Up 13 days    bitcoind.embassy

Resolution

The problem was resolved by running systemctl restart embassyd and I haven't had any issues since

Misc

  • Nothing of interest was in the kernel logs (dmesg -H)
  • Before starting electrs the memory usage was only 20%.
  • Hardware: Raspberry Pi 8GB

BBlackwo avatar May 25 '22 05:05 BBlackwo

This same sort of issue happened again a few days ago (embassyd using 100% of one CPU and being unresponsive). It happened around the time I started a coinjoin round with Sparrow + electrs. Not sure if that's related.

Attached is the output of journalctl -u embassyd -n1000 as requested. Looks like the logs stopped on May 28, which is when the issue started.

embassyd-logs-redacted.txt

BBlackwo avatar Jun 01 '22 01:06 BBlackwo

What are your Bitcoin RPC thread and work queue settings? Bitcoin service -> Config -> RPC -> Advanced

If they are defaults, try to up threads to 3 or 4, an work queue to 32. This is not likely to be the core reason for embassyd taking up resources (I believe this issue has been discovered elsewhere by @dr-bonez ), but may help with this particular issue.

kn0wmad avatar Jun 02 '22 15:06 kn0wmad

@kn0wmad sorry for the late reply! I had the defaults for those settings. I've updated to 4 threads and work queue 32. Will see if that helps. Thanks!

BBlackwo avatar Jun 15 '22 21:06 BBlackwo

Proactively closing. Please reopen if the workqueue settings didn't address the issue.

ProofOfKeags avatar Jun 20 '22 17:06 ProofOfKeags

Looks like changing the settings didn't address the issue. It happened again, though this time it was after restarting to apply the v0.3.1.1 update. I downloaded the update, clicked the "restart to apply" button, and then it became unresponsive.

The UI now just says "Connecting to Embassy" forever and the API returns 502.

Screenshot from 2022-07-30 11-54-09 Screenshot from 2022-07-30 11-54-34

I SSHed in and it looks like it actually failed to update as it's still on EmbassyOS v0.3.1 - 244260e34a9152ddd9d8e864f162bc9d112dc178.

htop output

embassyd is maxing out one of the CPU cores again

Screenshot from 2022-07-30 11-52-39

docker

No docker containers are running

# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Logs

Attaching the output of journalctl -u embassyd -n1000 again.

logs-redacted.txt

Let me know if you need any more info before I restart embassyd.

BBlackwo avatar Jul 30 '22 02:07 BBlackwo

Given that your Embassy is still on 031, this is likely the shutdown issue. Power cycle should fix.

Thanks for the logs and metrics snapshot, this might be helpful in diagnosing. Keeping closed in favor of #1396. @dr-bonez

MattDHill avatar Jul 30 '22 02:07 MattDHill

I don't think this is the same issue. In #1396 did embassyd peg @cryptodread's CPU?

Also, @BBlackwo's previous instances of this did not involve a shutdown.

chrisguida avatar Jul 30 '22 12:07 chrisguida

This happened again today, this time after I restarted my embassy. It immediately became unresponsive after restarting. embassyd again was using 100% of one CPU.

Restarting it a 2nd time resolved the issue.

BBlackwo avatar Sep 09 '22 09:09 BBlackwo

Presumably fixed in 0.3.3

elvece avatar Dec 14 '22 22:12 elvece