[GH-ISSUE #6153] Restart Server refuses to work when Marinara was started with start-local.bat #3426

Closed
opened 2026-10-21 06:02:59 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6153

Originally assigned to: @SpicyMarinara on GitHub.

Restarting the server from Settings does nothing when Marinara was launched with start-local.bat, the "Local Build Launcher" that ships in the repo root. Instead of restarting, a red error appears saying restart is unavailable for an unmanaged server and telling you to use a platform launcher, even though you did use a launcher from the repo. Every other launcher in the tree (start.bat, start.sh, start-termux.sh) and pnpm start restart normally.

How to reproduce (try it yourself)

  1. From a source checkout at staging ac14dd704, run pnpm install then pnpm build.
  2. Start the server exactly the way start-local.bat does at its line 186. On Windows, just double click start-local.bat in the repo root and wait for it to build and print its ready banner. On any OS you can run the same thing by hand: cd packages/server, then PORT=7906 HOST=127.0.0.1 DATA_DIR=/tmp/marinara-probe node dist/index.js (any free port and any throwaway data folder). The gate is not Windows specific, so this reproduces on Linux in under a minute.
  3. Open the app at http://127.0.0.1:7906, go to Settings, Advanced, click Restart Server, and confirm.

What you'll see: a red toast reading "Restart is unavailable for an unmanaged server. Start Marinara with its platform launcher or pnpm start; restart a development watcher from its terminal." The server keeps running with the same process ID and nothing restarts. The same thing happens over the API: curl -X POST http://127.0.0.1:7906/api/admin/restart -H 'Content-Type: application/json' -d '{"confirm":true}' returns HTTP 409 with that message, and /api/health still answers 200 from the same process seconds later.

What should happen: the server restarts, the same as it does under start.bat, start.sh, start-termux.sh or pnpm start.

  1. To confirm the launcher line is the only difference: stop that process and start the same build, same port, same data directory, as node ../../scripts/run-server.mjs dist/index.js from packages/server, which is what start.bat line 406 runs. The identical restart request now returns HTTP 202 {"status":"restarting"}, the process ID changes, and the app comes back.

One note while testing: a second restart request in the same process returns a different 409 saying a restart is already scheduled, so read the error text and not just the status code.

Where it is

  • start-local.bat:185-186: cd packages\server then node dist/index.js.
  • start.bat:406, start.sh:445, start-termux.sh:711, plus the start scripts in package.json:25 and packages/server/package.json:13: all run scripts/run-server.mjs.
  • packages/server/src/routes/admin.routes.ts:81-87: the restart handler's 409 gate.
  • scripts/run-server.mjs:26: the only place that sets MARINARA_RESTART_SUPERVISOR.
  • scripts/regressions/restart-supervisor.regression.ts:89-91: the launcher check, which lists only start.sh, start.bat, start-termux.sh.

What's happening

The restart route only proceeds when MARINARA_RESTART_SUPERVISOR matches the parent process ID, which proves a supervisor is watching and can bring the server back up. Only scripts/run-server.mjs sets that variable. start-local.bat still launches node dist/index.js directly, so the variable is absent and the route returns 409. The regression lane that pins launchers to the supervisor never lists start-local.bat, so it passes and the gap stays invisible.

Suggested fix

Either bring start-local.bat in line with its siblings by changing line 186 to node ../../scripts/run-server.mjs dist/index.js, matching start.bat:406, and add start-local.bat to the launcher list in scripts/regressions/restart-supervisor.regression.ts:89 so the lane covers it. Or settle the open question at docs/development/code-cleanup-audit.md:242 and delete the file, so no launcher in the tree sits behind the gate. Either way, the regression lane would be sturdier if it derived its launcher list from the launcher scripts present in the repo root instead of a hardcoded list of three, otherwise the next launcher added is exempt from the restart contract by default.

Context

PR #5962, which closed issue #5934 (restart leaving orphaned servers), moved restart ownership to a supervisor and rewired every launcher except this one. Before that PR the route respawned itself, so Restart Server did work under start-local.bat, which makes this a small behavior regression for source checkout users. PR #6137 touched scripts/run-server.mjs, the restart supervisor regression and docs/TROUBLESHOOTING.md, but never start-local.bat or the admin route, so the behavior is unchanged. Unreleased on staging (latest release is v2.4.4). Worth noting that docs/TROUBLESHOOTING.md:243 already says direct node runs are not automatically replaced, so the rule itself is documented; this is a launcher consistency gap, not a hidden rule. Nothing shipped points users at start-local.bat (the installer and its shortcuts all target start.bat), but the file is present in every source install next to the supported launcher.

Found by an AI-assisted sweep and re-verified against staging ac14dd704 on 2026-09-13. Please verify before fixing.

Originally created by @kolacheee on GitHub (Sep 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6153 Originally assigned to: @SpicyMarinara on GitHub. Restarting the server from Settings does nothing when Marinara was launched with `start-local.bat`, the "Local Build Launcher" that ships in the repo root. Instead of restarting, a red error appears saying restart is unavailable for an unmanaged server and telling you to use a platform launcher, even though you did use a launcher from the repo. Every other launcher in the tree (start.bat, start.sh, start-termux.sh) and `pnpm start` restart normally. ## How to reproduce (try it yourself) 1. From a source checkout at staging `ac14dd704`, run `pnpm install` then `pnpm build`. 2. Start the server exactly the way `start-local.bat` does at its line 186. On Windows, just double click `start-local.bat` in the repo root and wait for it to build and print its ready banner. On any OS you can run the same thing by hand: `cd packages/server`, then `PORT=7906 HOST=127.0.0.1 DATA_DIR=/tmp/marinara-probe node dist/index.js` (any free port and any throwaway data folder). The gate is not Windows specific, so this reproduces on Linux in under a minute. 3. Open the app at `http://127.0.0.1:7906`, go to Settings, Advanced, click Restart Server, and confirm. **What you'll see:** a red toast reading "Restart is unavailable for an unmanaged server. Start Marinara with its platform launcher or pnpm start; restart a development watcher from its terminal." The server keeps running with the same process ID and nothing restarts. The same thing happens over the API: `curl -X POST http://127.0.0.1:7906/api/admin/restart -H 'Content-Type: application/json' -d '{"confirm":true}'` returns HTTP 409 with that message, and `/api/health` still answers 200 from the same process seconds later. **What should happen:** the server restarts, the same as it does under start.bat, start.sh, start-termux.sh or `pnpm start`. 4. To confirm the launcher line is the only difference: stop that process and start the same build, same port, same data directory, as `node ../../scripts/run-server.mjs dist/index.js` from `packages/server`, which is what `start.bat` line 406 runs. The identical restart request now returns HTTP 202 `{"status":"restarting"}`, the process ID changes, and the app comes back. One note while testing: a second restart request in the same process returns a different 409 saying a restart is already scheduled, so read the error text and not just the status code. ## Where it is - `start-local.bat:185-186`: `cd packages\server` then `node dist/index.js`. - `start.bat:406`, `start.sh:445`, `start-termux.sh:711`, plus the `start` scripts in `package.json:25` and `packages/server/package.json:13`: all run `scripts/run-server.mjs`. - `packages/server/src/routes/admin.routes.ts:81-87`: the restart handler's 409 gate. - `scripts/run-server.mjs:26`: the only place that sets `MARINARA_RESTART_SUPERVISOR`. - `scripts/regressions/restart-supervisor.regression.ts:89-91`: the launcher check, which lists only `start.sh`, `start.bat`, `start-termux.sh`. ## What's happening The restart route only proceeds when `MARINARA_RESTART_SUPERVISOR` matches the parent process ID, which proves a supervisor is watching and can bring the server back up. Only `scripts/run-server.mjs` sets that variable. `start-local.bat` still launches `node dist/index.js` directly, so the variable is absent and the route returns 409. The regression lane that pins launchers to the supervisor never lists `start-local.bat`, so it passes and the gap stays invisible. ## Suggested fix Either bring `start-local.bat` in line with its siblings by changing line 186 to `node ../../scripts/run-server.mjs dist/index.js`, matching `start.bat:406`, and add `start-local.bat` to the launcher list in `scripts/regressions/restart-supervisor.regression.ts:89` so the lane covers it. Or settle the open question at `docs/development/code-cleanup-audit.md:242` and delete the file, so no launcher in the tree sits behind the gate. Either way, the regression lane would be sturdier if it derived its launcher list from the launcher scripts present in the repo root instead of a hardcoded list of three, otherwise the next launcher added is exempt from the restart contract by default. ## Context PR #5962, which closed issue #5934 (restart leaving orphaned servers), moved restart ownership to a supervisor and rewired every launcher except this one. Before that PR the route respawned itself, so Restart Server did work under `start-local.bat`, which makes this a small behavior regression for source checkout users. PR #6137 touched `scripts/run-server.mjs`, the restart supervisor regression and `docs/TROUBLESHOOTING.md`, but never `start-local.bat` or the admin route, so the behavior is unchanged. Unreleased on staging (latest release is v2.4.4). Worth noting that `docs/TROUBLESHOOTING.md:243` already says direct `node` runs are not automatically replaced, so the rule itself is documented; this is a launcher consistency gap, not a hidden rule. Nothing shipped points users at `start-local.bat` (the installer and its shortcuts all target `start.bat`), but the file is present in every source install next to the supported launcher. Found by an AI-assisted sweep and re-verified against staging ac14dd704 on 2026-09-13. Please verify before fixing.
bsakaguchi 2026-10-21 06:02:59 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 13, 2026):

Codex is addressing this report on behalf of @SpicyMarinara in draft PR #6168 as part of the requested issue sweep. I will verify the reported path against staging and preserve existing behavior outside the narrow fix.

<!-- gh-comment-id:5654636218 --> @SpicyMarinara commented on GitHub (Sep 13, 2026): Codex is addressing this report on behalf of @SpicyMarinara in draft PR #6168 as part of the requested issue sweep. I will verify the reported path against staging and preserve existing behavior outside the narrow fix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3426
No description provided.