Skip to content

[Bug]: Devbox Cloud "Waiting for initial setup to finish" doesn't finish #1467

Open
@mikenikles

Description

@mikenikles

Current Behavior (bug)

When I start a new workspace, the terminal is stuck on this screen:

image

Expected Behavior (fix)

Initialization ends and the workspace starts.

Additional context

Workspace: https://devbox.sh/app/projects/018a7d7e-6d00-7afa-997e-bb4494e7db76

devbox.json

{
  "packages": [
    "nodePackages.pnpm@8",
    "postgresql@14",
    "nodejs@18",
    "netcat@latest",
    "[email protected]",
    "[email protected]"
  ],
  "shell": {
    "init_hook": [
      "sh .config/devbox/init-db.sh",
      "pnpm install",
      "pnpm build",
      "cd packages/webapp && sh ./other/prepare.sh && cd -",
      "pnpm dev"
    ]
  },
  "nixpkgs": {
    "commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62"
  }
}

.config/devbox/init-db.sh

#!/bin/bash

wait_for_port() {
  echo "Waiting for port $1..."
  while ! nc -z localhost $1 </dev/null; do sleep 1; done
}

if [ ! -f "$PGDATA/PG_VERSION" ]; then
  initdb
  devbox services start
  wait_for_port 5432
  createdb howisit
  psql -d howisit -f .config/devbox/db-permissions.sql
fi

packages/webapp/other/prepare.sh

if [ ! -f ".env" ]; then
  cp .env.example .env
fi

prisma migrate dev
prisma migrate reset --force --skip-generate

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdevbox-cloudRelated to devbox.sh

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions