Permissions Error occurring ~one week after the last server reboot

Nextcloud version : 24.0.3.2
Operating system and version : Ubuntu 22.04.1 LTS
Apache or nginx version : Apache/2.4.52 (Ubuntu)
PHP version : PHP 8.1.11
LAMP Stack and nothing else is installed other than Nextcloud on the server.

Hello everyone,

After i use Nextcloud for about a week i get the following message:

“Error:
Your data directory is not writable.
Permissions can usually be fixed by giving the web server write access to the root directory. See Introduction — Nextcloud latest Administration Manual latest documentation

The Error goes away if i restart the server and then it appears again about a week later. I didn’t notice that it appears after a specific usage but more or less a week after the last reboot.

Is this the first time you’ve seen this error? (Y/N): No It occurs since i installed Nextcloud

Steps to replicate it:

  1. I just use Nextcloud normally for about a week.

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

config.php:

  GNU nano 6.2                                   config.php                                             
<?php
$CONFIG = array (
  'instanceid' => ‘ID’,
  'passwordsalt' => ‘PASSWORD’,
  'secret' => ’SECRET’,
  'trusted_domains' => 
  array (
    0 => ‘DOMAIN’,
    1 => ‘DOMAIN’,
  ),
  'datadirectory' => '/mnt/hdd/data',
  'dbtype' => 'mysql',
  'version' => '24.0.3.2',
  'overwrite.cli.url' => ‘DOMAIN’,
  'dbname' => ‘NAME,
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => ‘USER’,
  'dbpassword' => ‘PASSWORD’,
  'installed' => true,
  'default_language' => 'en',
  'default_locale' => 'en',
  'default_phone_region' => 'DE',
  'skeletondirectory' => '',
  'memcache.local' => '\\OC\\Memcache\\Redis',

The output of Apache/nginx/system log (Please go through the logs I have marked the positions events occurred):

Oct  4 10:45:01 pandorabox19 CRON[21486]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 10:50:01 pandorabox19 CRON[21499]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 10:55:01 pandorabox19 CRON[21513]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:00:02 pandorabox19 CRON[21550]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:05:01 pandorabox19 CRON[21575]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:09:01 pandorabox19 CRON[21600]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Oct  4 11:09:16 pandorabox19 systemd[1]: Starting Clean php session files...
Oct  4 11:09:17 pandorabox19 systemd[1]: phpsessionclean.service: Deactivated successfully.
Oct  4 11:09:17 pandorabox19 systemd[1]: Finished Clean php session files.
Oct  4 11:10:01 pandorabox19 CRON[21670]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:15:01 pandorabox19 CRON[21696]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:17:01 pandorabox19 CRON[21705]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct  4 11:17:25 pandorabox19 systemd[1]: Starting Ubuntu Advantage Timer for running repeated jobs...
Oct  4 11:17:25 pandorabox19 systemd[1]: ua-timer.service: Deactivated successfully.
Oct  4 11:17:25 pandorabox19 systemd[1]: Finished Ubuntu Advantage Timer for running repeated jobs.
Oct  4 11:20:01 pandorabox19 CRON[21722]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:25:01 pandorabox19 CRON[21735]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)



>>> Around this time I checked Nextcloud and realized that it is not working anymore (maybe a bit earlier or later)


