Skip to content

hstack stack auth hangs infinitely waiting for web UI if daemon is crash-looping (Catch-22) #104

@lucharo

Description

@lucharo

Description

When setting up a self-hosted stack and running yarn service:install and yarn service:enable, the background daemon can enter a rapid crash loop if it lacks authentication credentials.

If a user then attempts to run hstack stack auth <stack-id> login, the command hangs indefinitely at:
- [/] prepare login (waiting for web UI)

Root Cause

  1. The background service crashes with:
    Error: [local] daemon auth required: credentials not found for stack
  2. Because the stack server crashes, the Expo Web UI never successfully spins up.
  3. The hstack stack auth command waits for the Web UI to be healthy before presenting the browser login link.
  4. This creates a Catch-22: The server cannot stay alive without auth, and the auth command cannot complete without the server staying alive.

Workaround

The only way out of the loop is to explicitly bypass the web UI by using the mobile QR code method:
hstack stack auth <stack-id> login --method=mobile

Suggested Fix

If the server fails to become healthy within a reasonable timeout, hstack stack auth should automatically fallback to the --method=mobile QR code generation, or clearly state the error rather than hanging infinitely waiting for a dead UI process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions