Need help with login lost access to nextcloud

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 26.0.1.1
Operating system and version (eg, Ubuntu 20.04): debian 11
Apache or nginx version (eg, Apache 2.4.25): nginx 1.18.0.6
PHP version (eg, 7.4): 8.1

The issue you are facing:

When I try to login after inputting the username and password, I get the following error:

" Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details

  • Remote Address: 192.168.39.251
  • Request ID: 1larJKnRh5WxyddCjEQs"

Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

Repooted still the same issue

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

I am unable to log in as admin. The system is set to connect using AD. I can see the following errors in the nextcloud log:

\User_LDAP\{closure}“,“class”:“OCA\User_LDAP\Access”,“type”:”->“,“args”:[”*** sensitive parameters replaced “]},{“file”:”/usr/share/nginx/nextcloud/apps/user_ldap/lib/Access.php",“line”:253,“function”:“invokeLDAPMethod”,“class”:“OCA\User_LDAP\Access”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/usr/share/nginx/nextcloud/apps/user_ldap/lib/Access.php",“line”:204,“function”:“executeRead”,“class”:“OCA\User_LDAP\Access”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_LDAP.php”,“line”:324,“function”:“readAttribute”,“class”:“OCA\User_LDAP\Access”,“type”:“->”},{“function”:“userExistsOnLDAP”,“class”:“OCA\User_LDAP\User_LDAP”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_Proxy.php”,“line”:110,“function”:“call_user_func_array”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/Proxy.php”,“line”:140,“function”:“walkBackends”,“class”:“OCA\User_LDAP\User_Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_Proxy.php”,“line”:246,“function”:“handleRequest”,“class”:“OCA\User_LDAP\Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_Proxy.php”,“line”:223,“function”:“userExistsOnLDAP”,“class”:“OCA\User_LDAP\User_Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/private/User/Manager.php”,“line”:184,“function”:“userExists”,“class”:“OCA\User_LDAP\User_Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php”,“line”:95,“function”:“get”,“class”:“OC\User\Manager”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/public/BackgroundJob/Job.php”,“line”:78,“function”:“run”,“class”:“OCA\Files_Antivirus\BackgroundJob\BackgroundScanner”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/public/BackgroundJob/TimedJob.php”,“line”:103,“function”:“start”,“class”:“OCP\BackgroundJob\Job”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/public/BackgroundJob/TimedJob.php”,“line”:93,“function”:“start”,“class”:“OCP\BackgroundJob\TimedJob”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/cron.php”,“line”:152,“function”:“execute”,“class”:“OCP\BackgroundJob\TimedJob”,“type”:“->”}],“File”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/LDAP.php”,“Line”:379,“message”:“LDAP Operations error”,“exception”:{},“CustomMessage”:“LDAP Operations error”}}
{“reqId”:“yF6xbXu3kirlWxYKLPdc”,“level”:3,“time”:“2023-05-28T12:35:18+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“files_antivirus”,“method”:“”,“url”:“–”,“message”:“LDAP Operations error”,“userAgent”:“–”,“version”:“26.0.1.1”,“exception”:{“Exception”:“Exception”,“Message”:“LDAP Operations error”,“Code”:1,“Trace”:[{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/LDAP.php”,“line”:411,“function”:“processLDAPError”,“class”:“OCA\User_LDAP\LDAP”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/LDAP.php”,“line”:308,“function”:“postFunctionCall”,“class”:“OCA\User_LDAP\LDAP”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/LDAP.php”,“line”:186,“function”:“invokeLDAPMethod”,“class”:“OCA\User_LDAP\LDAP”,“type”:“->”,“args”:["
sensitive parameters replaced “]},{“function”:“read”,“class”:“OCA\User_LDAP\LDAP”,“type”:”->“},{“file”:”/usr/share/nginx/nextcloud/apps/user_ldap/lib/Access.php",“line”:1055,“function”:“call_user_func_array”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/Access.php”,“line”:1058,“function”:“OCA\User_LDAP\{closure}”,“class”:“OCA\User_LDAP\Access”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/usr/share/nginx/nextcloud/apps/user_ldap/lib/Access.php",“line”:253,“function”:“invokeLDAPMethod”,“class”:“OCA\User_LDAP\Access”,“type”:“->”,“args”:[" sensitive parameters replaced ***“]},{“file”:”/usr/share/nginx/nextcloud/apps/user_ldap/lib/Access.php",“line”:204,“function”:“executeRead”,“class”:“OCA\User_LDAP\Access”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_LDAP.php”,“line”:324,“function”:“readAttribute”,“class”:“OCA\User_LDAP\Access”,“type”:“->”},{“function”:“userExistsOnLDAP”,“class”:“OCA\User_LDAP\User_LDAP”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_Proxy.php”,“line”:110,“function”:“call_user_func_array”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/Proxy.php”,“line”:140,“function”:“walkBackends”,“class”:“OCA\User_LDAP\User_Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_Proxy.php”,“line”:246,“function”:“handleRequest”,“class”:“OCA\User_LDAP\Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/User_Proxy.php”,“line”:223,“function”:“userExistsOnLDAP”,“class”:“OCA\User_LDAP\User_Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/private/User/Manager.php”,“line”:184,“function”:“userExists”,“class”:“OCA\User_LDAP\User_Proxy”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php”,“line”:95,“function”:“get”,“class”:“OC\User\Manager”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/public/BackgroundJob/Job.php”,“line”:78,“function”:“run”,“class”:“OCA\Files_Antivirus\BackgroundJob\BackgroundScanner”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/public/BackgroundJob/TimedJob.php”,“line”:103,“function”:“start”,“class”:“OCP\BackgroundJob\Job”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/lib/public/BackgroundJob/TimedJob.php”,“line”:93,“function”:“start”,“class”:“OCP\BackgroundJob\TimedJob”,“type”:“->”},{“file”:“/usr/share/nginx/nextcloud/cron.php”,“line”:152,“function”:“execute”,“class”:“OCP\BackgroundJob\TimedJob”,“type”:“->”}],“File”:“/usr/share/nginx/nextcloud/apps/user_ldap/lib/LDAP.php”,“Line”:379,“message”:“LDAP Operations error”,“exception”:{},“CustomMessage”:“LDAP Operations error”}}

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

PASTE HERE

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

PASTE HERE

PASTE HERE


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.

PASTE HERE

Any advice or guidance please

Can other users log in?

Try ./occ ldap:test-config (or equivalent) to see if you’re LDAP connection is working:

https://docs.nextcloud.com/server/26/admin_manual/configuration_server/occ_command.html#ldap-commands-label

Also:

  • Did this work previously? What’s changed since?
  • Please provide your config.php (redacted!)
  • Please provide a nextcloud.log entry with a reqId that matches the one in your 500 error
  • Please surround any cut-n-pasted nextcloud.log entries with the preformatted text option so that those helping you can view the entire stack trace

Hi jtr,

I tried the command and get the following:

/usr/share/nginx/nextcloud# sudo -u www-data php occ ldap:test-config
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /usr/share/nginx/nextcloud/lib/private/DB/Connection.php:142
Stack trace:
#0 /usr/share/nginx/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /usr/share/nginx/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /usr/share/nginx/nextcloud/lib/private/DB/Connection.php(264): Doctrine\DBAL\Connection->executeQuery()
#3 /usr/share/nginx/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /usr/share/nginx/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /usr/share/nginx/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /usr/share/nginx/nextcloud/lib/private/AppConfig.php(184): OC\AppConfig->loadConfigValues()
#7 /usr/share/nginx/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
#8 /usr/share/nginx/nextcloud/lib/private/legacy/OC_App.php(976): OC\AppConfig->getValues()
#9 /usr/share/nginx/nextcloud/lib/private/Server.php(729): OC_App::getAppVersions()
#10 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#11 /usr/share/nginx/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#13 /usr/share/nginx/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#14 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#15 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\AppFramework\Utility\SimpleContainer->get()
#16 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#17 /usr/share/nginx/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#18 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#19 /usr/share/nginx/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#20 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#21 /usr/share/nginx/nextcloud/lib/private/Server.php(1110): OC\AppFramework\Utility\SimpleContainer->get()
#22 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#23 /usr/share/nginx/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#24 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#25 /usr/share/nginx/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#26 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#27 /usr/share/nginx/nextcloud/lib/private/Server.php(2065): OC\AppFramework\Utility\SimpleContainer->get()
#28 /usr/share/nginx/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /usr/share/nginx/nextcloud/lib/private/Server.php(464): OC\Files\View->__construct()
#30 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#31 /usr/share/nginx/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#32 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#33 /usr/share/nginx/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#34 /usr/share/nginx/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#35 /usr/share/nginx/nextcloud/lib/private/Server.php(1467): OC\AppFramework\Utility\SimpleContainer->get()
#36 /usr/share/nginx/nextcloud/lib/base.php(623): OC\Server->boot()
#37 /usr/share/nginx/nextcloud/lib/base.php(1165): OC::init()
#38 /usr/share/nginx/nextcloud/console.php(48): require_once(‘…’)
#39 /usr/share/nginx/nextcloud/occ(11): require_once(‘…’)

Yes this did work. I made a change on the account in ad by moving it to a different OU by mistake. I moved it back now but still same thing.

Here is the config file :slight_smile:

<?php $CONFIG = array ( 'instanceid' => 'xxxxxxxxxxxxxxxxx', 'passwordsalt' => 'xxxxxxxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxxx', 'trusted_domains' => array ( 0 => 'nextcloud.mydomain.com', ), 'datadirectory' => '/usr/share/nginx/nextcloud/data', 'dbtype' => 'mysql', 'version' => '26.0.1.1', 'overwrite.cli.url' => 'https://nextcloud.mydomain.com', 'dbname' => 'nextcloud_db', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud', 'dbpassword' => 'xxxxxxxxxxxxxxxxx', 'installed' => true, 'default_phone_region' => 'GB', 'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => 'localhost', 'port' => 6379, ), 'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory', 'twofactor_enforced' => 'true', 'twofactor_enforced_groups' => array ( ), 'twofactor_enforced_excluded_groups' => array ( ), );

