Environment
- pg-node version: v0.4.3
- Xray-core version: 26.3.27
- OS: Linux 24.04.3 LTS (Noble Numbat) (systemd + Docker)
- Service:
pg-node-service
- Docker Compose v2 installed
Summary
The pg-node geofiles command has inconsistent and broken argument parsing behavior.
The command:
- ignores region arguments (
ru, russia, iran, etc.)
- sometimes falls back to Iran silently
- sometimes returns
Unknown option
- sometimes triggers shell autocompletion output instead of executing
- has no discoverable help or usage syntax
- behaves inconsistently between identical invocations
This makes regional geofile installation effectively unusable outside the default flow.
Expected Behavior
The command should support explicit region selection, for example:
pg-node geofiles ru
pg-node geofiles russia
pg-node geofiles iran
Expected:
- geofiles for the specified region are downloaded
- command usage/help is documented
- invalid regions return a proper validation message
- behavior is deterministic
Example expected output:
Downloading Russia geofiles...
Russia geofiles downloaded to /var/lib/pg-node/assets
Actual Behavior
Case 1 — region argument rejected
Result:
Same for:
pg-node geofiles russia
pg-node geofiles Russia
pg-node geofiles iran
pg-node geofiles RU
Case 2 — no help available
pg-node geofiles help
pg-node geofiles ?
Result:
No syntax/help output exists for the subcommand.
Case 3 — autocompletion-like output instead of execution
Running:
sometimes outputs:
completion
edit
install
renew-cert
...
instead of executing the command.
This looks like shell completion leaking into runtime execution.
Case 4 — inconsistent execution
The same command:
eventually succeeds later without any configuration changes:
No region specified, defaulting to Iran geofiles...
Downloading Iran geofiles...
Iran geofiles downloaded to /var/lib/pg-node/assets
XRAY_ASSETS_PATH updated in /opt/pg-node/.env
Restarting node services...
...
Geofiles updated and node restarted.
This inconsistency suggests unstable argument parsing or command dispatch logic.
Additional Observations
.env lookup inconsistency inside container
Container logs always show:
Failed to load env file ... open .env: no such file or directory
even though:
Environment="ENV_FILE=/opt/pg-node/.env"
is configured in systemd and the node works correctly afterward.
This may indicate:
- container process ignores
ENV_FILE
- relative
.env lookup is hardcoded
- startup warning is misleading/noisy
Relevant Logs
Successful service startup
pg-node-service listening on https://localhost:62051
API key protection enabled
TLS enabled on port 62051
Geofiles failure logs
geofiles update failed (exit code: -1): signal: killed
Container startup
Starting Node: v0.4.3
gRPC Server listening on 0.0.0.0:62050
xray started, Version: 26.3.27
Reproduction Steps
- Install/start pg-node
- Run:
- Observe:
- Run:
- Observe inconsistent behavior:
- sometimes shell-like completion output
- sometimes actual geofile installation
Impact
- Regional geofiles cannot be selected explicitly
- CLI UX is confusing and undocumented
- Automation/scripts cannot reliably use
geofiles
- Behavior appears nondeterministic
Suggested Fixes
-
Implement proper positional argument parsing for regions
-
Add:
-
Validate supported region names
-
Remove shell completion leakage into runtime execution
-
Ensure deterministic command dispatch
-
Clarify .env loading logic inside container startup
Environment
pg-node-serviceSummary
The
pg-node geofilescommand has inconsistent and broken argument parsing behavior.The command:
ru,russia,iran, etc.)Unknown optionThis makes regional geofile installation effectively unusable outside the default flow.
Expected Behavior
The command should support explicit region selection, for example:
Expected:
Example expected output:
Actual Behavior
Case 1 — region argument rejected
Result:
Same for:
Case 2 — no help available
Result:
No syntax/help output exists for the subcommand.
Case 3 — autocompletion-like output instead of execution
Running:
sometimes outputs:
instead of executing the command.
This looks like shell completion leaking into runtime execution.
Case 4 — inconsistent execution
The same command:
eventually succeeds later without any configuration changes:
No region specified, defaulting to Iran geofiles... Downloading Iran geofiles... Iran geofiles downloaded to /var/lib/pg-node/assets XRAY_ASSETS_PATH updated in /opt/pg-node/.env Restarting node services... ... Geofiles updated and node restarted.This inconsistency suggests unstable argument parsing or command dispatch logic.
Additional Observations
.envlookup inconsistency inside containerContainer logs always show:
even though:
Environment="ENV_FILE=/opt/pg-node/.env"is configured in systemd and the node works correctly afterward.
This may indicate:
ENV_FILE.envlookup is hardcodedRelevant Logs
Successful service startup
Geofiles failure logs
Container startup
Reproduction Steps
Impact
geofilesSuggested Fixes
Implement proper positional argument parsing for regions
Add:
Validate supported region names
Remove shell completion leakage into runtime execution
Ensure deterministic command dispatch
Clarify
.envloading logic inside container startup