Nextcloud problem under Nethserver

NethServer Version: 7.9.2009 (final)
Module: Nextcloud

Hello altogether,

I have a problem with an existing installation - especially with Nextcloud.

Nethserver is quite new… I created a user for usage with e-mail and Nextcloud. The user worked several weeks, several PCs were synchronized. All clients are installed with the current Nextcloud client from the Nextcloud website.

Whatever happend… since about ten days all the clients cannot connect any more to the Nextcloud server. The initial synchronization was successful… but the clients are not connected. On the client side I get the message (literally translated): No connection to Nextcloud on https://myhostname.dyndns.info/nextcloud Server replied "404 Not found on PROPFIND https://myhostname.dyndns.info/nextcloud/remote.php/dav/files/bf4b923-cf...cf… (Principal with name bfxxxxxxx not found).

When I login via the Web Interface… the login works, but the initially synchronized directories are not there, just the default directories of a Nextcloud instance.

A re-installation of the clients does not help…

I do not want to delete the user name and re-create it, because there is also a mail account connected to it.

Any suggestions how that can be resolved?

Thanks in advance and best regards,

Frank

As an addition… I “played” around a little bit.

In the meantime I get the error "400 Bad Request on 'GET https://myhost.dyndns.info/nextcloud/status.php."

And when I try to logon, the error message with not trusted domain appears in the web browser.

I’m not sure, what to specify here… I added the domain, to which I try to connect: myhost.dyndns.info … and I tried to add the IP address of the client. The problem with the client(s) is, that they come out of different networks. Several offices try to connect to a central Nextcloud server.

Is that configurable?

Best regards,
Frank

@frankn

Hi Frank

If you’re looking for help, a bit more info would help… What kind of server is this running on? Obviously not virtualized on a decent Hypervisor like Proxmox - or you wouldn’t be having this issue. A simple rollback to the last backup would suffice…

Do you have any Backups, especially of the time the server went astray?

One good chance you have is to restore a configuration backup of the server. This does not risk any data (keeps the latest) but reset’s the configuration back to what was working.

→ You could even delete Nextcloud from Software Center, and let configuration backup restore that…

As to your question: I do have clients who log in to their mail and Nextcloud from all over - all without any issues. But you must use a valid SSL certificate, for example the free LetsEncrypt, which I’m using for ALL my clients!
And also: about 40% of my clients have a dynamic IP, and use DynDNS. The real Domain is pointing to the DynDNS name, so we have our own valid domain and correct ssl certs, despite the Ips changing once in a while or even daily!

It’s worth the little work, to get stable working, and satisfied clients!

Good Luck

My 2 cents
Andy

Check my home NethServer:

https://cloud.anwi.ch/

1 Like

Hello Andy,

thank you very much… I “solved” the one problem… I think it was an incorrect entry in the trusted_domains setting in config.php… and created a new problem :crazy_face:

In the nethserver web interface I did an update on Nextcloud (and also applied all other updates). When I now go to the webpage https://myserver.dyndns.info/nextcloud, then a page is displayed where I am asked to update to version 22.2.0 . When I click on “Update” at the bottom, the message appears: “Exception: Updates between multiple major versions and downgrades are unsupported.”

I also tried “occ upgrade” on a console. This did not work either. “occ status” said:

  • installed: true
  • version: 22.2.0.2
  • versionstring: 22.2.0
  • edition:

I think I have a mixture of installations now… also the data is spread in different directories: the “old” data from the clients that I already connected is located in /var/lib/nethserver/nextcloud/.

After I did the “update” or whatever I did: the new user’s data is located in /usr/share/nextcloud/data/.

I’m really unsure, how I can get rid of that version mix and distributed data…

Thanks again for a hint and best regards,

Frank

@frankn

Hi

Never use the console or NextCloud Interface to update NextCloud - you need to wait until the Update / Upgrade is packaged for NethServer and distributed with other updates / upgrades…

One of the reasons: NC needs a newer MariaDB than is originally available for Centos/. So your NethServer has later two different MariaDB versions, same as it does with eg PHP.

The last version officially of PHP on Centos7 would be 5.4, more than a tad old for most current apps…

Updates / Upgrades come often enough! :slight_smile:

My 2 cents
Andy

Ok, does not sound really good… how can I get rid of the multiple versions?

The configuration backup is available… but there is no config.php in there.

And I assume, that when I remove the nextcloud module from Nethserver, then the original data is lost?

Thanks again, best regards,

Frank

Should NOT be. You CAN erase the data manually from the console… (if you want/need!).
NethServer will normally retain your data.

If it’s working at the moment, I’d leave it for the moment until the next upgrade/update for NextCloud/NethServer comes round. That should solve any issues…

→ But it’s still always better to have a backup “too many”, than one backup too little!