If I were to remove the ldap config from the config file would that allow me to login please?
‘ldapProviderFactory’ => ‘OCA\User_LDAP\LDAPProviderFactory’,
‘twofactor_enforced’ => ‘true’,
‘twofactor_enforced_groups’ =>
array (
),

That stack trace is saying that your db extension isn’t loaded in PHP. Anything change with your system lately? Maybe a PHP upgrade? Install some package updates?

dpkg -l | grep php

Will tell you what PHP versions(s) and extensions you have installed. (It’s still possible to be installed but not enabled but we’ll cross bridge when/if we get there).

Hi jtr,

I don`t believe so. Here is the printout

ii php-common 2:93+0~20230409.46+debian11~1.gbpdb4dcc all Common files for PHP packages
ii php-imagick 3.7.0-4+0~20230415.39+debian11~1.gbpbf7e27 amd64 Provides a wrapper to the ImageMagick library
ii php8.1 8.1.18-1+0~20230414.39+debian11~1.gbpad774c all server-side, HTML-embedded scripting language (metapackage)
ii php8.1-apcu 5.1.22+4.0.11-2+0~20230415.35+debian11~1.gbp2b07cb amd64 APC User Cache for PHP
ii php8.1-bcmath 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 Bcmath module for PHP
ii php8.1-bz2 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 bzip2 module for PHP
ii php8.1-cli 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 command-line interpreter for the PHP scripting language
ii php8.1-common 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 documentation, examples and common module for PHP
ii php8.1-curl 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 CURL module for PHP
ii php8.1-fpm 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php8.1-gd 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 GD module for PHP
ii php8.1-gmp 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 GMP module for PHP
ii php8.1-igbinary 3.2.13-1+0~20230207.37+debian11~1.gbp76ad09 amd64 igbinary PHP serializer
ii php8.1-imagick 3.7.0-4+0~20230415.39+debian11~1.gbpbf7e27 amd64 Provides a wrapper to the ImageMagick library
ii php8.1-imap 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 IMAP module for PHP
ii php8.1-intl 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 Internationalisation module for PHP
ii php8.1-ldap 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 LDAP module for PHP
ii php8.1-mbstring 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 MBSTRING module for PHP
ii php8.1-memcached 3.2.0+2.2.0-1+0~20221210.41+debian11~1.gbp96ecac amd64 memcached extension module for PHP, uses libmemcached
ii php8.1-msgpack 1:2.2.0~rc2-3+0~20221209.36+debian11~1.gbp2bc756 amd64 PHP extension for interfacing with MessagePack
ii php8.1-mysql 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 MySQL module for PHP
ii php8.1-opcache 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 Zend OpCache module for PHP
ii php8.1-readline 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 readline module for PHP
ii php8.1-redis 5.3.7+4.3.0-2+0~20221210.45+debian11~1.gbp99917f amd64 PHP extension for interfacing with Redis
ii php8.1-smbclient 1.0.6-7+0~20221209.23+debian11~1.gbp55ccdd amd64 PHP wrapper for libsmbclient
ii php8.1-xml 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 DOM, SimpleXML, XML, and XSL module for PHP
ii php8.1-zip 8.1.18-1+0~20230414.39+debian11~1.gbpad774c amd64 Zip module for PHP
ii php8.2-cli 8.2.5-1+0~20230414.19+debian11~1.gbpbe24a6 amd64 command-line interpreter for the PHP scripting language
ii php8.2-common 8.2.5-1+0~20230414.19+debian11~1.gbpbe24a6 amd64 documentation, examples and common module for PHP
ii php8.2-imagick 3.7.0-4+0~20230415.39+debian11~1.gbpbf7e27 amd64 Provides a wrapper to the ImageMagick library
ii php8.2-opcache 8.2.5-1+0~20230414.19+debian11~1.gbpbe24a6 amd64 Zend OpCache module for PHP
ii php8.2-phpdbg 8.2.5-1+0~20230414.19+debian11~1.gbpbe24a6 amd64 server-side, HTML-embedded scripting language (PHPDBG binary)
ii php8.2-readline 8.2.5-1+0~20230414.19+debian11~1.gbpbe24a6 amd64 readline module for PHP

Well you have two versions of PHP installed. :slight_smile:

And the 8.2 one doesn’t have many of the needed extensions for NC. I suspect it’s being used as that would explain every issue so far.

Your 8.2 install doesn’t have mysql or ldap nor many other required extensions.

If you did not intentionally install 8.2 you can remove all 8.2 packages. At that point your 8.1 PHP - which appears to be a complete installation - will be utilized.

I just removed 8.2 but still the same issue :frowning:

ok some good news. The account used to read from AD was still in the incorrect OU. I now moved it to the correct one and everything is back to normal. Thank you again to all I will mark this as fixed.

But a question to the dev if possible. In situations like this, where would the config be to be able to change the setting specially if you lost access to the interface as it will not allow you to log on anymore.