Commit 7b6dea9
committed
fix(boot): stop creating stub users table on metadata.create_all
Base.metadata.create_all(checkfirst=True) was creating a `users(id integer)`
table from the foreign-key stub model defined in src/models/models.py. The
users table is owned by evo-auth-service, and when the processor boots
first on a fresh install it claims the table before auth gets a chance
to run its InitSchema migration — which then silently skips its own
create_table :users because if_not_exists: true matches the stub.
Net effect: auth runs without the real users schema (no mfa_method,
no encrypted_password, no oauth_access_tokens, etc.) and every login
returns 500, which cascades as 503 in the CRM.
Fix: filter `users` (and any future cross-service tables) out of the
create_all() call. The Python `User` model stays for ForeignKey() typing,
but no DDL is emitted for it. Auth remains the sole creator of the
canonical users table.
Incident: multimport.ind.br fresh install on 2026-05-27 — every fresh
deploy of rc4 hits this because processor and auth race on first boot.1 parent e193508 commit 7b6dea9
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| |||
0 commit comments