Koozali.org: home of the SME Server

SMEServer 10 - Backup and Restore cannot mount cifs

Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
SMEServer 10 - Backup and Restore cannot mount cifs
« on: June 16, 2021, 08:51:23 AM »
Thank you for the new release.

I'm now trying to migrate my V9 setup to V10 first by restoring backup from workstation but I'm just getting:

Code: [Select]
Updating workstation backup configuration

The parameters have been saved, however the remote host is not reachable, please check your settings.
mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

My V9 setup connects just fine. 

I've also tried NFS and also getting error as below:

Code: [Select]
Updating workstation backup configuration

The parameters have been saved, however the remote host is not reachable, please check your settings.
mount.nfs: access denied by server while mounting 172.27.7.77:/volume1/server-backup

I can ping the remote share fine from console so it should be reachable:

Code: [Select]
[root@www ~]# ping 172.27.7.77
PING 172.27.7.77 (172.27.7.77) 56(84) bytes of data.
64 bytes from 172.27.7.77: icmp_seq=1 ttl=64 time=0.139 ms
64 bytes from 172.27.7.77: icmp_seq=2 ttl=64 time=0.178 ms
64 bytes from 172.27.7.77: icmp_seq=3 ttl=64 time=0.158 ms
64 bytes from 172.27.7.77: icmp_seq=4 ttl=64 time=0.157 ms
64 bytes from 172.27.7.77: icmp_seq=5 ttl=64 time=0.176 ms
64 bytes from 172.27.7.77: icmp_seq=6 ttl=64 time=0.167 ms
64 bytes from 172.27.7.77: icmp_seq=7 ttl=64 time=0.170 ms
64 bytes from 172.27.7.77: icmp_seq=8 ttl=64 time=0.194 ms
64 bytes from 172.27.7.77: icmp_seq=9 ttl=64 time=0.160 ms
64 bytes from 172.27.7.77: icmp_seq=10 ttl=64 time=0.183 ms

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #1 on: June 16, 2021, 09:42:08 AM »
to help you we need to know more about your backup destination.


if SME is able to connect to it using CIFS it tells us that it is mostly using smb v1 which is deprecated.
by default SME10 does not allow connection to such share as it is insecure. However, you could choose to tick the option to allow connecting to smbv1 when configuring the workstation backup.

NFS is a different way to connect, and needs a specific configuration based on ip. HAve you configured a proper nfs acces to the new SME ip on you backup device ?


Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #2 on: June 16, 2021, 10:31:28 AM »
SME9 connects well with no problem.

My backup share is hosted on a synology device and the smb version is 4.4.16 at the moment.
Code: [Select]
admin@aims-synobu2:/$ samba -V
Version 4.4.16

By the way, connection via NFS works now. I've started the restore from workstation process, hopefully everything goes well.

Thanks for your quick reply!

Kudos to the team!
« Last Edit: June 16, 2021, 10:53:15 AM by HACKERSOFT2011 »

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #3 on: June 16, 2021, 10:54:13 AM »
great for NFS.

please note the difference between the software samba and the protocol SMB. I did speak about the protocol SMBv1, not the version of the software.
Again if SME9 is able to connect using CIFS/SMB, then your synology is setup to use insecure deprecated  protocol SMBv1.
You should fix that.

Also note that NFS is insecure too, and should not be used on a not trusted network, unless you use NFS v4 with encryption.

Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #4 on: June 16, 2021, 11:30:44 AM »
Thanks for the tip!

By the way the restore was completed, the server restarted but I can no longer access the web GUI.

This is probably due to the installed PHP-SCL on my SME9 setup. 

Now I'm on the road to figuring out how to make the GUI and the web services work.

I've noticed the default installed php version is still 5.4.16, is there a quick guide to upgrade to at least 7.3 or 7.4? 

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #5 on: June 16, 2021, 12:56:53 PM »
httpd-e-smith will use php-fpm 7.4 as default

just ignore what will say php command from command line. and this php version is supported by red hat with all security bug, so technically not EOL

remove all your custom template for httpd.conf, we do not use php module anymore, any reference to it will crash your httpd service.

check the log /var/log/httpd/error_log for more info
« Last Edit: June 16, 2021, 12:58:37 PM by Jean-Philippe Pialasse »

Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #6 on: June 16, 2021, 02:41:27 PM »
Thanks again for your reply!

I've deleted all custom-templates for httpd and the web gui now works.

Now, the problem is it seems like all web services can no longer connect to the MySQL databases.

I have moodle, wordpress, etc and all cannot connect to the mysql database anymore. I'm still trying to figure out what has changed and how to make it work.



Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #7 on: June 16, 2021, 09:00:17 PM »
any custom templates against /etc/my.cnf
?