My 2 cents
Andy

No, it is not working, the clients can not connect… and when I click on the “Nextcloud” link in Nethserver web interface I get to the screen where it says, that I should update to version 22.2.0. I have to do something unfortunately.

OK

Make sure you have at least one full backup.
And also a - if needed even manual - config backup.
Better be on the safe side!

You could then remove the nextCloud App using Software Center.
Reboot

Make sure the system is fully updated.

Apply the last config backup you have before the problems (if possible).

Then check if any further updates (NextCloud) are available through Software Center.

Good Luck!

My 2 cents
Andy

my Version at home is running: 22.2.0.

My version has it’s data here:
/var/lib/nethserver/nextcloud/

The used MariaDB is here:
/opt/rh/rh-mariadb105/

The MariaDB Backup Dump is here:
/var/lib/nethserver/backup/rh-mariadb105/

thanks a lot, Andy, I will try either this evening or tomorrow. :slight_smile:

Thank you very much!

Best regards,

Frank

1 Like

If you’re still stuck with that error you can take a look at the wiki.

3 Likes

Hello Marc,

thank you for the wiki link. It looks even more like chaos here… strange how I managed to get to that point.

yum history shows:
18 | Updated | nethserver-nextcloud-1.16.6-1.ns7.noarch
18 | Update | 1.19.0-1.ns7.noarch

yum --showduplicates shows:
Installed Packages
nethserver-nextcloud.noarch 1.19.0-1.ns7

occ - - version shows: Nextcloud 22.2.0

The same version is in the config.php… which looks “destroyed”… compared to a config.php on a former version on a different Nethserver. In the former version there is dbuser and password, which is not in the damaged version any more.

The systemctl command further on top of your link (systemctl -l status rh-php73-php-fpm rh-mariadb105-mariadb@nextcloud.service) shows that both are “active (running)”.

I’m not sure, which is the better way: to deinstall and try to get the data back in somehow… or to try and perform the downgrade from the wiki… if I understand the downgrade correctly, then I’d have to downgrade only to nethserver-nextcloud-1.16.6-1.ns7.noarch as it is mentioned at the beginning of “yum history”, and not to “nextcloud-16…”

Thanks and best regards,

Frank

You had nethserver-nextcloud-1.16.6-1.ns7.noarch (Nextcloud 20.0.8) and updated to 1.19.0-1.ns7.noarch (Nextcloud 22.2.0) so jumped over (skipped) one major release (Nexcloud 21.x) which could be, for instance nethserver-nextcloud-1.17.1-1.ns7.noarch (Nextcloud 21.0.3) according to the package changelog.

As pointed by Andy, usually the data remains (/var/lib/nethserver/nextcloud/), and also the database (in another path) which holds other settings/data than documents. The dbuser is commonly nextcloud, the dbpassword shall be found at /var/lib/nethserver/secrets. If all of the above is present, you could rename the bad config.php file (and restore it from a backup if you can) and then do a downgrade to nethserver-nextcloud-1.17.1-1.ns7.noarch, unless I’m missing something else.

2 Likes

Hello Marc and Andy,

it’s me again… I could not work on my problem last week, so it still exists…

If I understand Marc / the wiki correctly, I should get a correct config.php, which was not easy… I modified it manually. At the moment there is an “Internal Server Error” when I open the Nextcloud page in a web browser.

The config.php looks like this:

<?php
$CONFIG = array (
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'yyyyyyyyyyyyyyyyyyyyyyyy',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'xxxxxxx.dyndns.info',
  ),
  'datadirectory' => '/var/lib/nethserver/nextcloud/',
  'dbtype' => 'mysql',
  'version' => '20.0.8.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'zzzzzzzzzzzzzzzzzzz',
  'installed' => true,
  'instanceid' => 'oc44kna9hr42',

A backup of the nextcloud directories in /usr/share and /var/lib/nethserver is running… and now I should perform a downgrade? I’m not sure about the version number…

And second question if that does not work: Andy said to deinstall nextcloud in the Software Center… but it is not there. In the main screen I saw 26 applications but now Nextcloud… then I clicked on “Reload”, the cache was cleared… and now I have zero applications???

Everything is quite strange…

Thank you and best regards,

Frank

Sorry for the missing line breaks…

About formatting you can find some tips here:

The config file is missing at least the closing parenthesis ); for the main $CONFIG array variable. Maybe that’s why you get the error page.

Have not tested but I think a config.php file is not forcibly required but highly recommended to keep the same config and even more if using file encryption on Nextcloud.

Hello Marc, sorry, I did not post the full config.php, as the rest was not modified.

Shall I try the downgrade? I’m not sure…

I can not find the software in the cockpit interface… and therefore cannot uninstall ist.

Or should I use the yum command as in

