Errors on harddrive (NCP)

Hi,
I was finally able to get my NCP working. I use an 1To harddrive I had on my shelfs. I use format in BTFSF, automount, and change dir all from ncp-config. It works fine until it turn to read-only and I receive errors. Since I was not sure if I did something wrong, I just reformat everything and restart from scratch. But at the same point of file’s transfer, I had the same problem. Again impossible to do something, error 500.


I’m able to read files if I mount the drive in my Ubuntu desktop.
Question 1 : Does my harddrive is dead?

To understand what happens, I decided to use a 16Gb USB drive to test. To date, no error problem. However because I wanted to take the picture for my HDD, I remove the drive. When I put it back, I got those errors below.
Question 2: Who is ncadmin? Why it have problems with password, if I didn’t change it? How can restore ncp?
I don’t care of data at this point. But I was wondering if it’s something happening frequently?
Thanks
Mel

<–! Paste this in GitHub report -->

NextCloudPi diagnostics

cat: /usr/local/etc/ncp-version: Aucun fichier ou dossier de ce type
NextCloudPi version
distribution         Armbian 20.08.1 Buster \l 
automount            yes
USB devices          sda 
datadir              /media/nc/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      13G/15G
rootfs usage         4,4G/29G
swapfile             /dev/zram1
dbdir                /var/lib/mysql
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        closed
port check 443       closed
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               0min

Nextcloud configuration

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'ncadmin'@'localhost' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:67
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(889): OC\DB\Connection->connect()
#1 /var/www/nextcloud/lib/private/DB/Connection.php(194): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(200): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
#3 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(216): Doctrine\DBAL\Query\QueryBuilder->execute()
#4 /var/www/nextcloud/lib/private/AppConfig.php(331): OC\DB\QueryBuilder\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()
#6 /var/www/nextcloud/lib/private/AppConfig.php(287): OC\AppConfig->getApps()
#7 /var/www/nextcloud/lib/private/legacy/OC_App.php(883): OC\AppConfig->getValues(false, 'installed_versi...')
#8 /var/www/nextcloud/lib/private/Server.php(665): OC_App::getAppVersions()
#9 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#10 /var/www/nextcloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#11 /var/www/nextcloud/lib/private/Server.php(1704): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#12 /var/www/nextcloud/lib/private/Server.php(856): OC\Server->getMemCacheFactory()
#13 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#14 /var/www/nextcloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OC\\App\\AppManag...')
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(163): OC\ServerContainer->query('OC\\App\\AppManag...')
#16 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#17 /var/www/nextcloud/lib/private/ServerContainer.php(124): Pimple\Container->offsetGet('OCP\\App\\IAppMan...')
#18 /var/www/nextcloud/lib/private/Server.php(1894): OC\ServerContainer->query('OCP\\App\\IAppMan...')
#19 /var/www/nextcloud/lib/private/legacy/OC_App.php(347): OC\Server->getAppManager()
#20 /var/www/nextcloud/lib/private/legacy/OC_App.php(114): OC_App::getEnabledApps()
#21 /var/www/nextcloud/lib/base.php(648): OC_App::loadApps(Array)
#22 /var/www/nextcloud/lib/base.php(1095): OC::init()
#23 /var/www/nextcloud/console.php(49): require_once('/var/www/nextcl...')
#24 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#25 {main}
HTTPd logs

