{"id":"XE-13356","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"501","source_url":"https://github.com/xeprotocol/xe/issues/501","reporter_id":14,"title":"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)","area":"ops-testnet","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:11.045999+00:00","updated_at":"2026-11-20T00:26:04.513268+00:00","source_created_at":"2026-11-12T07:24:51+00:00","told_at":"2026-11-20T00:25:10+00:00","status_changed_at":"2026-11-20T00:24:53.282387+00:00","url":"https://bounty.xe.network/XE-13356","body":"Payout address: ead8ad792b4452de17e897155ed6efe9f928d0c8b07bdf6a9cbf4f4d67941dd2\n\n**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.\n**Area:** `deploy/systemd/xe-node.service`, `deploy/systemd/xe-node.env`, `deploy/xe-node.service`, `deploy/xe-node.env.example`\n**Version:** master @ `89a542e` (unchanged since `9787859`)\n\n## Summary\n\nThe 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.\n\n| | `deploy/xe-node.service` | `deploy/systemd/xe-node.service` |\n|---|---|---|\n| `EnvironmentFile` | `/etc/xe/xe-node.env` | `/etc/xe/xe-node.env` (same path) |\n| Bootstrap peers | `--dial ${XE_BOOTSTRAP}` | `-dial ${XE_DIAL}` |\n| Genesis | `--genesis-dir ${XE_GENESIS_DIR}` | **none: no genesis flag and no `$XE_EXTRA_ARGS` to add one** |\n| Matching env file | `deploy/xe-node.env.example` (`XE_BOOTSTRAP`, `XE_GENESIS_DIR`) | `deploy/systemd/xe-node.env` (`XE_DIAL=` empty, no genesis variable) |\n\n## Effects\n\n1. **`deploy/systemd/xe-node.service` always runs the embedded placeholder genesis.** It passes no `--genesis-dir` / `--genesis`, and there is no `$XE_EXTRA_ARGS` hook to add one. Per README and `docs/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.\n2. **`deploy/systemd/xe-node.env` ships `XE_DIAL=` empty**, so even ignoring genesis the unit starts with no bootstrap peers (\"No peers and no rejections\" in the troubleshooting section).\n3. **Cross-pairing silently empties flags.** Both units read `/etc/xe/xe-node.env`. If an operator installs `deploy/xe-node.service` (the one the Deployment page and `deploy/README.md` name) but copies `deploy/systemd/xe-node.env` (the env file that actually exists under that name, while the other is only `*.example`), `XE_BOOTSTRAP` and `XE_GENESIS_DIR` are 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.\n4. The deployment docs (`test.network/docs/deployment` → Packaging) describe the unit as \"reads `/etc/xe/xe-node.env` (`deploy/xe-node.env.example` lists every knob)\", which is true for only one of the two units.\n\n## Reproduce (read-only, no node needed)\n\n```sh\ngrep -nE 'EnvironmentFile|genesis|dial' deploy/xe-node.service deploy/systemd/xe-node.service\ngrep -nE '^XE_' deploy/xe-node.env.example deploy/systemd/xe-node.env\n```\n\n`deploy/systemd/xe-node.service` has no `genesis` line, and its env file has `XE_DIAL=` and no genesis variable.\n\n## Suggested fix\n\n1. Keep one unit and one env file. Delete or merge `deploy/systemd/` into `deploy/xe-node.service`, or make both use the same variable names.\n2. Make genesis mandatory in the unit (`--genesis-dir ${XE_GENESIS_DIR}`) and add `$XE_EXTRA_ARGS` everywhere.\n3. Ship the env file with the live values (`XE_GENESIS_DIR=/etc/xe/genesis`, bootstrap multiaddrs from the README) or fail fast: an `ExecStartPre` that refuses to start when `XE_GENESIS_DIR` or the bootstrap list is empty.\n4. Optionally have `xe node` exit with a clear error when it starts on the embedded placeholder genesis without an explicit opt-in flag, since no live network uses it.\n\nRelated 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.\n","patch_refs":[{"id":557,"repo":"xeprotocol/xe","kind":"pr","ref":"504","title":"fix(deploy): unify systemd packaging and enforce genesis and bootstrap invariants (fixes #501)","url":"https://github.com/xeprotocol/xe/pull/504","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.100935+00:00"}],"thread":[{"id":13079,"source":"github","source_ref":"7026270797","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13356 and says what differs; it is read like any other.","created_at":"2026-11-20T00:25:10+00:00"}]}