OK, I’m trying to remember where we left of the other time…
If the config file is complete it is possible that it prevents the new version of nextcloud to connect to the database due to changes in underlying mariadb version on how nextcloud connects to it.

First, we can try to check if with the update the database was moved/imported to a new instance.

# listing related database services
systemctl | grep mariadb
systemctl | grep mysqld

# checking status of new mariadb version used by nextcloud
systemctl status -l rh-mariadb105-mariadb@nextcloud.service

# list of databases on new mariadb instance
/opt/rh/rh-mariadb105/root/bin/mysqlshow --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock"

# list of databases on old mariadb instance
mysqlshow

# list of database users on new mariadb instance
/opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -e 'SELECT user FROM mysql.user'

# list of database users on old mariadb instance
mysql -e 'SELECT user FROM mysql.user'
1 Like

Hello Marc,

thanks a lot… here is the output of the commands.

Best regards,

Frank


systemctl | grep mariadb:

rh-mariadb105-mariadb@nextcloud.service                                                   loaded active running   MariaDB 10.5 database server
system-rh\x2dmariadb105\x2dmariadb.slice                                                  loaded active active    system-rh\x2dmariadb105\x2dmariadb.slice

systemctl | grep mysqld

mysqld.service             loaded active running   MariaDB database server
systemctl status -l rh-mariadb105-mariadb@nextcloud.service
● rh-mariadb105-mariadb@nextcloud.service - MariaDB 10.5 database server
   Loaded: loaded (/etc/systemd/system/rh-mariadb105-mariadb@.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/rh-mariadb105-mariadb@nextcloud.service.d
           └─nethserver.conf
   Active: active (running) since Tue 2021-11-16 22:04:26 CET; 57min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 2502 ExecStartPost=/usr/bin/scl enable $RH_MARIADB105_SCLS_ENABLED -- /opt/rh/rh-mariadb105/root/usr/libexec/mysql-check-upgrade --defaults-group-suffix=.%I (code=exited, status=0/SUCCESS)
  Process: 2237 ExecStartPre=/usr/bin/scl enable $RH_MARIADB105_SCLS_ENABLED -- /opt/rh/rh-mariadb105/root/usr/libexec/mysql-prepare-db-dir --defaults-group-suffix=.%I %n (code=exited, status=0/SUCCESS)
  Process: 1958 ExecStartPre=/usr/bin/scl enable $RH_MARIADB105_SCLS_ENABLED -- /opt/rh/rh-mariadb105/root/usr/libexec/mysql-check-socket --defaults-group-suffix=.%I (code=exited, status=0/SUCCESS)
  Process: 1117 ExecStartPre=/usr/bin/scl enable $RH_MARIADB105_SCLS_ENABLED -- /usr/bin/scl_enabled rh-mariadb105 (code=exited, status=0/SUCCESS)
 Main PID: 2290 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/system-rh\x2dmariadb105\x2dmariadb.slice/rh-mariadb105-mariadb@nextcloud.service
           └─2290 /opt/rh/rh-mariadb105/root/usr/libexec/mysqld --defaults-group-suffix=.nextcloud --basedir=/opt/rh/rh-mariadb105/root/usr

Nov 16 22:04:14 aichtalinfo.aichtal.info systemd[1]: Starting MariaDB 10.5 database server...
Nov 16 22:04:20 aichtalinfo.aichtal.info scl[2237]: Database MariaDB is probably initialized in /var/opt/rh/rh-mariadb105/lib/mysql-nextcloud already, nothing is done.
Nov 16 22:04:20 aichtalinfo.aichtal.info scl[2237]: If this is not the case, make sure the /var/opt/rh/rh-mariadb105/lib/mysql-nextcloud is empty before running mysql-prepare-db-dir.
Nov 16 22:04:22 aichtalinfo.aichtal.info mysqld-scl-helper[2290]: 2021-11-16 22:04:22 0 [Note] /opt/rh/rh-mariadb105/root/usr/libexec/mysqld (mysqld 10.5.9-MariaDB) starting as process 2290 ...
Nov 16 22:04:26 aichtalinfo.aichtal.info systemd[1]: Started MariaDB 10.5 database server.
/opt/rh/rh-mariadb105/root/bin/mysqlshow --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock"
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| nextcloud          |
| performance_schema |
+--------------------+
mysqlshow 
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| roundcubemail      |
| sogo               |
+--------------------+
/opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -e 'SELECT user FROM mysql.user'
+-------------+
| User        |
+-------------+
| mariadb.sys |
| mysql       |
| nextcloud   |
| root        |
+-------------+
mysql -e 'SELECT user FROM mysql.user'
+---------------+
| user          |
+---------------+
| root          |
| root          |
| nextcloud     |
| root          |
| roundcubemail |
| sogo          |
+---------------+