Repository navigation
fix(install): restart a microsandbox rerun cleanly and stop waiting with the logs and why - #327
Closed
adeelahmad wants to merge 1 commit into
Closed
adeelahmad wants to merge 1 commit into
adeelahmad wants to merge 1 commit into
Conversation
…ith the logs and why Running the install line again over a microsandbox install could sit at "Waiting for the web app..." forever with no output: each check was a curl with no time limit, so a port that takes the connection but never answers held it for good, and the loop only printed when it gave up. - A rerun stops the running sandbox first (a minute to close the database, then forced), waits for its port to be free, and says who holds it if not. - Each check gives up after 5 seconds; the wait is time based (LENS_WAIT). - While waiting, it shows the steps the sandbox logs, and a line a minute. - It stops at once when a step fails or the sandbox stops, and on timeout, printing the last log lines and the reason (including a port that doesn't reach a Lens that is up inside the sandbox). - run.sh logs finer steps and a "Failed (exit N): step" line on error. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C5hhPc28UXdCfRpV9qP9it
This was referenced Oct 11, 2026
Merged
Owner
Author
|
Superseded by #359, which carries this commit unchanged (rebased onto main). It adds a check that ends the wait when a part of Lens keeps stopping, and shows the log tail in the web installer. This PR will close when #359 merges. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: running the install line again over a microsandbox install (seen on a Mac) printed "Waiting for the web app..." and then nothing, forever.
After: the rerun stops the running sandbox first, starts a new one, and shows the steps the sandbox logs while it waits (installing packages, building, starting the database), with a line a minute when nothing new happens. If a step fails, the sandbox stops, or the web app doesn't answer in time, it stops waiting and prints the last lines the sandbox logged and the reason.
Motivation and Context
Each check in the wait loop was a
curlwith no time limit. A port that takes the connection but never answers (a port forward with nothing behind it yet) held that curl, and so the loop, for good. The loop also printed nothing until it gave up. Reproduced here: the old check against a port that accepts and never answers was still hanging when cut off; the new loop stops at its deadline with the logs and the reason.How:
install.sh, microsandbox: a rerun stops the runninglenssandbox (msb stop -t 60, then-f), so SurrealDB closes cleanly instead of being killed by--replaceafter 10 seconds. It then waits for the port to be free and, if something else holds it, names the process (lsof) and fails.--max-time 5, and the deadline is in seconds (LENS_WAIT, default 1800 in a microsandbox, 600 with Docker, as before). Every 10 seconds it prints new[lens]lines frommsb logs, fails at once on a[lens] Failedline or when the sandbox is not running twice in a row, and on timeout checks inside the sandbox to tell "Lens is up but the port doesn't reach it" apart from "Lens didn't start". It prints the last 40 log lines (msb logs --tailorcompose logs --tail).microsandbox/run.sh: finer steps (backend packages, web packages, web build, database), and an EXIT trap that logsFailed (exit N): <step>and stops what it started.Steps to reproduce (if appropriate):
Install with
LENS_BACKEND=microsandbox, then run the line again while Lens runs.Types of changes
!in the title)Checklist:
LENS_WAIT=8stops waiting with the reason and the sandbox's log.docs/accordingly (docs/microsandbox.md,docs/get-started.md).Done questions (AGENTS.md)
lsofis optional, used only to name what holds a port).LENS_WAITis optional, an install-time setting like the others at the top ofinstall.sh.🤖 Generated with Claude Code
https://claude.ai/code/session_01C5hhPc28UXdCfRpV9qP9it
Generated by Claude Code