meta icon indicating copy to clipboard operation
meta copied to clipboard

```FTL Failed to migrate legacy database error="pq: integer out of range" db_section=main pq_error={"code":"numeric_value_out_of_range","file":"int8.c","line":"1255","routine":"int84","severity":"ERROR"}```

Open HammyHavoc opened this issue 1 year ago • 7 comments

I can't start my Meta bridge container anymore as I get the following error:

2024-08-18T04:46:46.358Z FTL Failed to migrate legacy database error="pq: integer out of range" db_section=main pq_error={"code":"numeric_value_out_of_range","file":"int8.c","line":"1255","routine":"int84","severity":"ERROR"}

Any ideas?

HammyHavoc avatar Aug 18 '24 04:08 HammyHavoc

Check

SELECT timestamp FROM message WHERE timestamp>2000000000000;
SELECT last_read_ts FROM user_portal WHERE timestamp>2000000000000;
SELECT dispatched_at, completed_at, cooldown_until FROM message WHERE dispatched_at>2000000000000 OR completed_at>2000000000000 OR cooldown_until>2000000000000;

tulir avatar Aug 18 '24 09:08 tulir

Thanks for the fast response!

I ran these in the Query Tool of PgAdmin for the Mautrix Meta database, and I got the following:

When running SELECT timestamp FROM message WHERE timestamp>2000000000000;, I got this in the Data Output:

timestamp
bigint

When running SELECT last_read_ts FROM user_portal WHERE timestamp>2000000000000;, I get this Message:

ERROR:  column "timestamp" does not exist
LINE 1: SELECT last_read_ts FROM user_portal WHERE timestamp>2000000...
                                                   ^ 

SQL state: 42703
Character: 44

When running SELECT dispatched_at, completed_at, cooldown_until FROM message WHERE dispatched_at>2000000000000 OR completed_at>2000000000000 OR cooldown_until>2000000000000; I get this message:

SELECT dispatched_at, completed_at, cooldown_until FROM message WHERE dispatched_at>2000000000000 OR completed_at>2000000000000 OR cooldown_until>2000000000000;
ERROR:  column "dispatched_at" does not exist
LINE 1: SELECT dispatched_at, completed_at, cooldown_until FROM mess...
               ^ 

SQL state: 42703
Character: 8

Any ideas?

HammyHavoc avatar Aug 18 '24 09:08 HammyHavoc

Oops, the first one seems like a pgadmin bug, but the other two just had mistakes in the query

SELECT message.timestamp FROM message WHERE message.timestamp>2000000000000;
SELECT last_read_ts FROM user_portal WHERE last_read_ts>2000000000000;
SELECT dispatched_at, completed_at, cooldown_until FROM backfill_task WHERE dispatched_at>2000000000000 OR completed_at>2000000000000 OR cooldown_until>2000000000000;

tulir avatar Aug 18 '24 10:08 tulir

I can see the column data types for each query now, but still 0 rows returned for the query in terms of Data Output.

HammyHavoc avatar Aug 18 '24 10:08 HammyHavoc

I can't start my Meta bridge container anymore as I get the following error:

2024-08-18T04:46:46.358Z FTL Failed to migrate legacy database error="pq: integer out of range" db_section=main pq_error={"code":"numeric_value_out_of_range","file":"int8.c","line":"1255","routine":"int84","severity":"ERROR"}

Any ideas?

I have the exact same issue

Oops, the first one seems like a pgadmin bug, but the other two just had mistakes in the query

SELECT message.timestamp FROM message WHERE message.timestamp>2000000000000;
SELECT last_read_ts FROM user_portal WHERE last_read_ts>2000000000000;
SELECT dispatched_at, completed_at, cooldown_until FROM backfill_task WHERE dispatched_at>2000000000000 OR completed_at>2000000000000 OR cooldown_until>2000000000000;

All three queries returned (0 row) as result for me as well.

MrXANA91 avatar Aug 19 '24 17:08 MrXANA91

Configuration file has been tempered with in the process, noticeably :

  • database URI
  • meta mode
  • bridge username template

After reverting to v0.3.2 and restoring the configuration file, the issue no longer appears.

For context : I only had this issue with the Facebook bridge. The Instagram bridge on my server has been updated to the last version without any issue. I am using docker containers.

MrXANA91 avatar Aug 19 '24 17:08 MrXANA91

I have the same issue with my Meta bridge for Facebook/Messenger. I haven't updated it in a while, but trying to update it today resulted in the same error as OP described.

I run the bridge on a k8s cluster, however, my settings remain the same, my configmap hasn't changed.

Xinayder avatar Aug 19 '24 19:08 Xinayder

@tulir

I just ran the update SQL statement manually, but I'm still getting the same error.

ferdinandyb avatar Aug 20 '24 21:08 ferdinandyb