Skip to content

fix(codespaces): make devcontainer setup fail loudly and wait for the database - #64634

Closed
miaulalala wants to merge 1 commit into
masterfrom
fix/noid/codespaces-setup-robustness
Closed

miaulalala wants to merge 1 commit into
masterfrom
fix/noid/codespaces-setup-robustness

Conversation

@miaulalala

@miaulalala miaulalala commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Reported at a developer-environment clinic: a Codespace on master comes up showing the database setup wizard instead of a finished install, with nothing in the output explaining why. .devcontainer/setup.sh had no error handling and restarts Apache unconditionally on its last line, so any failure produces a Codespace that looks like it started correctly.

  • set -euo pipefail, so a failure is reported where it happens.
  • Wait for Postgres before installing: the db service has no healthcheck and Compose only guarantees the container started, not that initdb finished, so maintenance:install could race it.
  • Verify 3rdparty is populated and that the instance reports installed: true before handing over.

The readiness probe uses PHP rather than pg_isready, because the image installs php8.4-pgsql but not postgresql-client. A separately reported 503 on stable34 is not confirmed to share this cause; this change should at least make the creation log say what is failing.

🤖 Generated with Claude Code

… database

The setup script had no error handling, so any failure left a codespace that
looked like it had started correctly. Apache is restarted unconditionally on
the last line, so the browser served the database setup wizard instead of a
working instance, with nothing in the output pointing at the real cause.

Three changes:

- set -euo pipefail, so a failure is reported where it happens instead of
  being discovered later in the browser.
- Wait for Postgres before installing. The db service has no healthcheck and
  compose only guarantees the container was started, not that initdb had
  finished, so maintenance:install could race it on a first create. The probe
  uses PHP because the image installs php8.4-pgsql but not postgresql-client,
  so pg_isready is not available.
- Verify 3rdparty is populated after the submodule update, and verify the
  instance reports installed: true before handing it over.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala
miaulalala requested a review from a team as a code owner September 21, 2026 14:21
@miaulalala
miaulalala requested review from Altahrim, come-nc, leftybournes and provokateurin and removed request for a team September 21, 2026 14:21
@miaulalala miaulalala self-assigned this Sep 21, 2026
@provokateurin

Copy link
Copy Markdown
Member

You're not following the PR template and also not the AI policy regarding human-written communication: https://github.com/nextcloud/.github/blob/master/AI_POLICY.md#human-written-communication

@miaulalala

Copy link
Copy Markdown
Contributor Author

You're not following the PR template and also not the AI policy regarding human-written communication: nextcloud/.github@master/AI_POLICY.md#human-written-communication

Sorry, this was not supposed to go live. I'll resubmit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants