8000 Fresh development setup: auth service fails during migration 0045_agent_schedules_notify_on.sql (relation "agent_schedules" does not exist) · Issue #1351 · nixopus/nixopus · GitHub
[go: up one dir, main page]

Skip to content

Fresh development setup: auth service fails during migration 0045_agent_schedules_notify_on.sql (relation "agent_schedules" does not exist) #1351

Open

Description

@vivekbhat07

Describe the bug

Following the official development setup from the Nixopus documentation, the nixopus-auth container fails to start because the database migration fails.

The auth container enters a restart loop with the following PostgreSQL error:

ERROR: relation "agent_schedules" does not exist

The failing migration is:

ALTER TABLE "agent_schedules"
ADD COLUMN IF NOT EXISTS "notify_on" text DEFAULT 'smart' NOT NULL;

Steps to reproduce

  1. Fresh clone of the repository.
  2. Copy the environment file:
cp .env.sample .env
  1. Start the development dependencies:
docker compose -f docker-compose-dev.yml up -d
  1. Check the auth container logs:
docker logs -f nixopus-auth

Expected behavior

The auth service should complete database migrations successfully and start normally.


Actual behavior

The auth container repeatedly exits because migration 0045_agent_schedules_notify_on.sql fails with:

ERROR: relation "agent_schedules" does not exist

Investigation

I performed the following checks before opening this issue:

  • Fresh clone of master
  • Followed the official setup documentation
  • Used .env generated from .env.sample
  • Removed all containers, networks and volumes using:
docker compose -f docker-compose-dev.yml down -v
  • Recreated everything from scratch
  • PostgreSQL container becomes healthy
  • Redis container becomes healthy
  • Caddy starts successfully
  • Only nixopus-auth fails during migrations

I also checked the auth repository corresponding to the image revision:

efaa7338ced0d13c8142d751defc657a73d401ff

What I found:

  • drizzle/0045_agent_schedules_notify_on.sql contains:
ALTER TABLE "agent_schedules"
ADD COLUMN IF NOT EXISTS "notify_on" text DEFAULT 'smart' NOT NULL;
  • I searched the migration history for agent_schedules:
grep -R -n "agent_schedules" drizzle

The only result is migration 0045_agent_schedules_notify_on.sql.

  • I also searched all SQL migrations:
grep -R "CREATE TABLE" drizzle

I couldn't find a migration creating agent_schedules.

  • I searched the Drizzle schema as well and couldn't find a schema definition for agent_schedules.

Because of this, I'm unsure whether:

  • there is a missing migration,
  • the migration ordering is incorrect,
  • or there is an additional setup step that I'm missing.

Environment

  • OS: Ubuntu 24.04
  • Docker: 29.1.3
  • Fresh PostgreSQL volume
  • Fresh clone of master

Activity

  1. linear commented on Jul 4, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0