Skip to content

[bug]: prime-cli installation fails with migrator timeout, subsequent repair crashes with panic #8772

@lmeinel

Description

@lmeinel

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Two issues occur during a fresh installation via prime-cli:

1. Installation aborts with migrator timeout:
The initial prime-cli setup fails with:

Setup Failed with Error
plane-migrator-1 taking too long to complete the job – check the container logs for more information

The migrator timeout appears to be too aggressive for virtualized environments. The migration itself does not fail — it simply does not complete within the hardcoded time window.

2. Subsequent prime-cli repair crashes with Go runtime panic:
After the failed installation, running prime-cli repair to recover completes the actual repair operation but crashes with an index out of range [-1] panic in the TUI rendering layer:

Caught panic:
runtime error: index out of range [-1]
Restoring terminal...
goroutine 1 [running]:
github.com/makeplane/prime-cli/cli/internal/tui/views/global.MigratorLogsView(...)
        /home/runner/work/prime-cli/prime-cli/cli/internal/tui/views/global/utility_views.go:119 +0xbb8
github.com/makeplane/prime-cli/cli/internal/tui/views/global.RenderStatus(...)
        /home/runner/work/prime-cli/prime-cli/cli/internal/tui/views/global/global_views.go:198 +0xdb4
github.com/makeplane/prime-cli/cli/internal/tui.RepairModel.View(...)
        /home/runner/work/prime-cli/prime-cli/cli/internal/tui/repair.go:154 +0x89

The panic originates at utility_views.go:119 in MigratorLogsView. The index out of range [-1] suggests slice[len(slice)-1] on an empty slice — likely because the migrator container produced no logs or had already exited before the TUI tried to render.

Despite both errors, all core services eventually come up healthy after the panic (verified via prime-cli healthcheck). The 6 services showing "Unhealthy" (email, pi-api, pi-beat, pi-db-init, pi-migrator, pi-worker) are unconfigured optional components (Plane AI and email ingestion) — unrelated to this bug.

Suggested fixes:

  • Issue 1: Make the migrator timeout configurable (e.g. prime-cli install --migrator-timeout 600) or increase the default significantly for slower environments.
  • Issue 2: Add a bounds check in MigratorLogsView before accessing the log slice:
    if len(logs) == 0 {
        return "No migrator logs available."
    }

Steps to reproduce

  1. Set up a Proxmox LXC container (Debian-based) with Docker installed
  2. Run curl -fsSL https://prime.plane.so/install/ | sh -
  3. Follow the Express installation, enter domain name
  4. Observe: installation aborts with plane-migrator-1 taking too long to complete the job
  5. Run sudo prime-cli repair
  6. Observe: repair completes but CLI crashes with the panic shown above

Environment

Production

Browser

None

Variant

Self-hosted

Version

latest

Metadata

Metadata

Assignees

Labels

planesync issues to Plane🐛bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions