Nextcloud problems after update

NethServer Version: 7.9.2009
Module: nextcloud
Hello guys,
I have a problem in nextcloud, since the last update nectcloud stopped working, I can only see 4 files in the web interface with no folders and I can’t create anything more.
Here the logs :
Error: disk_free_space(): No such file or directory at /usr/share/nextcloud/lib/private/Files/Storage/Local.php#381

Error: fopen(/var/lib/nethserver/nextcloud/7a24f9ae-8122-1038-9de4-8fb1afc488fc/files/Photos/Readme.md): failed to open stream: No such file or directory at /usr/share/nextcloud/lib/private/Files/Storage/Local.php#363

disk full? I still have about 200GB free…
anyone can help me ?

sorry for the double posting, I cannot delete the message

Probably useless hint but… would you please start from console signal-event nethserver-nextcloud-update and try again?

everything is useful when you can learn a bit more, but here’s the log after launching the command
#########################################################
Jul 26 19:23:58 docs esmith::event[19320]: Event: nethserver-nextcloud-update
Jul 26 19:23:58 docs esmith::event[19320]: Migrating existing database configuration
Jul 26 19:23:58 docs esmith::event[19320]: WARNING in /etc/e-smith/db/configuration/migrate//MigrateAmavisdPropertyToRspamd_Issue5394.ns7: value() should not be used on records with properties, use prop() at /usr/share/perl5/vendor_perl/esmith/ConfigDB/Record.pm line 86.
Jul 26 19:23:59 docs esmith::event[19320]: WARNING: Template processing succeeded for /: 1 fragment generated warnings
Jul 26 19:23:59 docs esmith::event[19320]: at /usr/share/perl5/vendor_perl/esmith/DB.pm line 461.
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database certificates
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database networks
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database routes
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database accounts
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database proxypass
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database hosts
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database dhcp
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database backups
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database fwrules
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database tc
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database fwservices
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database fwtimes
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database macs
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database portforward
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database smarthosts
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database ips
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database domains
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database vpn
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database getmail
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database dyndns
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database imapsync
Jul 26 19:23:59 docs esmith::event[19320]: Migrating existing database separators
Jul 26 19:23:59 docs esmith::event[19320]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S00initialize-default-databases SUCCESS [1.659865]
Jul 26 19:24:00 docs esmith::event[19320]: expanding /etc/httpd/conf.d/default-virtualhost.inc
Jul 26 19:24:00 docs esmith::event[19320]: expanding /etc/httpd/conf.d/nethserver.conf
Jul 26 19:24:00 docs esmith::event[19320]: expanding /etc/httpd/conf.d/nextcloud.conf
Jul 26 19:24:00 docs esmith::event[19320]: expanding /etc/httpd/conf.d/zz_nextcloud.conf
Jul 26 19:24:00 docs esmith::event[19320]: expanding /etc/opt/rh/rh-mariadb105/my.cnf.d/mariadb-server.cnf
Jul 26 19:24:00 docs esmith::event[19320]: Action: /etc/e-smith/events/actions/generic_template_expand SUCCESS [0.600869]
Jul 26 19:24:04 docs esmith::event[19320]: Maintenance mode enabled
Jul 26 19:24:04 docs esmith::event[19320]: Nextcloud is in maintenance mode, hence the database isn’t accessible.
Jul 26 19:24:04 docs esmith::event[19320]: Cannot perform any command except ‘maintenance:mode --off’
Jul 26 19:24:04 docs esmith::event[19320]:
Jul 26 19:24:04 docs esmith::event[19320]: Nextcloud is in maintenance mode
Jul 26 19:24:04 docs esmith::event[19320]: Maybe an upgrade is already in process. Please check the logfile (data/nextcloud.log). If you want to re-run the upgrade procedure, remove the “maintenance mode” from config.php and call this script again.
Jul 26 19:24:04 docs esmith::event[19320]: Maintenance mode disabled
Jul 26 19:24:40 docs esmith::event[19320]: Check indices of the share table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the filecache table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the twofactor_providers table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the login_flow_v2 table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the whats_new table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the cards table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the cards_properties table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the calendarobjects_props table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the schedulingobjects table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the oc_properties table.
Jul 26 19:24:41 docs esmith::event[19320]: Check indices of the oc_jobs table.
Jul 26 19:24:41 docs esmith::event[19320]: Done.
Jul 26 19:24:41 docs esmith::event[19320]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S20nethserver-nextcloud-conf SUCCESS [40.575233]
Jul 26 19:24:42 docs esmith::event[19320]: System config value trusted_domains deleted
Jul 26 19:24:42 docs esmith::event[19320]: System config value trusted_domains => 0 set to string localhost
Jul 26 19:24:42 docs esmith::event[19320]: System config value trusted_domains => 1 set to string docs.arketipo-sa.it
Jul 26 19:24:43 docs esmith::event[19320]: System config value memcache.local set to string \OC\Memcache\APCu
Jul 26 19:24:43 docs esmith::event[19320]: System config value logfile set to string /var/lib/nethserver/nextcloud/nextcloud.log
Jul 26 19:24:43 docs esmith::event[19320]: System config value mail_smtpmode set to string smtp
Jul 26 19:24:44 docs esmith::event[19320]: System config value mail_smtpsecure set to empty string
Jul 26 19:24:44 docs esmith::event[19320]: System config value mail_smtpauthtype set to string LOGIN
Jul 26 19:24:44 docs esmith::event[19320]: System config value mail_from_address set to string no-reply
Jul 26 19:24:44 docs esmith::event[19320]: System config value mail_domain set to string arketipo-sa.it
Jul 26 19:24:45 docs esmith::event[19320]: System config value mail_smtphost set to string localhost
Jul 26 19:24:45 docs esmith::event[19320]: System config value mail_smtpport set to string 25
Jul 26 19:24:45 docs esmith::event[19320]: Set mode for background jobs to ‘cron’
Jul 26 19:24:45 docs esmith::event[19320]: All tables already up to date!
Jul 26 19:24:46 docs esmith::event[19320]: System config value trusted_domains => 2 set to string 192.168.23.1
Jul 26 19:24:46 docs esmith::event[19320]: System config value trusted_domains => 3 set to string 192.168.2.10
Jul 26 19:24:52 docs esmith::event[19320]: Action: /etc/e-smith/events/nethserver-nextcloud-update/S30nethserver-nextcloud-occ-conf SUCCESS [11.66167]
Jul 26 19:24:54 docs esmith::event[19320]: [INFO] service httpd restart
Jul 26 19:25:02 docs esmith::event[19320]: [INFO] service rh-php73-php-fpm restart
Jul 26 19:25:03 docs esmith::event[19320]: [INFO] service rh-mariadb105-mariadb@nextcloud restart
Jul 26 19:25:07 docs esmith::event[19320]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [14.709242]
Jul 26 19:24:46 docs su: (to apache) root on none
Jul 26 19:24:46 docs su: (to apache) root on none
Jul 26 19:24:47 docs su: (to apache) root on none
Jul 26 19:24:47 docs su: (to apache) root on none
Jul 26 19:24:47 docs su: (to apache) root on none
Jul 26 19:24:48 docs su: (to apache) root on none
Jul 26 19:24:48 docs su: (to apache) root on none
Jul 26 19:24:48 docs su: (to apache) root on none
Jul 26 19:24:48 docs su: (to apache) root on none
Jul 26 19:24:49 docs su: (to apache) root on none
Jul 26 19:24:49 docs su: (to apache) root on none
Jul 26 19:24:49 docs su: (to apache) root on none
Jul 26 19:24:49 docs su: (to apache) root on none
Jul 26 19:24:50 docs su: (to apache) root on none
Jul 26 19:24:50 docs su: (to apache) root on none
Jul 26 19:24:50 docs su: (to apache) root on none
Jul 26 19:24:50 docs su: (to apache) root on none
Jul 26 19:24:51 docs su: (to apache) root on none
Jul 26 19:24:51 docs su: (to apache) root on none
Jul 26 19:24:51 docs su: (to apache) root on none
Jul 26 19:24:52 docs su: (to apache) root on none
Jul 26 19:24:52 docs su: (to apache) root on none
Jul 26 19:24:52 docs su: (to apache) root on none

