Database error or migration needed #59

Open
opened 2026-05-27 20:32:26 +00:00 by Numerica · 1 comment
Contributor

This db error or missing migration is reproduced at login, and we've also seen it fail with the same error when trying to access user-related admin pages

2026-05-27T20:26:33.477119681Z 2026-05-27 20:26:33.476 UTC [20813] ERROR:  relation "user_ips" does not exist at character 523
�2026-05-27T20:26:33.477183092Z 2026-05-27 20:26:33.476 UTC [20813] STATEMENT:  SELECT a.attname, format_type(a.atttypid, a.atttypmod),
o2026-05-27T20:26:33.477197482Z 	       pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
e2026-05-27T20:26:33.477209792Z 	       c.collname, col_description(a.attrelid, a.attnum) AS comment,
@2026-05-27T20:26:33.477220632Z 	       attidentity AS identity,
D2026-05-27T20:26:33.477231722Z 	       attgenerated as attgenerated
62026-05-27T20:26:33.477242353Z 	  FROM pg_attribute a
j2026-05-27T20:26:33.477289203Z 	  LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
L2026-05-27T20:26:33.477301154Z 	  LEFT JOIN pg_type t ON a.atttypid = t.oid
z2026-05-27T20:26:33.477312164Z 	  LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
K2026-05-27T20:26:33.477323414Z 	 WHERE a.attrelid = '"user_ips"'::regclass
K2026-05-27T20:26:33.477334964Z 	   AND a.attnum > 0 AND NOT a.attisdropped
32026-05-27T20:26:33.477345904Z 	 ORDER BY a.attnum
!2026-05-27T20:26:33.477356794Z 	
2026-05-27T20:26:33.479300073Z I, [2026-05-27T20:26:33.479128 #29]  INFO -- : [00ebe1a4-0244-4846-b086-5be83741f3d1] method=POST path=/auth/sign_in format=html controller=Auth::SessionsController action=create status=500 allocations=1381 duration=14.87 view=0.00 db=8.33
x2026-05-27T20:26:33.484885224Z E, [2026-05-27T20:26:33.484684 #29] ERROR -- : [00ebe1a4-0244-4846-b086-5be83741f3d1]   
�2026-05-27T20:26:33.484950355Z [00ebe1a4-0244-4846-b086-5be83741f3d1] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "user_ips" does not exist
S2026-05-27T20:26:33.484962485Z LINE 10:  WHERE a.attrelid = '"user_ips"'::regclass
>2026-05-27T20:26:33.484972526Z                              ^
!2026-05-27T20:26:33.484981406Z )
�2026-05-27T20:26:33.484989966Z [00ebe1a4-0244-4846-b086-5be83741f3d1] Caused by: PG::UndefinedTable (ERROR:  relation "user_ips" does not exist
S2026-05-27T20:26:33.484998846Z LINE 10:  WHERE a.attrelid = '"user_ips"'::regclass
>2026-05-27T20:26:33.485007596Z                              ^
!2026-05-27T20:26:33.485015866Z )
G2026-05-27T20:26:33.485023936Z [00ebe1a4-0244-4846-b086-5be83741f3d1] 
�2026-05-27T20:26:33.485032256Z Information for: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "user_ips" does not exist
S2026-05-27T20:26:33.485040977Z LINE 10:  WHERE a.attrelid = '"user_ips"'::regclass
>2026-05-27T20:26:33.485049477Z                              ^
"2026-05-27T20:26:33.485057777Z ):
I2026-05-27T20:26:33.485065877Z [00ebe1a4-0244-4846-b086-5be83741f3d1]   
G2026-05-27T20:26:33.485105458Z [00ebe1a4-0244-4846-b086-5be83741f3d1] 
u2026-05-27T20:26:33.485114498Z Information for cause: PG::UndefinedTable (ERROR:  relation "user_ips" does not exist
S2026-05-27T20:26:33.485123228Z LINE 10:  WHERE a.attrelid = '"user_ips"'::regclass
>2026-05-27T20:26:33.485131858Z                              ^
"2026-05-27T20:26:33.485158668Z ):

in case it's lacking to rake:db:migrate it could be related to #54 in the sense that all db initialization could be better placed in the installation process

This db error or missing migration is reproduced at login, and we've also seen it fail with the same error when trying to access user-related admin pages ``` 2026-05-27T20:26:33.477119681Z 2026-05-27 20:26:33.476 UTC [20813] ERROR: relation "user_ips" does not exist at character 523 �2026-05-27T20:26:33.477183092Z 2026-05-27 20:26:33.476 UTC [20813] STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod), o2026-05-27T20:26:33.477197482Z pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, e2026-05-27T20:26:33.477209792Z c.collname, col_description(a.attrelid, a.attnum) AS comment, @2026-05-27T20:26:33.477220632Z attidentity AS identity, D2026-05-27T20:26:33.477231722Z attgenerated as attgenerated 62026-05-27T20:26:33.477242353Z FROM pg_attribute a j2026-05-27T20:26:33.477289203Z LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum L2026-05-27T20:26:33.477301154Z LEFT JOIN pg_type t ON a.atttypid = t.oid z2026-05-27T20:26:33.477312164Z LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation K2026-05-27T20:26:33.477323414Z WHERE a.attrelid = '"user_ips"'::regclass K2026-05-27T20:26:33.477334964Z AND a.attnum > 0 AND NOT a.attisdropped 32026-05-27T20:26:33.477345904Z ORDER BY a.attnum !2026-05-27T20:26:33.477356794Z 2026-05-27T20:26:33.479300073Z I, [2026-05-27T20:26:33.479128 #29] INFO -- : [00ebe1a4-0244-4846-b086-5be83741f3d1] method=POST path=/auth/sign_in format=html controller=Auth::SessionsController action=create status=500 allocations=1381 duration=14.87 view=0.00 db=8.33 x2026-05-27T20:26:33.484885224Z E, [2026-05-27T20:26:33.484684 #29] ERROR -- : [00ebe1a4-0244-4846-b086-5be83741f3d1] �2026-05-27T20:26:33.484950355Z [00ebe1a4-0244-4846-b086-5be83741f3d1] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_ips" does not exist S2026-05-27T20:26:33.484962485Z LINE 10: WHERE a.attrelid = '"user_ips"'::regclass >2026-05-27T20:26:33.484972526Z ^ !2026-05-27T20:26:33.484981406Z ) �2026-05-27T20:26:33.484989966Z [00ebe1a4-0244-4846-b086-5be83741f3d1] Caused by: PG::UndefinedTable (ERROR: relation "user_ips" does not exist S2026-05-27T20:26:33.484998846Z LINE 10: WHERE a.attrelid = '"user_ips"'::regclass >2026-05-27T20:26:33.485007596Z ^ !2026-05-27T20:26:33.485015866Z ) G2026-05-27T20:26:33.485023936Z [00ebe1a4-0244-4846-b086-5be83741f3d1] �2026-05-27T20:26:33.485032256Z Information for: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "user_ips" does not exist S2026-05-27T20:26:33.485040977Z LINE 10: WHERE a.attrelid = '"user_ips"'::regclass >2026-05-27T20:26:33.485049477Z ^ "2026-05-27T20:26:33.485057777Z ): I2026-05-27T20:26:33.485065877Z [00ebe1a4-0244-4846-b086-5be83741f3d1] G2026-05-27T20:26:33.485105458Z [00ebe1a4-0244-4846-b086-5be83741f3d1] u2026-05-27T20:26:33.485114498Z Information for cause: PG::UndefinedTable (ERROR: relation "user_ips" does not exist S2026-05-27T20:26:33.485123228Z LINE 10: WHERE a.attrelid = '"user_ips"'::regclass >2026-05-27T20:26:33.485131858Z ^ "2026-05-27T20:26:33.485158668Z ): ``` in case it's lacking to rake:db:migrate it could be related to #54 in the sense that all db initialization could be better placed in the installation process
Owner

Thanks for reporting this @Numerica ! I do remember there being some weirdness around migrations during initial deploy. I suspect you're right that #54 might be the solution, or at least part of it.

Thanks for reporting this @Numerica ! I do remember there being some weirdness around migrations during initial deploy. I suspect you're right that #54 might be the solution, or at least part of it.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coop-cloud/mastodon#59
No description provided.