Table missing after update to latest docker release

Cut to the chase
{
    "reqId": "wWvtzUhXpL6lgantE4Ov",
    "level": 3,
    "time": "2023-10-17T10:04:46+00:00",
    "remoteAddr": "xxxxxxxxxxxxxxxx",
    "user": "xxxxxxxx",
    "app": "index",
    "method": "POST",
    "url": "/login/challenge/totp?redirect_url=/apps/tasks/",
    "message": "An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation \"oc_ratelimit_entries\" does not exist\nLINE 1: DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= $...\n                    ^",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0",
    "version": "27.1.2.1",
    "exception": {
        "Exception": "OC\\DB\\Exceptions\\DbalException",
        "Message": "An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation \"oc_ratelimit_entries\" does not exist\nLINE 1: DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= $...\n                    ^",
        "Code": 7,
        "Trace": [
            {
                "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                "line": 328,
                "function": "wrap",
                "class": "OC\\DB\\Exceptions\\DbalException",
                "type": "::",
                "args": [
                    [
                        "Doctrine\\DBAL\\Exception\\TableNotFoundException"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                "line": 81,
                "function": "executeStatement",
                "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                "type": "->",
                "args": [

                ]
            },
            {
                "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                "line": 103,
                "function": "getExistingAttemptCount",
                "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                "type": "->",
                "args": [
                    "54630d648100110216232202d9c8a2ad864568d86b8e2e58349f8e506c9ff59188a9a9ba28064f4461d025cb6bec56798b6f9aa3a3f17855de965fb5d8645bc3"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                "line": 56,
                "function": "getAttempts",
                "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                "type": "->",
                "args": [
                    "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                    "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                "line": 97,
                "function": "register",
                "class": "OC\\Security\\RateLimiting\\Limiter",
                "type": "->",
                "args": [
                    "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                    "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd",
                    100,
                    5
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php",
                "line": 88,
                "function": "registerUserRequest",
                "class": "OC\\Security\\RateLimiting\\Limiter",
                "type": "->",
                "args": [
                    "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                    5,
                    100,
                    [
                        "OC\\User\\User"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
                "line": 96,
                "function": "beforeController",
                "class": "OC\\AppFramework\\Middleware\\Security\\RateLimitingMiddleware",
                "type": "->",
                "args": [
                    [
                        "OC\\Core\\Controller\\TwoFactorChallengeController"
                    ],
                    "solveChallenge"
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 129,
                "function": "beforeController",
                "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
                "type": "->",
                "args": [
                    [
                        "OC\\Core\\Controller\\TwoFactorChallengeController"
                    ],
                    "solveChallenge"
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/App.php",
                "line": 183,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    [
                        "OC\\Core\\Controller\\TwoFactorChallengeController"
                    ],
                    "solveChallenge"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Route/Router.php",
                "line": 315,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OC\\Core\\Controller\\TwoFactorChallengeController",
                    "solveChallenge",
                    [
                        "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    ],
                    [
                        "totp",
                        "core.TwoFactorChallenge.solveChallenge"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/base.php",
                "line": 1068,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/login/challenge/totp"
                ]
            },
            {
                "file": "/var/www/html/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": [

                ]
            }
        ],
        "File": "/var/www/html/lib/private/DB/Exceptions/DbalException.php",
        "Line": 71,
        "Previous": {
            "Exception": "Doctrine\\DBAL\\Exception\\TableNotFoundException",
            "Message": "An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation \"oc_ratelimit_entries\" does not exist\nLINE 1: DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= $...\n                    ^",
            "Code": 7,
            "Trace": [
                {
                    "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1814,
                    "function": "convert",
                    "class": "Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter",
                    "type": "->",
                    "args": [
                        [
                            "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                        ],
                        [
                            "Doctrine\\DBAL\\Query"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1749,
                    "function": "handleDriverException",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->",
                    "args": [
                        [
                            "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                        ],
                        [
                            "Doctrine\\DBAL\\Query"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1163,
                    "function": "convertExceptionDuringQuery",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->",
                    "args": [
                        [
                            "Doctrine\\DBAL\\Driver\\PDO\\Exception"
                        ],
                        "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= ?",
                        [
                            [
                                "DateTime"
                            ]
                        ],
                        [
                            "datetime"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/DB/Connection.php",
                    "line": 295,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->",
                    "args": [
                        "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= ?",
                        [
                            [
                                "DateTime"
                            ]
                        ],
                        [
                            "datetime"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                    "line": 354,
                    "function": "executeStatement",
                    "class": "OC\\DB\\Connection",
                    "type": "->",
                    "args": [
                        "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= :dcValue1",
                        [
                            [
                                "DateTime"
                            ]
                        ],
                        [
                            "datetime"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                    "line": 280,
                    "function": "execute",
                    "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
                    "type": "->",
                    "args": [

                    ]
                },
                {
                    "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                    "line": 326,
                    "function": "execute",
                    "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                    "type": "->",
                    "args": [

                    ]
                },
                {
                    "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                    "line": 81,
                    "function": "executeStatement",
                    "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                    "type": "->",
                    "args": [

                    ]
                },
                {
                    "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                    "line": 103,
                    "function": "getExistingAttemptCount",
                    "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                    "type": "->",
                    "args": [
                        "54630d648100110216232202d9c8a2ad864568d86b8e2e58349f8e506c9ff59188a9a9ba28064f4461d025cb6bec56798b6f9aa3a3f17855de965fb5d8645bc3"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                    "line": 56,
                    "function": "getAttempts",
                    "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                    "type": "->",
                    "args": [
                        "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                        "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                    "line": 97,
                    "function": "register",
                    "class": "OC\\Security\\RateLimiting\\Limiter",
                    "type": "->",
                    "args": [
                        "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                        "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd",
                        100,
                        5
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php",
                    "line": 88,
                    "function": "registerUserRequest",
                    "class": "OC\\Security\\RateLimiting\\Limiter",
                    "type": "->",
                    "args": [
                        "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                        5,
                        100,
                        [
                            "OC\\User\\User"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
                    "line": 96,
                    "function": "beforeController",
                    "class": "OC\\AppFramework\\Middleware\\Security\\RateLimitingMiddleware",
                    "type": "->",
                    "args": [
                        [
                            "OC\\Core\\Controller\\TwoFactorChallengeController"
                        ],
                        "solveChallenge"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 129,
                    "function": "beforeController",
                    "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
                    "type": "->",
                    "args": [
                        [
                            "OC\\Core\\Controller\\TwoFactorChallengeController"
                        ],
                        "solveChallenge"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/AppFramework/App.php",
                    "line": 183,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->",
                    "args": [
                        [
                            "OC\\Core\\Controller\\TwoFactorChallengeController"
                        ],
                        "solveChallenge"
                    ]
                },
                {
                    "file": "/var/www/html/lib/private/Route/Router.php",
                    "line": 315,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::",
                    "args": [
                        "OC\\Core\\Controller\\TwoFactorChallengeController",
                        "solveChallenge",
                        [
                            "OC\\AppFramework\\DependencyInjection\\DIContainer"
                        ],
                        [
                            "totp",
                            "core.TwoFactorChallenge.solveChallenge"
                        ]
                    ]
                },
                {
                    "file": "/var/www/html/lib/base.php",
                    "line": 1068,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->",
                    "args": [
                        "/login/challenge/totp"
                    ]
                },
                {
                    "file": "/var/www/html/index.php",
                    "line": 36,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::",
                    "args": [

                    ]
                }
            ],
            "File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php",
            "Line": 75,
            "Previous": {
                "Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                "Message": "SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation \"oc_ratelimit_entries\" does not exist\nLINE 1: DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= $...\n                    ^",
                "Code": 7,
                "Trace": [
                    {
                        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                        "line": 103,
                        "function": "new",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                        "type": "::",
                        "args": [
                            [
                                "PDOException",
                                [
                                    "42P01",
                                    7,
                                    "ERROR:  relation \"oc_ratelimit_entries\" does not exist\nLINE 1: DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= $...\n                   ^"
                                ]
                            ]
                        ]
                    },
                    {
                        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
                        "line": 1153,
                        "function": "execute",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
                        "type": "->",
                        "args": [

                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/DB/Connection.php",
                        "line": 295,
                        "function": "executeStatement",
                        "class": "Doctrine\\DBAL\\Connection",
                        "type": "->",
                        "args": [
                            "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= ?",
                            [
                                [
                                    "DateTime"
                                ]
                            ],
                            [
                                "datetime"
                            ]
                        ]
                    },
                    {
                        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                        "line": 354,
                        "function": "executeStatement",
                        "class": "OC\\DB\\Connection",
                        "type": "->",
                        "args": [
                            "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= :dcValue1",
                            [
                                [
                                    "DateTime"
                                ]
                            ],
                            [
                                "datetime"
                            ]
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                        "line": 280,
                        "function": "execute",
                        "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
                        "type": "->",
                        "args": [

                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                        "line": 326,
                        "function": "execute",
                        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                        "type": "->",
                        "args": [

                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                        "line": 81,
                        "function": "executeStatement",
                        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                        "type": "->",
                        "args": [

                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                        "line": 103,
                        "function": "getExistingAttemptCount",
                        "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                        "type": "->",
                        "args": [
                            "54630d648100110216232202d9c8a2ad864568d86b8e2e58349f8e506c9ff59188a9a9ba28064f4461d025cb6bec56798b6f9aa3a3f17855de965fb5d8645bc3"
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                        "line": 56,
                        "function": "getAttempts",
                        "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                        "type": "->",
                        "args": [
                            "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                            "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd"
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                        "line": 97,
                        "function": "register",
                        "class": "OC\\Security\\RateLimiting\\Limiter",
                        "type": "->",
                        "args": [
                            "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                            "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd",
                            100,
                            5
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php",
                        "line": 88,
                        "function": "registerUserRequest",
                        "class": "OC\\Security\\RateLimiting\\Limiter",
                        "type": "->",
                        "args": [
                            "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                            5,
                            100,
                            [
                                "OC\\User\\User"
                            ]
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
                        "line": 96,
                        "function": "beforeController",
                        "class": "OC\\AppFramework\\Middleware\\Security\\RateLimitingMiddleware",
                        "type": "->",
                        "args": [
                            [
                                "OC\\Core\\Controller\\TwoFactorChallengeController"
                            ],
                            "solveChallenge"
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                        "line": 129,
                        "function": "beforeController",
                        "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
                        "type": "->",
                        "args": [
                            [
                                "OC\\Core\\Controller\\TwoFactorChallengeController"
                            ],
                            "solveChallenge"
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/AppFramework/App.php",
                        "line": 183,
                        "function": "dispatch",
                        "class": "OC\\AppFramework\\Http\\Dispatcher",
                        "type": "->",
                        "args": [
                            [
                                "OC\\Core\\Controller\\TwoFactorChallengeController"
                            ],
                            "solveChallenge"
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/private/Route/Router.php",
                        "line": 315,
                        "function": "main",
                        "class": "OC\\AppFramework\\App",
                        "type": "::",
                        "args": [
                            "OC\\Core\\Controller\\TwoFactorChallengeController",
                            "solveChallenge",
                            [
                                "OC\\AppFramework\\DependencyInjection\\DIContainer"
                            ],
                            [
                                "totp",
                                "core.TwoFactorChallenge.solveChallenge"
                            ]
                        ]
                    },
                    {
                        "file": "/var/www/html/lib/base.php",
                        "line": 1068,
                        "function": "match",
                        "class": "OC\\Route\\Router",
                        "type": "->",
                        "args": [
                            "/login/challenge/totp"
                        ]
                    },
                    {
                        "file": "/var/www/html/index.php",
                        "line": 36,
                        "function": "handleRequest",
                        "class": "OC",
                        "type": "::",
                        "args": [

                        ]
                    }
                ],
                "File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
                "Line": 30,
                "Previous": {
                    "Exception": "PDOException",
                    "Message": "SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation \"oc_ratelimit_entries\" does not exist\nLINE 1: DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= $...\n                    ^",
                    "Code": "42P01",
                    "Trace": [
                        {
                            "file": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                            "line": 101,
                            "function": "execute",
                            "class": "PDOStatement",
                            "type": "->",
                            "args": [
                                null
                            ]
                        },
                        {
                            "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
                            "line": 1153,
                            "function": "execute",
                            "class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
                            "type": "->",
                            "args": [

                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/DB/Connection.php",
                            "line": 295,
                            "function": "executeStatement",
                            "class": "Doctrine\\DBAL\\Connection",
                            "type": "->",
                            "args": [
                                "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= ?",
                                [
                                    [
                                        "DateTime"
                                    ]
                                ],
                                [
                                    "datetime"
                                ]
                            ]
                        },
                        {
                            "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
                            "line": 354,
                            "function": "executeStatement",
                            "class": "OC\\DB\\Connection",
                            "type": "->",
                            "args": [
                                "DELETE FROM \"oc_ratelimit_entries\" WHERE \"delete_after\" <= :dcValue1",
                                [
                                    [
                                        "DateTime"
                                    ]
                                ],
                                [
                                    "datetime"
                                ]
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                            "line": 280,
                            "function": "execute",
                            "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
                            "type": "->",
                            "args": [

                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
                            "line": 326,
                            "function": "execute",
                            "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                            "type": "->",
                            "args": [

                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                            "line": 81,
                            "function": "executeStatement",
                            "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
                            "type": "->",
                            "args": [

                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/Security/RateLimiting/Backend/DatabaseBackend.php",
                            "line": 103,
                            "function": "getExistingAttemptCount",
                            "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                            "type": "->",
                            "args": [
                                "54630d648100110216232202d9c8a2ad864568d86b8e2e58349f8e506c9ff59188a9a9ba28064f4461d025cb6bec56798b6f9aa3a3f17855de965fb5d8645bc3"
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                            "line": 56,
                            "function": "getAttempts",
                            "class": "OC\\Security\\RateLimiting\\Backend\\DatabaseBackend",
                            "type": "->",
                            "args": [
                                "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                                "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd"
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/Security/RateLimiting/Limiter.php",
                            "line": 97,
                            "function": "register",
                            "class": "OC\\Security\\RateLimiting\\Limiter",
                            "type": "->",
                            "args": [
                                "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                                "ea6d5985c5489f16ae5006f0705bddb5211e1f505e82ba1d8c6e039047db7df2b0bf7b32819dd2496b4eaf71794e643858baefe7a67bb992b9e9afef377b5ebd",
                                100,
                                5
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php",
                            "line": 88,
                            "function": "registerUserRequest",
                            "class": "OC\\Security\\RateLimiting\\Limiter",
                            "type": "->",
                            "args": [
                                "OC\\Core\\Controller\\TwoFactorChallengeController::solveChallenge",
                                5,
                                100,
                                [
                                    "OC\\User\\User"
                                ]
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
                            "line": 96,
                            "function": "beforeController",
                            "class": "OC\\AppFramework\\Middleware\\Security\\RateLimitingMiddleware",
                            "type": "->",
                            "args": [
                                [
                                    "OC\\Core\\Controller\\TwoFactorChallengeController"
                                ],
                                "solveChallenge"
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                            "line": 129,
                            "function": "beforeController",
                            "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
                            "type": "->",
                            "args": [
                                [
                                    "OC\\Core\\Controller\\TwoFactorChallengeController"
                                ],
                                "solveChallenge"
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/AppFramework/App.php",
                            "line": 183,
                            "function": "dispatch",
                            "class": "OC\\AppFramework\\Http\\Dispatcher",
                            "type": "->",
                            "args": [
                                [
                                    "OC\\Core\\Controller\\TwoFactorChallengeController"
                                ],
                                "solveChallenge"
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/private/Route/Router.php",
                            "line": 315,
                            "function": "main",
                            "class": "OC\\AppFramework\\App",
                            "type": "::",
                            "args": [
                                "OC\\Core\\Controller\\TwoFactorChallengeController",
                                "solveChallenge",
                                [
                                    "OC\\AppFramework\\DependencyInjection\\DIContainer"
                                ],
                                [
                                    "totp",
                                    "core.TwoFactorChallenge.solveChallenge"
                                ]
                            ]
                        },
                        {
                            "file": "/var/www/html/lib/base.php",
                            "line": 1068,
                            "function": "match",
                            "class": "OC\\Route\\Router",
                            "type": "->",
                            "args": [
                                "/login/challenge/totp"
                            ]
                        },
                        {
                            "file": "/var/www/html/index.php",
                            "line": 36,
                            "function": "handleRequest",
                            "class": "OC",
                            "type": "::",
                            "args": [

                            ]
                        }
                    ],
                    "File": "/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
                    "Line": 101
                }
            }
        },
        "CustomMessage": "--"
    }
}

Nextcloud version: eg, 27.1.2Operating system and version:Docker/Arch LinuxApache or nginx version: From DockerPHP version:From Docker`

The issue you are facing:
Since the recent update from 27.0.2 to 27.1.2, it’s no longer possible to log in.
Existing sessions continue to work.

When calling /login/challenge/totp, there’s an error about oc_ratelimit_entries missing from the database.

Is this the first time you’ve seen this error? Y

Steps to replicate it:

  1. Go to login screen without an active session
  2. Enter username/password
  3. Enter MFA code

The output of your Nextcloud log in Admin > Logging:
Difficult without access to the GUI.
There’s a OC\User\NoUserException: Backends provided no user object that I wrote down earlier, which I assume belongs to a group folder in limbo.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'xxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'xxxxxxxx',
    1 => 'rockpro64',
  ),
  'trashbin_retention_obligation' => 'auto, 30',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '27.1.2.1',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'installed' => true,
  'maintenance' => false,
  'dbhost' => '172.17.0.1:5434',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxxxxxxxxxxxxxxxxxxxx',
  'theme' => '',
  'loglevel' => 0,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'xxxxxxxxxxxxxxxxxxx',
  'mail_from_address' => 'xxxxxxxxxxxxxxx',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxxxxxxxxxxxxxxxxx',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'xxxxxxxxxxx',
  'mail_smtppassword' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'mail_smtpauthtype' => 'LOGIN',
  'overwrite.cli.url' => 'https://xxxxxxxxxxxxxxxxxxxxxx',
  'app_install_overwrite' => 
  array (
    0 => 'issuetemplate',
  ),
);

The output of your Apache/nginx/system log in /var/log/____:

"GET /login/challenge/totp?redirect_url=/apps/tasks/ HTTP/2.0" 9640 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0" "-"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

The error is in the collapsible element above.

And the other tables are still there?

Hi @tflidd :slight_smile:

Yes, they are.
The sessions on my phone and laptop that are still logged in continue to work.
The Nextcloud desktop app also continues syncing.

I had a look at the migration files to see whether they might’ve had anything to do with it but I don’t see how (last migration touching the table was creating it years ago).

My family members are also using the installation so I’d prefer fixing it over starting anew.

Do you think it’s safe to just restore the table from a backup? (EDIT: the last backup is from right before the update)

You can disable temporarily the ratelimit protection:
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#user-session

If that is the only problem it should work afterwards. You can check the backup if such a table was present (and then why did is disappear)…

This is profoundly puzzling.
I did a bisect and found that the table vanished from 2022-04-20 to 2022-04-23.
2022-04-20 is on nextcloud:22.2.5, 2022-04-23 is on nextcloud:23.0.3.
So, this has nothing to do with the latest backup. It’s just that everyone was logged in and only when I got my new computer did I notice.

But it gets weirder. The backup has the table as:

CREATE TABLE public.oc_ratelimit_entries (
    hash character varying(128) NOT NULL,
    delete_after timestamp(0) without time zone NOT NULL
);

The migration clearly has an id that is missing from the database backup:

			$table->addColumn('id', Types::BIGINT, [
				'autoincrement' => true,
				'notnull' => true,
			]);

The table has been lkike that since the 2021-12-04 (no such table in the backup before that on 2021-11-18).
Maybe it ‘missed’ Add a primary key to ratelimit_entries table · nextcloud/server@fcb3e9a · GitHub somehow?

Anyway, rather than restoring the faulty table, I translated the migration file into this SQL code:

create table oc_ratelimit_entries (
  id bigserial primary key not null,
  hash character varying(128) not null,
  delete_after timestamp not null
);

create index ratelimit_hash_index on oc_ratelimit_entries(hash);
create index ratelimit_delete_after_index on oc_ratelimit_entries(delete_after);

Now I can log back in but I’m none the wiser :thinking:
No logs from that time anymore. It would be really nice to know, though :grimacing:

2 Likes

Thanks for the clarification and the workaround you found.

Not sure that even if someone told you, you would become any wiser, meaning after a lot of time spent on it, you’d find that it might be some strange coincidence. Don’t spend more time on it, you managed to fix it :+1: