Service not available - after user logs in to the web

Hello friends.

I’ve been using Nextcloud for some time. But there is a user who EVERY time he tries to log in via the web, he crashes my system. getting a SERVICE UNAVAILABLE message.
This last time, I still accessed the system via direct IP, from within the network where it is located. It worked! I logged in, browsed. and everything is ok.
I opened an anonymous window, and asked for this person’s username and password. When I logged in, SYSTEM UNAVAILABLE.
I can go a whole week without him logging in, and everything works normally. but he just logs in and everything goes down.

I’m using the newer NC. I don’t remember the version, as I don’t have access right now…

Let me know what to do to get your help.

NOTE: the NC is virtualized in a container on PROXMOX. I have a daily backup of it on PBS. Below is the configuration in the image.

image

Do you manage the users directly in Nextcloud or use external authentication backends?

If possible, please provide some logfiles, they might give a hint, perhaps the user is using external storage etc. or there is a different issue.

I’m managing users directly on nextcloud.

There is no external storage configured.
the user in question is new. his first access to the system.

what I did yesterday:
After some time, I can’t say for sure, the NC started to work. So I deleted the user that had the problem, and created another one with completely different access data.

I (his login) accessed it from my machine, on the same receipt.
I (his login) accessed my machine remotely. off the grid.
HE (his login) was accessing his machine from outside the network. And the system crashed.

TODAY.
I tried to access it on my PC and I didn’t have access.

I accessed the local machine on the internal network, and via direct IP I gained access.
I logged in with his login, and it worked via the server’s direct IP.

I have other users on the system, Wife, Daughter, and ADMIN (me) is my normal user. NONE OF THEM CAUSE THIS.

/var/log/apache2/error.log

