erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.09k stars 1.08k forks source link

Erigon fails to run systemctl if user is not set #9694

Open poolpitako opened 5 months ago

poolpitako commented 5 months ago

System information

Erigon version: ./erigon --version erigon version 2.58.2

OS & Version: Windows/Linux/OSX Linux

Commit hash: download

Erigon Command (with flags/config): This is the service file:

[Unit]
Description=erigon
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=/home/user/gnosis/erigon --chain=gnosis --datadir=/home/user/gnosis/data --authrpc.jwtsecret=/home/user/gnosis/jwtsecret/jwt.hex --prune=htcr --port=30304 --authrpc.port=8552 --torrent.port=42068 --http --http.addr 0.0.0.0 --http.port=8145 --http.api=eth,debug,net,trace,web3

[Install]
WantedBy=multi-user.target

Consensus Layer: N/A

Consensus Layer Command (with flags/config): N/A

Chain/Network: gnosis-chain

Expected behaviour

It should work.

Actual behaviour

It fails to start. Here's the important part of the log.

Mar 13 05:28:57 ss-node-2 systemd[1]: erigon.service: Scheduled restart job, restart counter is at 2.
Mar 13 05:28:57 ss-node-2 systemd[1]: Stopped erigon.
Mar 13 05:28:57 ss-node-2 systemd[1]: Started erigon.
Mar 13 05:28:58 ss-node-2 erigon[5686]: SIGSEGV: segmentation violation
Mar 13 05:28:58 ss-node-2 erigon[5686]: PC=0x7f18ffa2cf14 m=0 sigcode=1
Mar 13 05:28:58 ss-node-2 erigon[5686]: signal arrived during cgo execution
Mar 13 05:28:58 ss-node-2 erigon[5686]: goroutine 1 [syscall, locked to thread]:

Steps to reproduce the behaviour

I tried older versions up to dencun and that didn't help. I also re-compiled myself and I got the same error.

FIX

To fix the issue, I just modified the service to have a user. Adding something like

User=root

fixes the problem.

Backtrace

N/A

shashankram commented 3 months ago

I observed the exact same problem with a different systemd service.

shashankram commented 3 months ago

@poolpitako would you mind sharing the complete stacktrace from the crash?

poolpitako commented 3 months ago

@poolpitako would you mind sharing the complete stacktrace from the crash?

Don't have it anymore. You can repro with the steps I gave.