deploy: the two shipped systemd units read the same /etc/xe/xe-node.env but expect different variables; deploy/systemd/xe-node.service has no genesis flag and always boots the placeholder genesis (Minor)
Report
Payout address: ead8ad792b4452de17e897155ed6efe9f928d0c8b07bdf6a9cbf4f4d67941dd2
Suggested severity: Minor (deployment packaging / docs). An operator who follows the shipped packaging ends up with a node that cannot join the live network, with no error that points at the cause.
Area: deploy/systemd/xe-node.service, deploy/systemd/xe-node.env, deploy/xe-node.service, deploy/xe-node.env.example
Version: master @ 89a542e (unchanged since 9787859)
Summary
The repo ships two systemd units that read the same environment file, /etc/xe/xe-node.env, but expect different variable names, and the env file that sits next to one of them cannot make a node join testnet-0005 at all.
deploy/xe-node.service |
deploy/systemd/xe-node.service |
|
|---|---|---|
EnvironmentFile |
/etc/xe/xe-node.env |
/etc/xe/xe-node.env (same path) |
| Bootstrap peers | --dial ${XE_BOOTSTRAP} |
-dial ${XE_DIAL} |
| Genesis | --genesis-dir ${XE_GENESIS_DIR} |
none: no genesis flag and no $XE_EXTRA_ARGS to add one |
| Matching env file | deploy/xe-node.env.example (XE_BOOTSTRAP, XE_GENESIS_DIR) |
deploy/systemd/xe-node.env (XE_DIAL= empty, no genesis variable) |
Effects
deploy/systemd/xe-node.servicealways runs the embedded placeholder genesis. It passes no--genesis-dir/--genesis, and there is no$XE_EXTRA_ARGShook to add one. Per README anddocs/run-a-node.md, a node without--genesis-dir"runs the genesis compiled into the binary instead. That one is a placeholder (network_id = "testnet") which no live network uses", and peers ban it (CANNOT JOIN NETWORK — network_id mismatch). An operator cannot fix this from the env file; they have to edit the unit.deploy/systemd/xe-node.envshipsXE_DIAL=empty, so even ignoring genesis the unit starts with no bootstrap peers ("No peers and no rejections" in the troubleshooting section).- Cross-pairing silently empties flags. Both units read
/etc/xe/xe-node.env. If an operator installsdeploy/xe-node.service(the one the Deployment page anddeploy/README.mdname) but copiesdeploy/systemd/xe-node.env(the env file that actually exists under that name, while the other is only*.example),XE_BOOTSTRAPandXE_GENESIS_DIRare undefined, so systemd expands them to empty strings:--dial "" --genesis-dir "". The result is the same: placeholder genesis, no peers. The reverse pairing loses-dial, metrics and logging settings. - The deployment docs (
test.network/docs/deployment→ Packaging) describe the unit as "reads/etc/xe/xe-node.env(deploy/xe-node.env.examplelists every knob)", which is true for only one of the two units.
Reproduce (read-only, no node needed)
grep -nE 'EnvironmentFile|genesis|dial' deploy/xe-node.service deploy/systemd/xe-node.service
grep -nE '^XE_' deploy/xe-node.env.example deploy/systemd/xe-node.env
deploy/systemd/xe-node.service has no genesis line, and its env file has XE_DIAL= and no genesis variable.
Suggested fix
- Keep one unit and one env file. Delete or merge
deploy/systemd/intodeploy/xe-node.service, or make both use the same variable names. - Make genesis mandatory in the unit (
--genesis-dir ${XE_GENESIS_DIR}) and add$XE_EXTRA_ARGSeverywhere. - Ship the env file with the live values (
XE_GENESIS_DIR=/etc/xe/genesis, bootstrap multiaddrs from the README) or fail fast: anExecStartPrethat refuses to start whenXE_GENESIS_DIRor the bootstrap list is empty. - Optionally have
xe nodeexit with a clear error when it starts on the embedded placeholder genesis without an explicit opt-in flag, since no live network uses it.
Related but different: XE-3188 (the units point at /usr/local/bin/xe-node, a binary name the build never produces). This report is about the env variables and the missing genesis flag in the same packaging.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-13356 and says what differs; it is read like any other.