kyuupichan / electrumx

Alternative implementation of spesmilo/electrum-server
Other
724 stars 733 forks source link

Permission Denied under user electrumx but after successful runs #1066

Closed iangregsondev closed 2 years ago

iangregsondev commented 2 years ago

Hi,

I wonder if you can help.

I have been successfully running electrumx on both testnet and mainnet but after some successful logs and syncing I get some permission denied errors.

I will place the logs here, can you help, I am not seeing specifically from the logs what the issue could be.

The DB directory seems to have all the relevant permissions, if I blow away the DB direct contents, it seems to start working again but eventually stopping..

lrwxrwxrwx 1 root root 41 Jun 30 11:30 /var/lib/electrumx

I am not running it inside of docker but an install on a machine..

Here is the config envs.

# REQUIRED
DB_DIRECTORY = /var/lib/electrumx

# Bitcoin Node RPC Credentials
DAEMON_URL =### REDACTED ####

COIN = BitcoinSV
NET = mainnet

DB_ENGINE = leveldb
EVENT_LOOP_POLICY = uvloop

# See http://electrumx.readthedocs.io/en/latest/environment.html for
# information about other configuration settings you probably want to consider.

SSL_CERTFILE = /etc/electrumx/server.crt
SSL_KEYFILE = /etc/electrumx/server.key

SERVICES = tcp://:50001,ssl://:50002,wss://:50004,rpc://

# Listen on all interfaces:
HOST=

LOG_LEVEL = debug
COST_HARD_LIMIT = 0

Here are the logs.

Jul 19 14:57:26 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:MemPool:beginning processing of daemon mempool.  This can take some time...
Jul 19 14:57:29 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:DB:header merkle cache populated in 2.9s
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:max session count: 674
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:session timeout: 600 seconds
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:session cost hard limit 0
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:session cost soft limit 1,000
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:bandwidth unit cost 5,000
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:request sleep 2,500ms
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:request timeout 30s
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:initial concurrent 10
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:max response size 1,000,000 bytes
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:MemPool:synced in 62.31s
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:MemPool:27,136 txs 4080.36 MB touching 417,005 addresses
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:TCP server listening on all_interfaces:50001
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:stopping servers
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:closing down server for tcp://all_interfaces:50001
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:closing down server for rpc://localhost:8000
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:closing connections...
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:SessionManager:connections closed
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:BlockProcessor:prefetcher stopped
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:BlockProcessor:flushing to DB for a clean shutdown...
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:BlockProcessor:flushed cleanly
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:Controller:shutting down
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: INFO:Controller:shutdown complete
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: ERROR:electrumx:ElectrumX server terminated abnormally
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: Traceback (most recent call last):
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/opt/electrumx/electrumx_server", line 35, in main
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     asyncio.run(controller.run())
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     return loop.run_until_complete(main)
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "uvloop/loop.pyx", line 1501, in uvloop.loop.Loop.run_until_complete
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/lib/server_base.py", line 125, in run
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     await server_task
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/lib/server_base.py", line 98, in serve
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     await self.serve(shutdown_event)
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/server/controller.py", line 143, in serve
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     task.result()
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/server/session.py", line 605, in serve
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     await self._start_external_servers()
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/server/session.py", line 191, in _start_external_servers
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     await self._start_servers(service for service in self.env.services
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/server/session.py", line 164, in _start_servers
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     sslc = self._ssl_context()
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:   File "/usr/local/lib/python3.10/dist-packages/electrumX-1.20.2-py3.10.egg/electrumx/server/session.py", line 157, in _ssl_context
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]:     self._sslc.load_cert_chain(self.env.ssl_certfile, keyfile=self.env.ssl_keyfile)
Jul 19 14:58:28 bsv-prod-electrumx-ams3-01 electrumx_server[270480]: PermissionError: [Errno 13] Permission denied
Jul 19 14:58:29 bsv-prod-electrumx-ams3-01 systemd[1]: electrumx.service: Deactivated successfully.
Jul 19 14:58:29 bsv-prod-electrumx-ams3-01 systemd[1]: electrumx.service: Consumed 1h 22min 42.902s CPU time.
Jul 19 14:58:30 bsv-prod-electrumx-ams3-01 systemd[1]: electrumx.service: Scheduled restart job, restart counter is at 1.
Jul 19 14:58:30 bsv-prod-electrumx-ams3-01 systemd[1]: Stopped ElectrumX.
Jul 19 14:58:30 bsv-prod-electrumx-ams3-01 systemd[1]: electrumx.service: Consumed 1h 22min 42.902s CPU time.
iangregsondev commented 2 years ago

I am running this as part of a service.

[Unit]
Description=ElectrumX
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=2

[Service]
EnvironmentFile=/etc/electrumx/electrumx.conf
ExecStart=/opt/electrumx/electrumx_server
User=electrumx
CohibAA commented 1 year ago

Hello, were you been able to resolve this issue? I'm having the same, or a similar issue with SSL permission denied, and looking for some direction. Thanks.

justinvforvendetta commented 3 months ago

@CohibAA did you resolve this? im having a perm issue after over a year of up and running