I suddenly became unusable due to internal error

I was using nextcloud until this morning. But it suddenly became useless.

  • Messege: An exception occurred while executing ‘SELECT uid, password FROM oc_users WHERE LOWER(uid) = LOWER(?)’ with params [“ADMIN USER NAME”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

  • Files: /NEXTCLOUD/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php

  • line: 115

    #0 /NEXTCLOUD/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
    #1 /NEXTCLOUD/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(177): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘SELECT uid, `…’, Array)
    #2 /NEXTCLOUD/lib/private/legacy/db/statementwrapper.php(71): Doctrine\DBAL\Statement->execute(Array)
    #3 /NEXTCLOUD/lib/private/User/Database.php(223): OC_DB_StatementWrapper->execute(Array)
    #4 /NEXTCLOUD/lib/private/User/Manager.php(204): OC\User\Database->checkPassword(‘ADMIN USER NAME’, ‘PASSWORD’)
    #5 /NEXTCLOUD/core/Controller/LoginController.php(254): OC\User\Manager->checkPasswordNoLogging(‘ADMIN USER NAME’, ‘PASSWORD’)
    #6 [internal function]: OC\Core\Controller\LoginController->tryLogin(‘ADMIN USER NAME’, ‘PASSWORD’, NULL, false, ‘Asia/Tokyo’, ‘9’)
    #7 /NEXTCLOUD/lib/private/AppFramework/Http/Dispatcher.php(161): call_user_func_array(Array, Array)
    #8 /NEXTCLOUD/lib/private/AppFramework/Http/Dispatcher.php(91): OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Core\Controller\LoginController), ‘tryLogin’)
    #9 /NEXTCLOUD/lib/private/AppFramework/App.php(115): OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Core\Controller\LoginController), ‘tryLogin’)
    #10 /NEXTCLOUD/lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main(‘OC\Core\Control…’, ‘tryLogin’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
    #11 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
    #12 /NEXTCLOUD/lib/private/Route/Router.php(297): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
    #13 /NEXTCLOUD/lib/base.php(998): OC\Route\Router->match(’/login’)
    #14 /NEXTCLOUD/index.php(37): OC::handleRequest()
    #15 {main}

I get a sign in page but I can not sign in.
I tried restarting the server but it did not improve.
Please tell me how to improve.

CentOS: 7.3
Nginx: 1.11.10
Nextcloud: 13.0.1

It´s a mysql problem. Make sure that your mysql server is running.
Maybe this can help:

Thank you.
I tried changing the value of wait_timeout from 15 to 30. Then we managed to connect. However, the sign-in time was very slow. When using Nextcloud, what is the reference value of wait_timeout?

I escaped from the fatal problem that I can not sign in. What is the fundamental solution to this? Is it a server failure?

Can be caused by bruteforce. Please check this:

Depends on your system :wink:

Excuse me. It was my mistake completely. On Friday night I updated to Nextcloud 13.0.1. And I made certain tests and confirmed there was no problem.

At that time, time has already passed so I changed “auth.bruteforce.protection.enabled” to valid. After changing to it, I confirmed that there was no problem. I thought that the problem was solved. The problem is that signing in will take time if I enable it. I have forgotten this in the last two days. It was just a luck luck till this morning. Once I turned this back disable, I could sign in as smoothly as before.

However, it is worrisome that before signing in was slow but the sign-in itself was possible. MySQL error did not occur like this time. After all bruteforce seems to be unusable when considering smoothness.

I will continue to use it again invalid. Thank you.

You need to flush the table (see link above with the database instruction)
and it will work smoothly as before :wink:
The app bruteforce will slow down the login for the user with the ip who
activated a bruteforce attempt. :wink:
Just flush the table :wink:

— Original Nachricht —

You need to flush the table (see link above with the database instruction)

Sorry, I do not know what link it points to.
Is that “flush tables” command? Or should I create a whitelist?
I ran the flush tables command, but it did not change.

Empty the table oc.bruteforce :wink: You can do it in phpmyadmin easily. Otherwise use the command in mysql shell.

Oh, Thank you!!:smile:
I emptied “oc_bruteforce_attempts” and I got a quick sign in with bruteforce enabled.

I appreciate your kind response.

1 Like

Glad to hear that it works now. Thank you for compliments.