[Mon Sep 18 00:00:06.093819 2023] [ssl:warn] [pid 1562] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 00:00:06.094459 2023] [ssl:warn] [pid 1562] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 00:00:06.094717 2023] [mpm_prefork:notice] [pid 1562] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 00:00:06.094724 2023] [core:notice] [pid 1562] AH00094: Command line: '/usr/sbin/apache2'
[Mon Sep 18 09:36:08.944874 2023] [mpm_prefork:notice] [pid 1562] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 18 09:36:41.588328 2023] [ssl:warn] [pid 268] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:36:41.665717 2023] [ssl:warn] [pid 268] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:36:47.882561 2023] [ssl:warn] [pid 414] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:36:47.883208 2023] [ssl:warn] [pid 414] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:36:47.890769 2023] [mpm_prefork:notice] [pid 414] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 09:36:47.890788 2023] [core:notice] [pid 414] AH00094: Command line: '/usr/sbin/apache2'
[Mon Sep 18 09:39:23.924817 2023] [mpm_prefork:notice] [pid 414] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 18 09:39:24.026680 2023] [ssl:warn] [pid 1200] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:39:24.027404 2023] [ssl:warn] [pid 1200] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:39:24.068467 2023] [ssl:warn] [pid 1201] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:39:24.069077 2023] [ssl:warn] [pid 1201] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:39:24.076382 2023] [mpm_prefork:notice] [pid 1201] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 09:39:24.076401 2023] [core:notice] [pid 1201] AH00094: Command line: '/usr/sbin/apache2'
[Mon Sep 18 09:43:20.242085 2023] [php:error] [pid 1207] [client 192.168.2.136:54889] PHP Fatal error:  Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:140\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\\DBAL\\Connection->getWrappedConnection()\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\\DB\\Connection->executeQuery()\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 /var/www/nextcloud/lib/private/AppConfig.php(184): OC\\AppConfig->loadConfigValues()\n#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\\AppConfig->getApps()\n#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(803): OC\\AppConfig->getValues()\n#9 /var/www/nextcloud/lib/private/Server.php(733): OC_App::getAppVersions()\n#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\Server->OC\\{closure}()\n#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#13 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#19 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#21 /var/www/nextcloud/lib/private/Server.php(1115): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\Server->OC\\{closure}()\n#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#25 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#27 /var/www/nextcloud/lib/private/Server.php(2067): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#28 /var/www/nextcloud/lib/private/Files/View.php(106): OC\\Server->getLockingProvider()\n#29 /var/www/nextcloud/lib/private/Server.php(467): OC\\Files\\View->__construct()\n#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\Server->OC\\{closure}()\n#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#33 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#35 /var/www/nextcloud/lib/private/Server.php(1469): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#36 /var/www/nextcloud/lib/base.php(638): OC\\Server->boot()\n#37 /var/www/nextcloud/lib/base.php(1180): OC::init()\n#38 /var/www/nextcloud/ocs/v1.php(31): require_once('...')\n#39 /var/www/nextcloud/ocs/v2.php(23): require_once('...')\n#40 {main}\n  thrown in /var/www/nextcloud/lib/private/DB/Connection.php on line 140
[Mon Sep 18 09:44:01.114620 2023] [php:error] [pid 1203] [client 192.168.2.136:54893] PHP Fatal error:  Uncaught Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:140\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\\DBAL\\Connection->getWrappedConnection()\n#2 /var/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\\DB\\Connection->executeQuery()\n#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 /var/www/nextcloud/lib/private/AppConfig.php(184): OC\\AppConfig->loadConfigValues()\n#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\\AppConfig->getApps()\n#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(803): OC\\AppConfig->getValues()\n#9 /var/www/nextcloud/lib/private/Server.php(733): OC_App::getAppVersions()\n#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\Server->OC\\{closure}()\n#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#13 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#19 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#21 /var/www/nextcloud/lib/private/Server.php(1115): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\Server->OC\\{closure}()\n#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#25 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#27 /var/www/nextcloud/lib/private/Server.php(2067): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#28 /var/www/nextcloud/lib/private/Files/View.php(106): OC\\Server->getLockingProvider()\n#29 /var/www/nextcloud/lib/private/Server.php(467): OC\\Files\\View->__construct()\n#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\\Server->OC\\{closure}()\n#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}()\n#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\\Container->offsetGet()\n#33 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\\AppFramework\\Utility\\SimpleContainer->query()\n#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\\ServerContainer->query()\n#35 /var/www/nextcloud/lib/private/Server.php(1469): OC\\AppFramework\\Utility\\SimpleContainer->get()\n#36 /var/www/nextcloud/lib/base.php(638): OC\\Server->boot()\n#37 /var/www/nextcloud/lib/base.php(1180): OC::init()\n#38 /var/www/nextcloud/ocs/v1.php(31): require_once('...')\n#39 /var/www/nextcloud/ocs/v2.php(23): require_once('...')\n#40 {main}\n  thrown in /var/www/nextcloud/lib/private/DB/Connection.php on line 140
[Mon Sep 18 09:44:57.788192 2023] [mpm_prefork:notice] [pid 1201] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 18 09:44:57.887054 2023] [ssl:warn] [pid 15975] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:44:57.887688 2023] [ssl:warn] [pid 15975] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:44:57.924794 2023] [ssl:warn] [pid 15976] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:44:57.925353 2023] [ssl:warn] [pid 15976] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:44:57.932172 2023] [mpm_prefork:notice] [pid 15976] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 09:44:57.932190 2023] [core:notice] [pid 15976] AH00094: Command line: '/usr/sbin/apache2'
[Mon Sep 18 09:45:48.464779 2023] [mpm_prefork:notice] [pid 15976] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 18 09:46:12.906773 2023] [ssl:warn] [pid 287] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:46:12.931116 2023] [ssl:warn] [pid 287] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:46:20.572295 2023] [ssl:warn] [pid 432] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:46:20.572975 2023] [ssl:warn] [pid 432] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:46:20.581139 2023] [mpm_prefork:notice] [pid 432] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 09:46:20.581160 2023] [core:notice] [pid 432] AH00094: Command line: '/usr/sbin/apache2'
[Mon Sep 18 09:52:57.768885 2023] [mpm_prefork:notice] [pid 432] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 18 09:52:57.875670 2023] [ssl:warn] [pid 1173] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:52:57.876339 2023] [ssl:warn] [pid 1173] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:52:57.918454 2023] [ssl:warn] [pid 1174] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:52:57.919093 2023] [ssl:warn] [pid 1174] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 09:52:57.926989 2023] [mpm_prefork:notice] [pid 1174] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 09:52:57.927008 2023] [core:notice] [pid 1174] AH00094: Command line: '/usr/sbin/apache2'
[Mon Sep 18 10:14:00.790086 2023] [mpm_prefork:notice] [pid 1174] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Sep 18 10:14:00.898477 2023] [ssl:warn] [pid 1374] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 10:14:00.899213 2023] [ssl:warn] [pid 1374] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 10:14:00.946577 2023] [ssl:warn] [pid 1375] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 10:14:00.947228 2023] [ssl:warn] [pid 1375] AH01909: localhost:12322:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 18 10:14:00.956054 2023] [mpm_prefork:notice] [pid 1375] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Sep 18 10:14:00.956075 2023] [core:notice] [pid 1375] AH00094: Command line: '/usr/sbin/apache2'

I can’t send nextcloud.log
nextcloud.log - 4MB

This corresponds to an access of this user?

However, the error looks to originate from something different, more like a server module that tracks the usage. However if there are too many connections or stuff like that it should show in the error.log I suppose…

no. This access refers to the PC on the internal network.
the user in question was previously called “renato” and after I changed it it became “cesar”.

other information.
I installed the system using the turnkey models.

Sorry for the partial information. I’m forgetful and when I remember I put it on.

MY NETWORK.

As I only have one fixed External IP in my structure, I redirect all ‘ns.vpr.digital’ traffic through a web proxy on NETHSERVER (192.168.2.1) to the IP of the machine where the NC is located (192.168.2.51)

This morning, I opened the PC and opened the browser, as it was already open the day before, it opened the website.

i.e. it recovers from the error after a while.
something like 36 hours later or a little more…

For such configurations, you need to be sure which part triggers the error. Sometimes it can be proxy services as well, also if they implement more features (rate limiting, “firewalls” etc.), then the error should be logged there.

no. what triggers the error, is precisely this login trying to enter the NC.