NCP loop after some hours working

Hello. I am very noob with NCP and I am facing a problem with my NCP. After a few hours working perfectly, the server stops working. I cannot access it either from the Internet or using Putty from windows. Curiously, when I turn the Pi off and on, everything works fine again for some hours, only to get the same problem again afterward.

When the server brokes and I connect the Pi to a TV to see what it is doing, I find that it is in a loop (or I guess it is a loop because it didn’t finish after 6 hours…) computing the following commands:

Also, I think this is the log after the loop:

`

{“reqId”:“YGbhIO22vD4cn2LD7TOjBwAAAEI”,“level”:3,“time”:“2021-04-02T09:17:20+00:00”,“remoteAddr”:“192.168.1.61”,“user”:“–”,“app”:“remote”,“method”:“GET”,“url”:“/status.php”,“message”:{“Exception”:“Doctrine\DBAL\DBALException”,“Message”:“Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php”,“line”:1449,“function”:“connect”,“class”:“OC\DB\Connection”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php”,“line”:892,“function”:“getWrappedConnection”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/DB/Connection.php”,“line”:202,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:“->”,“args”:[“SELECT * FROM oc_appconfig”,,,null]},{“file”:“/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php”,“line”:206,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:“->”,“args”:[“SELECT * FROM oc_appconfig”,,]},{“file”:“/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:217,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/AppConfig.php”,“line”:345,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/AppConfig.php”,“line”:110,“function”:“loadConfigValues”,“class”:“OC\AppConfig”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/AppConfig.php”,“line”:301,“function”:“getApps”,“class”:“OC\AppConfig”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/legacy/OC_App.php”,“line”:949,“function”:“getValues”,“class”:“OC\AppConfig”,“type”:“->”,“args”:[false,“installed_version”]},{“file”:“/var/www/nextcloud/lib/private/Server.php”,“line”:668,“function”:“getAppVersions”,“class”:“OC_App”,“type”:“::”,“args”:},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php”,“line”:155,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:“->”,“args”:[“*** sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:122,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:“->”,“args”:[“OC\Memcache\Factory”]},{“file”:“/var/www/nextcloud/lib/private/ServerContainer.php”,“line”:156,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:“->”,“args”:[“OC\Memcache\Factory”,true]},{“file”:“/var/www/nextcloud/lib/private/Server.php”,“line”:1677,“function”:“query”,“class”:“OC\ServerContainer”,“type”:“->”,“args”:[“OC\Memcache\Factory”]},{“file”:“/var/www/nextcloud/lib/private/Server.php”,“line”:1017,“function”:“getMemCacheFactory”,“class”:“OC\Server”,“type”:“->”,“args”:[]},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php”,“line”:155,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:122,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:“->”,“args”:[“OCP\Lock\ILockingProvider”]},{“file”:“/var/www/nextcloud/lib/private/ServerContainer.php”,“line”:156,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:“->”,“args”:[“OCP\Lock\ILockingProvider”,true]},{“file”:“/var/www/nextcloud/lib/private/Server.php”,“line”:1977,“function”:“query”,“class”:“OC\ServerContainer”,“type”:“->”,“args”:[“OCP\Lock\ILockingProvider”]},{“file”:“/var/www/nextcloud/lib/private/Files/View.php”,“line”:118,“function”:“getLockingProvider”,“class”:“OC\Server”,“type”:“->”,“args”:[]},{“file”:“/var/www/nextcloud/lib/private/Server.php”,“line”:395,“function”:“__construct”,“class”:“OC\Files\View”,“type”:“->”,“args”:[]},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php”,“line”:155,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:“->”,“args”:[" sensitive parameters replaced ***”]},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php”,“line”:122,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:“->”,“args”:[“OC\Files\Node\HookConnector”]},{“file”:“/var/www/nextcloud/lib/private/ServerContainer.php”,“line”:156,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:“->”,“args”:[“OC\Files\Node\HookConnector”,true]},{“file”:“/var/www/nextcloud/lib/private/Server.php”,“line”:1324,“function”:“query”,“class”:“OC\ServerContainer”,“type”:“->”,“args”:[“OC\Files\Node\HookConnector”]},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:595,“function”:“boot”,“class”:“OC\Server”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1091,“function”:“init”,“class”:“OC”,“type”:“::”,“args”:},{“file”:“/var/www/nextcloud/status.php”,“line”:37,“args”:[“/var/www/nextcloud/lib/base.php”],“function”:“require_once”}],“File”:“/var/www/nextcloud/lib/private/DB/Connection.php”,“Line”:72,“CustomMessage”:“–”},“userAgent”:“Mozilla/5.0 (Windows) mirall/3.1.3stable-Win64 (build 20210218) (Nextcloud)”,“version”:“20.0.8.1”,“id”:“6066e50c1f796”}

`

I read that this kind of loop might be related to power supply issues, is that right? any idea about its cause?

Thanks!

Yes, it is first thing to check.
External drives should have adequate power source and cable.

Do you think that it would be enough to change my 5v3a charger for another one of better quality? (I got a cheap one from Aliexpress which was advertised for Pi 4, but…) Or should I give independent juice to my external SSD?

Yes, you need an extra power source.

hm… this sounds oddly familiar.

@YisusL please have a look at this thread. Could it be that we face a similar issue?
My problem is that I don’t have access to a screen to check logs once the pi locked me out.
*Please keep in mind that I might face more than one issue (locking out and turning off randomly) and don’t get confused when reading my posts. I’m utterly confused myself haha…

otherwise, yes as @OliverV mentioned… the power source is a very common problem, there are numerous people experiencing these issues. See this >>> Posts

Yes, I think that we are facing a similar issue. It gives me the same error message as yours when I try to access my server from the internet and, after rebooting the Pi, everything works again for 12 hours or so.

Also, I’ve observed that I always get the error after trying to watch a couple of videos from the server. The first video that I try to play usually plays reasonably well. But the second video that I try to play never starts, and if I keep forcing it, I get the error.

I’ve already purchased the original Pi 4 charger. First, I’ll try with that one to see if I get that error again. If I still get it, I will test the server again with the SSD connected to an external power supply.

Did you try to connect your SSD to an external power supply already?

Nope.
However, I think*, that after I changed the power supply to the original Pi charger, I did not experience the permission denied issue any more.

(*as I was quite busy lately I did not have time to document well. But looking back I think it stopped after changing the power supply.)

What I’m facing now is the random shutdown of the Pi. But ONLY if I keep the ports 80 and 443 open. => See Post

The problem was solved once I bought the original Pi 4 charger. However, I didn’t need any external power supply to feed my two SSD.

(Answer made just to share knowledge).

Thanks!