Jul 26 19:25:07 docs esmith::event[19320]: Event: nethserver-nextcloud-update SUCCESS
########################################################
and in the attached image you can see what’s the problem, there also was an external storage configured (/var/lib/nethserver/ibay/shared/) not visible now

is this path available to your server currently? (bold added by me)
Is it mounted in R/W mode?

the path is in the same server, is the local folder shared with samba to internal network clients

the folder is owned by nobody:root

And this permission IMVHO should not be correct…
image
But I am not linux-skilled to suggest the correct chown instruction

@pike

Hi

The correct syntax for changing the permissions (actually here only owner, not permissions) in NethServer would be:

chown -R root.root /var/lib/nethserver/ibay/shared/

chown changes the owner
-R is recursive, including subfolders
root.root = owner.group
path is the valid path…

My 2 cents
Andy

Thanks for the contribution, @Andy_Wismer, I hope that Gatto will use it and… this would help to solve the issue.

1 Like

i think it is not a folder permission problem, that folder inherit owner from samba sharing in local ldap mode. Also apache give me no errors when I connect it as external storage folder to nextcloud. This configuration ran for many months before the crash, I suspect there was a hardware reset of the server, maybe a power fault that corrupt some file.
Can I completely purge and reinstall nextcloud without touching db, users and files?