what says
systemctl status -l mariadb

Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #8 on: June 17, 2021, 03:33:38 AM »
No, I don't have any custom template for /etc/my.cnf


systemctl status -l mariadb:

Code: [Select]
[root@sme1 ~]# systemctl status -l mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/mariadb.service.d
           └─50koozali.conf
   Active: active (running) since Wed 2021-06-16 18:56:10 +07; 13h ago
  Process: 2288 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 1525 ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize (code=exited, status=0/SUCCESS)
  Process: 1461 ExecStartPre=/sbin/e-smith/expand-template /etc/my.cnf (code=exited, status=0/SUCCESS)
  Process: 1412 ExecStartPre=/sbin/e-smith/expand-template /root/.my.cnf (code=exited, status=0/SUCCESS)
  Process: 1253 ExecStartPre=/sbin/e-smith/expand-template /var/lib/mysql/set.password (code=exited, status=0/SUCCESS)
  Process: 1172 ExecStartPre=/sbin/e-smith/service-status mariadb (code=exited, status=0/SUCCESS)
 Main PID: 2287 (mysqld)
   Memory: 1.1G
   CGroup: /system.slice/mariadb.service
           └─2287 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mariadb/mariadb.pid

Jun 16 18:56:03 sme1.web.aims.ac.th systemd[1]: Starting MariaDB database server...
Jun 16 18:56:03 sme1.web.aims.ac.th mariadb-initialize[1525]: 210616 18:56:03 [Note] /usr/libexec/mysqld (mysqld 5.5.68-MariaDB) starting as process 1528 ...
Jun 16 18:56:08 sme1.web.aims.ac.th mysqld[2287]: 210616 18:56:08 [Note] /usr/libexec/mysqld (mysqld 5.5.68-MariaDB) starting as process 2287 ...
Jun 16 18:56:10 sme1.web.aims.ac.th systemd[1]: Started MariaDB database server.


Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #9 on: June 17, 2021, 06:51:32 AM »
have you configured your apps to connect using port or unix socket ?

i suggest using unix socket.

Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #10 on: June 18, 2021, 03:18:51 AM »
I was able to make it work for some web applications that uses PDO for connections by install the php74-php-pdo.

Now only web apps that need to connect using mysqli does not work.

Running rpm -qa | grep mysql returns:
Code: [Select]
php71-php-mysqlnd-7.1.33-13.el7.remi.x86_64
php72-php-pecl-mysql-1.0.0-0.17.20160812git230a828.el7.remi.x86_64
php70-php-pecl-mysql-1.0.0-0.9.20151007git294ce3b.el7.remi.x86_64
php71-php-pecl-mysql-1.0.0-0.15.20160812git230a828.el7.remi.x86_64
php-mysqlnd-5.4.16-48.el7.x86_64
php70-php-mysqlnd-7.0.33-26.el7.remi.x86_64
php73-php-mysqlnd-7.3.28-1.el7.remi.x86_64
php72-php-mysqlnd-7.2.34-4.el7.remi.x86_64
php55-php-mysqlnd-5.5.38-12.el7.remi.x86_64
php73-php-pecl-mysql-1.0.0-0.20.20180226.647c933.el7.remi.x86_64
php56-php-mysqlnd-5.6.40-26.el7.remi.x86_64
php74-php-mysqlnd-7.4.20-1.el7.remi.x86_64
php74-php-pecl-mysql-1.0.0-0.23.20190415.d7643af.el7.remi.x86_64
php80-php-mysqlnd-8.0.7-1.el7.remi.x86_64
e-smith-mysql-2.6.0-21.el7.sme.noarch


I tried to re-install say moodle and it cannot find a way to connect to the database. The same is true with wordpress.

I tried inputting  /var/lib/mysql/mysql.sock   in the Unix socket field and it is just saying:

Code: [Select]
Error: Database connection failed

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php


Any work-around for this?


Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #11 on: June 18, 2021, 12:12:26 PM »
for wordpress

define( 'DB_HOST', 'localhost:/var/lib/mysql/mysql.sock' );


please for other software refer to their documentation.  this is mot SME specific.


mysqli is provided by mysqlnd

Offline HACKERSOFT2011

  • *
  • 31
  • +0/-0
  • HACKERSOFT
    • Adventist International Mission School
Re: SMEServer 10 - Backup and Restore cannot mount cifs
« Reply #12 on: June 19, 2021, 03:39:56 PM »
I'm sorry if this is not SME Server specific but I am still trying to figure out what's breaking the previous install after upgrading and how to fully migrate to version 10 successfully without breaking our currently used web apps.

I'm still tinkering and checking on things not working and why it no longer works after the upgrade. Hopefully, I'll figure out workarounds and finally settle with version 10.

Thanks anyways for your replies, I do appreciate it.