Oct  4 11:26:02 pandorabox19 kernel: [258289.881425] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:02 pandorabox19 kernel: [258289.881470] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:02 pandorabox19 kernel: [258289.881492] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:02 pandorabox19 kernel: [258289.881514] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:02 pandorabox19 kernel: [258289.881528] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:02 pandorabox19 kernel: [258289.881687] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:02 pandorabox19 kernel: [258289.964802] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:02 pandorabox19 kernel: [258289.964848] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:02 pandorabox19 kernel: [258289.964869] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:02 pandorabox19 kernel: [258289.964891] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:02 pandorabox19 kernel: [258289.964909] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:02 pandorabox19 kernel: [258289.965177] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:02 pandorabox19 kernel: [258290.054087] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:02 pandorabox19 kernel: [258290.054128] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:02 pandorabox19 kernel: [258290.054146] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:02 pandorabox19 kernel: [258290.054169] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:02 pandorabox19 kernel: [258290.054183] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:02 pandorabox19 kernel: [258290.054419] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:02 pandorabox19 kernel: [258290.145717] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:02 pandorabox19 kernel: [258290.145760] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:02 pandorabox19 kernel: [258290.145780] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:02 pandorabox19 kernel: [258290.145805] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:02 pandorabox19 kernel: [258290.145821] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:02 pandorabox19 kernel: [258290.146198] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:02 pandorabox19 kernel: [258290.235830] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:02 pandorabox19 kernel: [258290.235873] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:02 pandorabox19 kernel: [258290.235894] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:02 pandorabox19 kernel: [258290.235916] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:02 pandorabox19 kernel: [258290.235931] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:02 pandorabox19 kernel: [258290.236103] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.320142] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:03 pandorabox19 kernel: [258290.320186] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:03 pandorabox19 kernel: [258290.320208] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:03 pandorabox19 kernel: [258290.320229] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:03 pandorabox19 kernel: [258290.320244] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.320408] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.414161] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:03 pandorabox19 kernel: [258290.414205] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:03 pandorabox19 kernel: [258290.414226] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:03 pandorabox19 kernel: [258290.414249] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 22 01 17 78 00 00 08 00
Oct  4 11:26:03 pandorabox19 kernel: [258290.414263] blk_update_request: I/O error, dev sda, sector 570496888 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.414429] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #17835318: comm apache2: reading directory lblock 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.545249] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:03 pandorabox19 kernel: [258290.545295] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:03 pandorabox19 kernel: [258290.545317] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:03 pandorabox19 kernel: [258290.545341] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 23 c1 18 18 00 00 08 00
Oct  4 11:26:03 pandorabox19 kernel: [258290.545356] blk_update_request: I/O error, dev sda, sector 599857176 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.545615] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #18743376: comm apache2: reading directory lblock 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.633547] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:03 pandorabox19 kernel: [258290.633591] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:03 pandorabox19 kernel: [258290.633610] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:03 pandorabox19 kernel: [258290.633633] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 23 c1 18 18 00 00 08 00
Oct  4 11:26:03 pandorabox19 kernel: [258290.633648] blk_update_request: I/O error, dev sda, sector 599857176 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.633857] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #18743376: comm apache2: reading directory lblock 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.719592] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=0s
Oct  4 11:26:03 pandorabox19 kernel: [258290.719635] sd 0:0:0:0: [sda] tag#0 Sense Key : Hardware Error [current]
Oct  4 11:26:03 pandorabox19 kernel: [258290.719659] sd 0:0:0:0: [sda] tag#0 Add. Sense: No additional sense information
Oct  4 11:26:03 pandorabox19 kernel: [258290.719681] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 23 c1 18 18 00 00 08 00
Oct  4 11:26:03 pandorabox19 kernel: [258290.719695] blk_update_request: I/O error, dev sda, sector 599857176 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Oct  4 11:26:03 pandorabox19 kernel: [258290.719913] EXT4-fs error (device sda1): __ext4_find_entry:1635: inode #18743376: comm apache2: reading directory lblock 0
Oct  4 11:26:05 pandorabox19 kernel: [258292.505600] Aborting journal on device sda1-8.
Oct  4 11:26:05 pandorabox19 kernel: [258292.589536] Buffer I/O error on dev sda1, logical block 121667584, lost sync page write
Oct  4 11:26:05 pandorabox19 kernel: [258292.589685] JBD2: Error -5 detected when updating journal superblock for sda1-8.
Oct  4 11:26:32 pandorabox19 kernel: [258319.809691] EXT4-fs error: 4 callbacks suppressed
Oct  4 11:26:32 pandorabox19 kernel: [258319.809713] EXT4-fs error (device sda1): ext4_journal_check_start:83: comm kworker/u8:0: Detected aborted journal
Oct  4 11:26:32 pandorabox19 kernel: [258319.816277] EXT4-fs (sda1): Remounting filesystem read-only
Oct  4 11:26:32 pandorabox19 kernel: [258319.816338] EXT4-fs (sda1): ext4_writepages: jbd2_start: 1024 pages, ino 17563692; err -30
Oct  4 11:30:01 pandorabox19 CRON[21769]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:30:01 pandorabox19 CRON[21768]: (CRON) info (No MTA installed, discarding output)
Oct  4 11:33:25 pandorabox19 systemd[1]: Starting Certbot...
Oct  4 11:33:27 pandorabox19 systemd[1]: certbot.service: Deactivated successfully.
Oct  4 11:33:27 pandorabox19 systemd[1]: Finished Certbot.
Oct  4 11:33:27 pandorabox19 systemd[1]: certbot.service: Consumed 2.242s CPU time.
Oct  4 11:35:01 pandorabox19 CRON[21789]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:35:02 pandorabox19 CRON[21788]: (CRON) info (No MTA installed, discarding output)
Oct  4 11:39:01 pandorabox19 CRON[21801]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Oct  4 11:39:16 pandorabox19 systemd[1]: Starting Clean php session files...
Oct  4 11:39:17 pandorabox19 systemd[1]: phpsessionclean.service: Deactivated successfully.
Oct  4 11:39:17 pandorabox19 systemd[1]: Finished Clean php session files.
Oct  4 11:40:01 pandorabox19 CRON[21858]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:40:02 pandorabox19 CRON[21857]: (CRON) info (No MTA installed, discarding output)
Oct  4 11:45:01 pandorabox19 CRON[21873]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:45:01 pandorabox19 CRON[21872]: (CRON) info (No MTA installed, discarding output)
Oct  4 11:47:23 pandorabox19 systemd[1]: Starting Download data for packages that failed at package install time...
Oct  4 11:47:24 pandorabox19 systemd[1]: update-notifier-download.service: Deactivated successfully.
Oct  4 11:47:24 pandorabox19 systemd[1]: Finished Download data for packages that failed at package install time.
Oct  4 11:50:01 pandorabox19 CRON[21888]: (root) CMD (sudo -u www-data php /var/www/nextcloud/cron.php)
Oct  4 11:50:02 pandorabox19 CRON[21887]: (CRON) info (No MTA installed, discarding output)
Oct  4 11:53:16 pandorabox19 systemd[1]: Starting Daily apt download activities...
Oct  4 11:53:47 pandorabox19 systemd[1]: apt-daily.service: Deactivated successfully.
Oct  4 11:53:47 pandorabox19 systemd[1]: Finished Daily apt download activities.
Oct  4 11:53:47 pandorabox19 systemd[1]: apt-daily.service: Consumed 30.311s CPU time.