[Fri Oct 02 00:29:22.604538 2020] [mpm_event:notice] [pid 1272:tid 281473677579632] AH00491: caught SIGTERM, shutting down
[Fri Oct 02 00:29:54.091606 2020] [ssl:warn] [pid 1072:tid 281473305060720] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 00:29:54.246513 2020] [ssl:warn] [pid 1340:tid 281473305060720] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 00:29:54.254130 2020] [mpm_event:notice] [pid 1340:tid 281473305060720] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Fri Oct 02 00:29:54.254298 2020] [core:notice] [pid 1340:tid 281473305060720] AH00094: Command line: '/usr/sbin/apache2'
[Fri Oct 02 00:41:57.061320 2020] [mpm_event:notice] [pid 1340:tid 281473305060720] AH00491: caught SIGTERM, shutting down
[Fri Oct 02 00:42:29.026502 2020] [ssl:warn] [pid 1081:tid 281473761875312] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 00:42:29.142142 2020] [ssl:warn] [pid 1197:tid 281473761875312] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 00:42:29.168354 2020] [mpm_event:notice] [pid 1197:tid 281473761875312] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Fri Oct 02 00:42:29.168636 2020] [core:notice] [pid 1197:tid 281473761875312] AH00094: Command line: '/usr/sbin/apache2'
[Fri Oct 02 01:01:39.262817 2020] [mpm_event:notice] [pid 1197:tid 281473761875312] AH00493: SIGUSR1 received.  Doing graceful restart
AH00112: Warning: DocumentRoot [/var/www/ncp-web] does not exist
[Fri Oct 02 01:01:39.308538 2020] [ssl:warn] [pid 1197:tid 281473761875312] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 01:01:39.310699 2020] [mpm_event:notice] [pid 1197:tid 281473761875312] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Fri Oct 02 01:01:39.310751 2020] [core:notice] [pid 1197:tid 281473761875312] AH00094: Command line: '/usr/sbin/apache2'
[Fri Oct 02 01:15:02.861645 2020] [mpm_event:notice] [pid 1197:tid 281473761875312] AH00491: caught SIGTERM, shutting down
[Fri Oct 02 01:15:36.269302 2020] [ssl:warn] [pid 1062:tid 281473260152176] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 01:15:36.394922 2020] [ssl:warn] [pid 1209:tid 281473260152176] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Oct 02 01:15:36.403027 2020] [mpm_event:notice] [pid 1209:tid 281473260152176] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Fri Oct 02 01:15:36.403168 2020] [core:notice] [pid 1209:tid 281473260152176] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2020-10-02  1:16:00 40 [Warning] Access denied for user 'ncadmin'@'localhost' (using password: YES)
2020-10-02  1:16:00 41 [Warning] Access denied for user 'ncadmin'@'localhost' (using password: YES)
2020-10-02  1:16:00 42 [Warning] Access denied for user 'ncadmin'@'localhost' (using password: YES)
2020-10-02  1:16:00 43 [Warning] Access denied for user 'ncadmin'@'localhost' (using password: YES)
2020-10-02  1:16:00 44 [Warning] Access denied for user 'ncadmin'@'localhost' (using password: YES)
2020-10-02  1:16:01 45 [Warning] Access denied for user 'ncadmin'@'localhost' (using password: YES)
Nextcloud logs

{"reqId":"X3a3NnHz8osVjk7t-X8ZRwAAABc","level":3,"time":"2020-10-02T05:14:30+00:00","remoteAddr":"XXXXXX","user":"--","app":"PHP","method":"PROPFIND","url":"/remote.php/dav/files/melanie/data/temporaire","message":"Error: Class 'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' not found at /var/www/nextcloud/remote.php#61","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.5-20200713.144448.adada8b2e-1.0~bionic1 (Nextcloud)","version":"19.0.3.1"}

Hi,
I have had a similar experience in the past. The problem for me and may others when it comes to Raspberry Pi is the SD Card. Those horrible little nasty things have a tendency to break far to often when extensively written to. Bear in mind thy where never intended as secondary server storage…

In my case, I had to re-install everything which was a bit cumbersome but on a Pi there is just a small system so for me that was manageable.
I still run NCP but have taken some precautions omitting much writing to the SD Card by changing the cache to a USB attached hard drive. Since I have a Raspberry Pi 3 which is going to be swapped for a 4 soon, I haven’t implemented USB drive Boot which will make it considerably less prone to errors of the sort I have experienced in the past and I suspect you suffer from judging from what you have mentioned here…

It looks like the filesystem is corrupt which could happen if the SD Card is broken and hence also the partion and file system.
Solution wise for you I would first try to fix/repair the filesystem with the tools available for BTRFS. Hopefully this could do it… Otherwise try to access the SD Card from another host like a PC and try to back up and copy all of its content to a new card previously formatted in the Pi and then se if you could get it to “behave” with that SD Card instead…

Regards!
/JBM

P.s NCAdmin is the administrator that is installed by NC and used to login to the NC Web Admin portal (https://YourServersURL or IP:4443) This user has a default password as I remember it. You should find that in the documentation…

Hi,
Thanks for answer. Do you suggest I retry again to reformat for a 3rd time but with the /tmp on the harddrive ? I have no problem to redo it, I probably reflashed my SD at least 10 times until I had a working app. Whatever… :face_with_raised_eyebrow:

Concerning ncadmin, it’s what I don’t understand. I just have 1 user, myself, and I’m admin.
I just checked my config.php (/var/www/config/config.php) and tried some test:
‘dbuser’ => ‘ncadmin’,
‘dbpassword’ => ‘LONNGGGPASSWORD’,
It’s something started by B9. I go to nc-config, run nc-psswd, change with something else. Return to config.php and the hashed password still starts with B9.
Is it normal it didn’t change? Could it be the cause of my logging problems?
Thanks
PS BTW, I never been able to reach url:4443, I have to pass through ssh to access ncp-config.

You are confusing database user and user that is admin of NC, two different users, each with their own passwords.

I’d run checks on all filesystems, both sd and hd, also check output of dmesg and look for power issues. And syslog for any other anomalies.