8000 fix(install): start a fresh microsandbox install on its own volume when an earlier install's data is there by adeelahmad · Pull Request #358 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(install): start a fresh microsandbox install on its own volume when an earlier install's data is there - #358

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ufyh1d
Oct 11, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-ufyh1d

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: installing Lens in a microsandbox again after ~/lens was deleted (the web installer on a Mac, in this case) stopped at "Waiting for the web app..." and after 30 minutes said only "Lens didn't answer within 30 minutes".

After: that install leaves the earlier install's data volume as it is, starts on one of its own (lens-data-2, or the next free name) and comes up. It says so while installing, and how to remove the old volume.

Motivation and Context

The lens-data volume outlives the install folder, but its database opens only with the keys in that folder's .env (SurrealDB keeps the root user it was first started with). A first install writes new keys, so it mounted the old volume with keys that can't open it: the API stopped at every start (cannot open SurrealDB ... SURREAL_USER/SURREAL_PASS don't match) and install.sh waited out its 30 minutes.

How:

  • install.sh notes when it writes a new .env. Then, if msb volume ls has lens-data and it may hold a database, it picks the next free lens-data-N. A volume it can see has no database (empty, or run.sh's tools and no surreal/lens.db) is used as it is, so a first install that failed before Lens ever started keeps its downloads.
  • The choice is kept in .env as LENS_VOLUME, so later runs, .lens-sandbox, the LaunchAgent and the systemd unit use the same volume. Existing installs get LENS_VOLUME=lens-data on their next run: nothing changes for them.
  • The earlier volume is never touched. Putting the earlier .env back uses it again; msb volume rm lens-data removes it.

Steps to reproduce (if appropriate):

Install with LENS_BACKEND=microsandbox, delete the install folder, install again. The microsandbox CI job now does exactly that (with an empty lens-data-2 already there, so the "no database" branch is checked too) and checks that Lens answers, the old volume is kept, and a rerun keeps the new one.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (shellcheck and actionlint clean).
  • I added or updated tests (microsandbox job in the Install workflow).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/microsandbox.md).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: a reinstall after the folder is gone comes up instead of timing out; merged on green CI.
  • Agents: n/a, the installer runs on the host before Lens exists.
  • Zero setup: nothing new to do; the volume is picked for you.
  • Fewest clicks and keystrokes: same one line, same wizard.
  • Configurable: n/a, no new setting (LENS_VOLUME is install bookkeeping like LENS_DIR).
  • Light: no new services or downloads.
  • Private and secure: data stays local; the earlier data isn't opened, moved or deleted. No new surface.
  • Cost: n/a, no model calls.
  • User decides: the earlier data is left for the user to keep or remove; existing installs unchanged.
  • Upgrades: an existing install keeps lens-data (written to .env as LENS_VOLUME); no stored-data change.
  • Honest: docs and changelog say what it does.
  • Tests, docs and generated files updated.
  • Open standards; no new dependencies.
  • Reported with evidence. Refine later: Docker has the same gap (Compose volumes outlive the folder too); the wait itself and the web installer get the sandbox's log tail in the follow-up that takes over fix(install): restart a microsandbox rerun cleanly and stop waiting with the logs and why #327.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G7Lm1fFWPE5g9CMRUJxeSL


Generated by Claude Code

…en an earlier install's data is there

A first install (no .env yet) made new keys but mounted the lens-data volume an earlier install left behind, say after
~/lens was deleted. Its database opens only with that install's keys, so the API stopped at every start and the
install waited 30 minutes for a web app that never came up. A first install now leaves such a volume as it is and
starts on lens-data-2 (or the next free name), kept in .env as LENS_VOLUME; a volume with no database yet is used as
it is. CI deletes the install folder after an install and checks that the next one comes up.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7Lm1fFWPE5g9CMRUJxeSL
@adeelahmad adeelahmad self-assigned this Oct 11, 2026
@adeelahmad
adeelahmad merged commit 83e7b75 into main Oct 11, 2026
16 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-ufyh1d branch October 11, 2026 13:57
adeelahmad added a commit that referenced this pull request Oct 14, 2026
…atabase to a volume of its own (#360)

A reinstall made before #358, after ~/lens was deleted, wrote new keys but kept the earlier install's lens-data
volume, and every update after it kept both: the API stopped at every start with "SURREAL_USER/SURREAL_PASS don't
match". run.sh now signs in with .env's credentials right after the database starts; on a 401 it says "Another
install's database", closes the database and stops. install.sh, seeing that line, moves Lens to a volume of its own
(kept in .env as LENS_VOLUME), rewrites .lens-sandbox and starts again, once. Keys and the earlier volume are kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M1M7EXU6uJVnqfp77L19k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0