Internal error, out of nowhere

Nextcloud version: 19.0.3
Operating system and version: Ubuntu 18
Apache
PHP version: 7.5

After a reboot, the system worked for approx half an hour and then stopped. The problem is as per error below. What could be the cause of this? Nothing should have changed. I cant identify the problem neither from below.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"y49RmiuRKJG00FByTFNT","level":3,"time":"2020-11-01T18:18:39+00:00","remoteAddr":"192.168.2.88","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\ServerNotAvailableException","Message":"Lost connection to LDAP server.","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php","line":420,"function":"processLDAPError","class":"OCA\\User_LDAP\\LDAP","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php","line":343,"function":"postFunctionCall","class":"OCA\\User_LDAP\\LDAP","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php","line":63,"function":"invokeLDAPMethod","class":"OCA\\User_LDAP\\LDAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Connection.php","line":663,"function":"bind","class":"OCA\\User_LDAP\\LDAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Connection.php","line":577,"function":"bind","class":"OCA\\User_LDAP\\Connection","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Connection.php","line":197,"function":"establishConnection","class":"OCA\\User_LDAP\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Connection.php","line":205,"function":"init","class":"OCA\\User_LDAP\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Access.php","line":1140,"function":"getConnectionResource","class":"OCA\\User_LDAP\\Connection","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Access.php","line":1323,"function":"executeSearch","class":"OCA\\User_LDAP\\Access","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Access.php","line":991,"function":"search","class":"OCA\\User_LDAP\\Access","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Access.php","line":875,"function":"searchUsers","class":"OCA\\User_LDAP\\Access","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Access.php","line":855,"function":"fetchListOfUsers","class":"OCA\\User_LDAP\\Access","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":157,"function":"fetchUsersByLoginName","class":"OCA\\User_LDAP\\Access","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/User_LDAP.php","line":120,"function":"getLDAPUserByLoginName","class":"OCA\\User_LDAP\\User_LDAP","type":"->"},{"function":"loginName2UserName","class":"OCA\\User_LDAP\\User_LDAP","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":89,"function":"call_user_func_array"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Proxy.php","line":167,"function":"walkBackends","class":"OCA\\User_LDAP\\User_Proxy","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/User_Proxy.php","line":242,"function":"handleRequest","class":"OCA\\User_LDAP\\Proxy","type":"->"},{"file":"/var/www/html/nextcloud/apps/user_ldap/lib/Helper.php","line":329,"function":"loginName2UserName","class":"OCA\\User_LDAP\\User_Proxy","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/legacy/OC_Hook.php","line":110,"function":"loginName2UserName","class":"OCA\\User_LDAP\\Helper","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/public/Util.php","line":354,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/html/nextcloud/apps/password_policy/lib/ComplianceService.php","line":91,"function":"emitHook","class":"OCP\\Util","type":"::"},{"file":"/var/www/html/nextcloud/apps/password_policy/lib/AppInfo/Application.php","line":112,"function":"entryControl","class":"OCA\\Password_Policy\\ComplianceService","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"OCA\\Password_Policy\\AppInfo\\{closure}","class":"OCA\\Password_Policy\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":98,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Server.php","line":554,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/Hooks/EmitterTrait.php","line":101,"function":"call_user_func_array"},{"file":"/var/www/html/nextcloud/lib/private/Hooks/PublicEmitter.php","line":40,"function":"emit","class":"OC\\Hooks\\BasicEmitter","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":643,"function":"emit","class":"OC\\Hooks\\PublicEmitter","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":821,"function":"loginWithToken","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/base.php","line":1055,"function":"tryTokenLogin","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/html/nextcloud/lib/base.php","line":1000,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud/apps/user_ldap/lib/LDAP.php","Line":381,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36","version":"19.0.4.2"}

Are you using LDAP?

I shouldnt be? Not to my knowledge. Could it be accidently activated and causing isssues all of a sudden?

edit: if activated, where to deactivate through SSH?

Thanks for noting this!

What I did:
sudo -u www-data php occ app:list

This listed “used_ldap”. Never used it so strange it was listed as enabled. Anyways, I ran:
sudo -u www-data php occ app:disable user_ldap
and all working again!