Skip to content

fix(server): remove auth from proceed-db-migration endpoint#8930

Open
jbsmith7741 wants to merge 2 commits into
apache:mainfrom
jbsmith7741:fix/auth-proceed-db-migration
Open

fix(server): remove auth from proceed-db-migration endpoint#8930
jbsmith7741 wants to merge 2 commits into
apache:mainfrom
jbsmith7741:fix/auth-proceed-db-migration

Conversation

@jbsmith7741

Copy link
Copy Markdown
Contributor

Summary

Removes auth.RequireAuth() middleware from the /proceed-db-migration endpoint. When AUTH_ENABLED=true, auth tables (e.g. auth_sessions) may not exist yet if the pending migration is the one that creates them — resulting in a bootstrap deadlock where the migration endpoint requires auth but auth requires the migration to have run.

This restores the pre-auth-hardening behavior for this endpoint, which is idempotent and only executes pending migration scripts.

Does this close any open issues?

N/A

Other Information

  • The endpoint remains idempotent (only runs pending migrations) and is typically accessed via the config-ui proxy, not exposed publicly.
  • Config-ui's "Proceed" button already calls this endpoint without authentication handling.
  • This unblocks any PR that adds new migration scripts (e.g. Jira plugin schema changes) from failing on auth-enabled deployments.

  * Auth tables may not exist when migration is pending, causing a bootstrap deadlock
  * Restores pre-auth-hardening behavior for the idempotent migration endpoint

Signed-off-by: Joshua Smith <jbsmith7741@gmail.com>
@klesh

klesh commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Can we go a different route based on whether the table exists?

@jbsmith7741

Copy link
Copy Markdown
Contributor Author

We could do a check that the table exists on every migration request, but that would add unnecessary overhead and make the process more fragile. I've added the route as a public path, as the migrations endpoint is idempotent and only triggers pending migrations—there is very little risk associated with this being public, and it resolves the issue in a clean manner.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants