Login fails "You took too long to login, please try again now"

Steps to reproduce

  1. Try to login into owncloud via webpanel

System is online for ~4 month without issues or changing anything.

Expected behaviour

login successfull, access to files

Actual behaviour

Error message “You took too long to login, please try again now”

Server configuration

Debian

Web server:
apache2

Database:
MariaDB (?)

PHP version:
PHP 7

ownCloud version: (see ownCloud admin page)
10.0.6
Updated from an older ownCloud or fresh install:
Updated

Where did you install ownCloud from:

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/…

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

Do you have ownCloud on a hosted server or local?

have you tried to login again after you receive the error message?

It is a local installation on raspbian (raspberry pi debian)

yes, the error message appears again. The app for windows can also not login.

Can you try to reboot the apache server?

Restart of apache did not lead to anything but the same error.
Restart of raspberrypi lead to the following error:

Exception occurred while logging exception: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory
#0 /var/www/html/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/html/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/html/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/html/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/html/owncloud/lib/private/DB/Connection.php(145): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/html/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#6 /var/www/html/owncloud/lib/private/DB/ConnectionFactory.php(145): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#7 /var/www/html/owncloud/lib/private/Server.php(493): OC\DB\ConnectionFactory->getConnection('mysql', Array)
#8 /var/www/html/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#9 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('DatabaseConnect...')
#10 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('DatabaseConnect...')
#11 /var/www/html/owncloud/lib/private/Server.php(1160): OC\ServerContainer->query('DatabaseConnect...')
#12 /var/www/html/owncloud/lib/private/Server.php(370): OC\Server->getDatabaseConnection()
#13 /var/www/html/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#14 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('AppConfig')
#15 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppConfig')
#16 /var/www/html/owncloud/lib/private/Server.php(1089): OC\ServerContainer->query('AppConfig')
#17 /var/www/html/owncloud/lib/private/Server.php(547): OC\Server->getAppConfig()
#18 /var/www/html/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#19 /var/www/html/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('AppManager')
#20 /var/www/html/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#21 /var/www/html/owncloud/lib/private/Server.php(1359): OC\ServerContainer->query('AppManager')
#22 /var/www/html/owncloud/lib/private/legacy/app.php(346): OC\Server->getAppManager()
#23 /var/www/html/owncloud/lib/private/legacy/app.php(110): OC_App::getEnabledApps()
#24 /var/www/html/owncloud/lib/base.php(579): OC_App::loadApps(Array)
#25 /var/www/html/owncloud/lib/base.php(998): OC::init()
#26 /var/www/html/owncloud/index.php(54): require_once('/var/www/html/o...')
#27 {main}

Then I would check your database configuration

Using https instead of http resolved the same problem for me. It definitely the apache issue.

1 Like

I always get this error when trying to login using http: instead of https: .

Same here, this always happens if I don’t use HTTPS

Interesting. I would look for an open issue about that on GitHub in ownCloud repository.

I also see this message occasionally, although I always use HTTPS.

Seems there are various reasons for this to happen and quite some threads already exists about the same message:

With the following two a reinstall of the packages “worked”:

With this an update of PHP worked:

This seems to be unanswered but i just want to add a reference to it anyway:

FIXED !

I set CHMOD 777 to /var/lib/php/session and worked
Also, i didn`t had that folder, so i created it.
After that, clear cookies and works !

2 Likes

i get the error if i install the oauth2 app, when i uninstalled it it disappeared

What version of the app are you installing?

the one in the market store 0.23

Can you try the previous version?

will look for it and try