Fix orchestrator registration: call missing REST endpoint, make NATS startup resilient - #3
Conversation
…startup resilient BeamCore's NATS `register` binds to an existing orchestrator row, but that row is only created by REST POST /orchestrators/register — which the orchestrator neuron never calls (only the worker self-registers over REST). A fresh hotkey therefore gets orchestrator_not_routable forever, with no path to recover. See Beam-Network#2 for the full writeup and reproduction. - Add _ensure_rest_registration(), called at the top of each start_polling() attempt, mirroring the worker's existing self-registration. - Move the NATS control handshake into a background task with unbounded retry/backoff. Previously it was awaited inline during FastAPI startup, which blocked uvicorn from binding (so BeamCore's own reachability check against our port would fail) and permanently discarded the client after 12 attempts, with no self-healing path. - Log the outgoing registration payload and the full NATS error response, since the prior truncated error hid the actual rejection reason. Verified on mainnet SN105: an orchestrator stuck at orchestrator_not_routable for 5 days registered successfully on the first attempt after this change, with no other configuration changes.
|
Hi Pedramhatef `(.venv) root@vps-~/beam/neurons/orchestrator# python main.pyBEAM ORCHESTRATOR
|
|
Hi @0x0air — thanks for testing this, and good news: NATS registration succeeding for you too confirms the fix works generally, not just for my setup. The ...yet BeamCore's own record for my worker shows 46/46 real tasks completed successfully. Root cause: those two endpoints read from So: no need for the Filed the endpoint bug separately so it doesn't get lost in this PR: #4 |
|
But my node is not active in the https://data.b1m.ai/workers/; it shows the None status |
|
@0x0air the dashboard status is the wrong place to judge this — it's a known-unreliable field (the team has acknowledged orchestrators/workers showing "disabled"/None on the dashboard while actually running fine). My own worker shows The only signal that actually matters is whether tasks are being completed. Check this directly: Look at One thing I did spot in your log: tl;dr: paste your |
Fixes #2.
BeamCore's NATS
registerbinds to an existing orchestrator row. That row is only created by RESTPOST /orchestrators/register, and the orchestrator neuron never calls it — only the worker self-registers over REST (neurons/worker/worker.py). A fresh orchestrator hotkey therefore getsorchestrator_not_routableforever, with no path to recover on stock code.Changes
neurons/orchestrator/clients/subnet_core_client.py: add_ensure_rest_registration(), called at the top of everystart_polling()attempt, mirroring the worker's existing self-registration. Also logs the outgoing registration payload and the full NATS error response (the prior truncated error hid the actual rejection reason and sent operators chasing firewall/NAT issues that were never the cause).neurons/orchestrator/core/orchestrator.py: move the NATS control handshake into a background task with unbounded retry/backoff instead of awaiting it inline during FastAPI startup. Awaiting inline blocks uvicorn from binding — but BeamCore's own reachability check needs that port answering — so a first-time registration could deadlock, and the client was permanently discarded after 12 attempts with no self-healing path.Verification
Reproduced on mainnet SN105: an orchestrator hotkey stuck at
orchestrator_not_routablefor 5 days registered successfully on its first attempt after this change, with no other configuration changes. Full repro steps and evidence (including thatorchestrator_not_routableis unrelated to network reachability — 12 of 50 live orchestrators advertise RFC1918/loopback URLs and route fine) are in #2.Happy to adjust naming/structure if you'd prefer this integrated differently — e.g. inside
WorkerManageror as part of the existing_init_subnet_core_clientretry path.