I don’t know what to look for in the nextcloud.log

Thank you for your efforts!

Please check healthiness of your filesystem.

1 Like

Could be a connection issue (defective data cable), a power issue (the drive is receiving insufficient or unstable power), a driver issue (less likely nowdays), or in the worst case, a dying drive.

is this an SSD or a mechanical drive?

How ist it connected? external (USB) or internal (SATA)?

Is it connected directly to the motherboard or via a USB hub, or if internal, via some RAID / JBOD card?

It is one SSD connected by SATA directly to the motherboard (no RAID / JBOD)

The Mini PC-Server is running for 2 Months and the SSD (Western Digital RED SA500) is also new.

How to do this ?

This issue is unrelated to Nextcloud and so I recommend you to search the internet about how to check ext4 filesystem on ubuntu linux.

1 Like

First thing I would try is replacing the SATA cable. A defective cable can definitely cause exactly the issue you are experiencing…

Other possible reasons that come to mind, as already mentioned:

  • The SSD itself. Even new devices can be defective. RMA it, if replacing the cable doesn’t help.

  • some issue with the power delivery, either caused by the power supply or the motherboard, although these is rather unlikely with an SSD…

  • Chipset respectively SATA controller or incompatibility with Ubuntu 22.04, also rather unlikely, unless the PC is brand new maybe…

Also @rakekniven is right, the issue is not related to Nextcloud, although I don’t think it’s an issue with the filesystem directly. But you should of course not use the server productively, unless you solved the issue. And backup all your important data before you do any further experiments…

Good luck.

2 Likes