# Troubleshooting

Source: https://nodedocs.mor.org/reference/troubleshooting

## Agent Instructions

- Non-browser fetches of page URLs on this site return clean Markdown (not the JS UI). Prefer `https://nodedocs.mor.org/llms-full.txt` for the full corpus, or `https://nodedocs.mor.org/llms.txt` for the index.
- Per-page Markdown is also at `<page-url>.md` (homepage: `https://nodedocs.mor.org/index.md`).
- Docs search MCP: `https://nodedocs.mor.org/mcp` (discovery: `https://nodedocs.mor.org/.well-known/mcp`).
- Never invent contract addresses, chain IDs, token addresses, or live bid/model counts. Cite Networks and tokens; link active.mor.org for live data.
- Never claim Morpheus runs inference — independent providers do. Opening a session escrows MOR; it does not spend it.

The single most important rule: **MorpheusUI / Swagger / CLI all depend on a healthy proxy-router**. If the proxy-router is wedged or can't talk to the BASE node, none of the higher layers will work.

Tip: run the proxy-router in a foreground terminal at least once so you can see startup logs in real time. For log destinations and verbosity, see the **Logging Configuration** section of [`docs/proxy-router.all.env`](https://github.com/MorpheusAIs/Morpheus-Lumerin-Node/blob/main/docs/proxy-router.all.env).

## Healthy startup looks like

```
INFO  proxy state: running
INFO  HTTP  http server is listening: 0.0.0.0:8082
INFO  TCP   tcp server is listening: 0.0.0.0:3333
```

You can also confirm via `http://localhost:8082/swagger/index.html` (or whatever URL is set in your `.env`).

A line like this during boot is **not** a failure:

```
WARN  balance read failed, retrying (1/5) in 2s: 429 Too Many Requests …
```

The startup wallet-balance read is retried up to five times with doubling back-off (2 s → 16 s, about 30 s total) before the node gives up. It fires when the RPC endpoint throttles the boot burst — the model pre-flight issues one call per configured model against the same endpoint moments earlier. On earlier releases that first `429` exited the process and, under `Restart=always`, looped. If you see it on every start, your `ETH_NODE_ADDRESS` is the public fallback or a free tier: [set a real endpoint](/reference/env-proxy-router#blockchain).

Two more boot-time lines that are warnings, not failures:

```
WARN  cannot get provider 0x…: <rpc error>
```

The post-start provider lookup is diagnostic. It used to abort startup when the RPC call failed (for example when a retired public endpoint answered `410 Gone`), which took consumer nodes down for a check that only matters to providers. It now logs and continues; provider operators should still treat a persistent one as an RPC problem.

```
WARN  subscription error, retrying in 4s (3/30): …
```

Only with `ETH_NODE_USE_SUBSCRIPTIONS=true`. The WSS resubscribe loop backs off from 0.5 s to a 30 s cap (it previously retried in a hot loop, which got nodes rate-limited) and resumes from the block after the last event it saw.

---

## Proxy-router is not starting / crashing immediately

### Likely cause 1: `.env` misconfiguration

These four values **must** match your chain and OS. Use `proxy-router/env.main.example` as the canonical reference:

- `DIAMOND_CONTRACT_ADDRESS=`
- `MOR_TOKEN_ADDRESS=`
- `BLOCKSCOUT_API_URL=`
- `ETH_NODE_CHAIN_ID=`
- `PROXY_STORAGE_PATH=`

If running the proxy-router headless (without the UI), set:

- `WALLET_PRIVATE_KEY=` — the provider's wallet private key.

If you bring your own ETH node (Alchemy, Infura, etc.):

- Confirm `ETH_NODE_URL=` (or `ETH_NODE_ADDRESS=`) is correct for the chain.
- Recommended: HTTPS over WSS, with `ETH_NODE_USE_SUBSCRIPTIONS=false`.

Full reference: [Env: proxy-router](/reference/env-proxy-router).

### Likely cause 2: `models-config.json` misconfiguration

- `MODELS_CONFIG_PATH=` in `.env` must point to the actual file with read permissions.
- The JSON must follow [models-config.json](/reference/models-config).
- Restart the proxy-router after edits.

### Resolution

1. Fix `.env` and `models-config.json`.
2. Restart the proxy-router.
3. Watch the log for connection errors to the ETH node and the Diamond contract.

---

## Wallet shows zero MOR / ETH after recovering from mnemonic

You probably recovered at the wrong **account index**. A mnemonic import derives index 0 unless told otherwise; MetaMask "Account 2" is index `1`, and so on. Either:

- Enter the right index in MorpheusUI's import screen, or
- On MorpheusUI 7.12+, add the account from the wallet switcher — the node re-derives from the phrase it already stores via `POST /wallet/derivationPath` (`GET /wallet` shows `kind` and the active `derivationPath`), or
- Import the **private key** directly instead of the mnemonic.

A wallet imported as a raw private key (`kind: privateKey`) or supplied through `WALLET_PRIVATE_KEY` (`kind: env`) has no seed to derive from; `POST /wallet/derivationPath` returns `400` for those.

---

## Chat returns `504 provider did not respond within 30s`

The C-Node → P-Node control calls (session handshake, ping, session report, agent tools, audio upload chunks) carry a fixed 30 s read deadline. The provider accepted the TCP connection and then went silent — a wedged process or a firewall black-holing replies. Close the session and open against another provider (or pass `omitProvider` on the next open). Streaming chat is governed by `CNODE_PNODE_TIMEOUT` instead.

---

## Open session returns `409 { "existingSessionID": … }`

The caller sent `rejectExisting: true` and this wallet already has a live session for that model. Reuse the returned session, or omit `rejectExisting` if running parallel sessions is intended. MorpheusUI sets it so a double-click cannot lock stake twice.

---

## Video job: quote or submit fails

See [Video jobs](/consumers/video) for the flow. A failed submit leaves the session open. Submit again on it after the fix, or close it with `POST /blockchain/sessions/:id/close` (unused time is refunded) and open on another bid from the quote. Close only once no other job on it is still running: an early close withholds clips not delivered yet ([Close the session](/consumers/video#close-the-session)).

| What you see | Cause | Fix |
|--------------|-------|-----|
| A quote entry reads `"error": "provider advertises no video guide for this model"` | That provider's proxy-router has no video jobs (an older release; a submit to it gets `unknown method`), or it does not serve the model with a video `apiType` | Pick another bid from the quote |
| Submit returns `422` with `this job needs a 844-second session, the session is 600 seconds long`, or `… on top of the N seconds earlier jobs on it took` | The session is shorter than the job's quote plus the quotes of the jobs already on it | Open the session with `sessionDuration` at least the sum of the quotes (`session_seconds`) of the jobs you send on it |
| Submit returns `422` with `video vendor did not take the request (404)`; the provider's log shows `404 ModelNotOpen` | `byteplus-video`: the model in `modelName` is not activated for the vendor account in the BytePlus ModelArk (Ark) console. The [health probe](/providers/full/model-health) cannot see this | Provider: activate the model in the Ark console for the account that owns `apiKey` |
| Submit returns `422` with `video vendor did not take the request (401)`; the provider's `/healthcheck` shows the model `unhealthy` with `errorKind: bad_response`, `httpStatus: 401` | The vendor (`renderful` or `byteplus-video`) does not accept `apiKey` (wrong, missing or disabled) | Provider: put the right key in `models-config.json`, then call `POST /config/models/reload` |

---

## "Where is my MOR?"

Almost always: it's escrowed in the Diamond contract because of an open or recently-closed session. Walk through:

- [Sessions: stake, close, claim](/concepts/sessions-stake-close-recover)
- [Where is my MOR?](/ai/where-is-my-mor)
- [Why is my MOR locked in the contract?](/ai/why-locked-in-contract)

---

## Local model returns nonsense

The bundled `tinyllama` is a **demo** model. It will hallucinate, miscount, and contradict itself. Compare quality only against real Morpheus models. See [Local vs on-chain models](/concepts/local-vs-onchain-models).

---

## Provider-side: consumers can't connect

- Confirm `:3333` is **publicly reachable** (`telnet host 3333` from outside your network).
- Confirm `WEB_PUBLIC_URL` and the registered provider `endpoint` match your actual public host.
- Inspect provider logs — connection attempts and rejections show up there.

---

## Provider-side: TEE attestation fails on the consumer

- Confirm your model is registered with the `tee` tag.
- Confirm the consumer is on `v6.0.0+` (Phase 1) or `v7.0.0+` for full benefit.
- Recheck the SecretVM portal at https://secretai.scrtlabs.com/attestation with your compose and VM URL — all three layers must pass.
- Use `cosign verify` and `cosign verify-attestation` on your `-tee` image. See [TEE reference](/providers/full/tee-reference).

---

## "Locked files" or stale processes after Ctrl+C

- macOS / Linux:
  ```bash
  ps -ax | grep proxy-router
  kill -9 <pid>

  lsof | grep /proxy-router/data/
  kill -9 <pid>
  ```
- For Electron / MorpheusUI: `ps -ax | grep electron` and kill stragglers.

See also: [Consumer troubleshooting](/consumers/troubleshooting).