then scrub your logs, messages for starters but not only…

no errors in logs but when I try to run
sudo -u apache scl enable rh-php73 – php /usr/share/nextcloud/occ maintenance:mode-on the result is :
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
if I run instead
sudo -u apache scl enable rh-php72 – php /usr/share/nextcloud/occ maintenance:mode-on
This version of Nextcloud requires at least PHP 7.3
You are currently running 7.2.24. Please update your PHP version
could it be a wrong php version? how can I upgrade it?

You can run occ directly without choosing the php version, as on nethserver there is an occ wrapper file.

Check rh-php73-php-pecl-apcu package is installed.
Maybe nextcloud’s config.php file is worth a look.

Probably an upstream bug (similar bug was reported on nextcloud github issue tracker).

For peace of mind you can check your user files are not gone:

/var/lib/nethserver/nextcloud/*

same with the external share /var/lib/nethserver/ibay/shared/

I ran into this on my RPI I managed to fix it NextCloud Update how to Raspberry Pi - #2 by Shane_Treweek

tried your solution but no luck. I’m now running
sudo -u apache scl enable rh-php73 – php -dmemory_limit=512M -d apc.enable_cli=1 /usr/share/nextcloud/occ files:scan --all
to see if there are any corrupted files or folder.
I got two warnings like :
Starting scan for user 4 out of 8 (591c04f0-8122-1038-9de3-8fb1afc488fc)
Home storage for user 591c04f0-8122-1038-9de3-8fb1afc488fc not writable
but if I run ls -l on 591c04f0-8122-1038-9de3-8fb1afc488fc
I get
drwxr-xr-x 2 apache apache 6 May 31 2021 cache
drwxr-xr-x 5 apache apache 47 Jul 15 2021 files_trashbin
drwxr-xr-x 3 apache apache 20 Aug 2 2021 files_versions
drwxr-xr-x 2 apache apache 6 Jul 12 22:18 uploads
this server is driving me mad…

Can you restore a pre-package upgrade backup?

Well, I think is the last chance we have… I’m going to do it…

A skilled/experienced sysadmin with centos and nextcloud competence maybe can find the real hiccup browsing into logs of OS and nextcloud.
A better and more wise sysadmin that i am now. Sometimes you hit the wall of your lack of knowledge. Will power, time and patience (adding also reading and scheduling steps) are great tools to learn something new.

1 Like