OpenSMM node startup failures: Node.js, port, permissions, npm ci, mock catalog

OpenSMM node startup failures

Five typical failures when running a node from source: what you will see, why it happens, how to check and how to fix it. The output comes from real local runs.

1. Node.js older than 22.18

The node runs TypeScript directly, with no compile step. On an older Node.js the process crashes at once, and npm ci prints EBADENGINE.

text
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /path/to/mcp-server/src/adapters/inbound/gateway.ts
bash
node -v   # must be v22.18.0 or higher
bash
nvm install 22.18.0 && nvm use 22.18.0
# or with fnm:
fnm use 22.18.0

Cause: native TypeScript type stripping is available from Node.js 22.18.

2. Port in use: EADDRINUSE

The default port is 8080. If another process holds it, the node crashes with an unhandled error event.

text
Error: listen EADDRINUSE: address already in use :::8080
bash
lsof -i :8080
# or:
ss -tulpn | grep 8080
bash
PORT=8081 npm run gateway               # another port
node bin/opensmm.mjs gateway --port 0   # the OS picks a free port

To stop the process holding the port: kill $(lsof -t -i :8080). With --port 0 the node prints the chosen port on stderr.

3. State file permissions: EACCES

If OPENSMM_STATE_FILE (or --state) points somewhere you cannot write, saving the snapshot fails. If the file is not readable, the node silently starts with empty state and does not restore orders, metrics and registered nodes.

text
Error: EACCES: permission denied, open '/root/.opensmm-state.json.tmp-1244552'
bash
ls -la "$OPENSMM_STATE_FILE"
ls -la "$(dirname "$OPENSMM_STATE_FILE")"
bash
touch "$OPENSMM_STATE_FILE"
chmod 600 "$OPENSMM_STATE_FILE"
chown $(id -u):$(id -g) "$OPENSMM_STATE_FILE"

The usual cause is a file or directory owned by root after an earlier Docker run. The snapshot holds provider credentials and is written with mode 0600.

4. npm ci without a network

npm ci downloads the packages from package-lock.json. Without access to the registry the install cannot finish.

text
npm error code ECONNREFUSED
npm error code ENOTFOUND
npm error code ENOTCACHED
bash
curl -I https://registry.npmjs.org
npm ping
npm config get proxy
npm config get https-proxy
bash
npm ci --prefer-offline   # if the packages are already in ~/.npm

In an isolated environment, warm the cache beforehand on a machine with internet access. In Docker, make sure the build context has network access or a local mirror.

5. Empty or fully synthetic catalog

Unless both OPENSMM_REST_V1_BASE_URL and OPENSMM_REST_V1_API_KEY are set, the node runs on the built-in mock catalog: every service has "synthetic": true, the provider is provider-alpha, and a platform filter outside the set (for example ?platform=twitter) returns {"services":[]}. Orders on mock services live in memory only and are never sent anywhere.

stderr
OpenSMM 0.1.0 gateway listening on http://localhost:8080 (REST /v0, MCP /mcp; provider: mock, mock catalog — not real supply)
bash
curl -s http://localhost:8080/v0/providers | grep '"synthetic":true'
env | grep OPENSMM_REST_V1
bash
export OPENSMM_REST_V1_BASE_URL="https://provider.example/api/v1"
export OPENSMM_REST_V1_API_KEY="your-api-key"
npm run gateway

For SMM API v2 panels, run the diagnostic first: OPENSMM_PANEL_KEY="YOUR_KEY" npm run doctor -- --url https://panel.example/api/v2. The key comes from the environment and stays out of argv. More: SMM panel and node check: doctor.

Honest limits

  1. This page retells docs/TROUBLESHOOTING.md from the mcp-server repository; the full text and output are there.
  2. The mock catalog is fixtures (synthetic: true), not real supply: a live provider is a separate step.
  3. The npm package and a public image are not published: the node is built from a repository checkout.

Node is up — take it all the way

Once the node starts, follow the step-by-step guide: verification, census and reporting your node.

Run your own node

The step-by-step guide is on the “Run a node” page; Docker and proxy setup is in the deployment guide.