[Fallback] Backup and restore automatically your server

Hi !
Sorry, i was very busy this week-end.

Still doesn’t work at night, i got this :

ssh: Could not resolve hostname p: No address associated with hostname
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2] 

But works with this :

sudo ssh fallback@backup.ndd.tld -i /opt/yunohost/fallback/send_process/ssh_key -v

Did you remove the domain name ? is it really what you got ?
If yes, check the syntax, you may have an error.

Sorry i didn’t have time to watch before today.

So i watched why i got this message and didn’t know why.
I deleted Fallback and installed it again and it works !

Thx for your help Maniack ! :slight_smile:
Have a good weekend !

Hi it’s me again ! :sweat_smile:

When i add Seafile to the list of app, Fallback can’t backup it. Maybe because i have 500Go of datas, so it’s too heavy i don’t know.

I got this in the mail :

Traceback (most recent call last):
  File "/usr/bin/yunohost", line 214, in <module>
timeout=opts.timeout,
  File "/usr/lib/python2.7/dist-packages/moulinette/__init__.py", line 136, in cli
moulinette.run(args, output_as=output_as, password=password, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/cli.py", line 425, in run
ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 523, in process
return func(**arguments)
  File "/usr/lib/moulinette/yunohost/backup.py", line 2090, in backup_create
backup_manager.backup()
  File "/usr/lib/moulinette/yunohost/backup.py", line 745, in backup
method.mount_and_backup(self)
  File "/usr/lib/moulinette/yunohost/backup.py", line 1513, in mount_and_backup
self.backup()
  File "/usr/lib/moulinette/yunohost/backup.py", line 1733, in backup
shutil.copytree(source, dest)
  File "/usr/lib/python2.7/shutil.py", line 208, in copytree
raise Error, errors
shutil.Error: [('/opt/yunohost/seafile/ccnet/ccnet.sock', '/home/yunohost.app/fallback/fallback_backup/temp_fallback_backup/apps/seafile/backup/opt/yunohost/seafile/ccnet/ccnet.sock', "[Errno 6] No such device or address: '/opt/yunohost/seafile/ccnet/ccnet.sock'")]

  Debian GNU/Linux 9 (stretch)

  Linux nsXXXXX.ip-XX-XXX-XXX.eu 4.19-ovh-xxxx-std-ipv6-64 #1079069 SMP Mon Jan 20 08:31:48 UTC 2020 x86_64 GNU/Linux


  Server    : XXXXX
  IPv4        : XXX.XXX.XXX.XXX
  IPv6        : XXXXXXXXXXXXXX
  Hostname    : nsXXXXX.ip-XXX-XXX-XXX.eu

bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
sending incremental file list
.d..t...... backup/
<f..t...... backup/app_list
<f..t...... backup/config.conf
<f..t...... backup/ip_main_server
<f.st...... backup/nextcloud_fallback_bck.tar.gz
<f.st...... backup/roundcube_fallback_bck.tar.gz
<f.st...... backup/system_fallback_bck.tar.gz

Number of files: 10 (reg: 9, dir: 1)
Number of created files: 0
Number of deleted files: 0
Number of regular files transferred: 6
Total file size: 293.55M bytes
Total transferred file size: 194.09M bytes
Literal data: 102.73M bytes
Matched data: 91.36M bytes
File list size: 0
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 102.80M
Total bytes received: 166.82K

sent 102.80M bytes  received 166.82K bytes  7.10M bytes/sec
total size is 293.55M  speedup is 2.85

Fallback is using the yunohost backup moulinette, right ? Maybe i should ask to a yunohost dev ?

Thanks for your help

That’s an error on seafile side, as you can see, the error is

[Errno 6] No such device or address: '/opt/yunohost/seafile/ccnet/ccnet.sock'

And indeed, the backup can’t usually backup a socket, which is not a standard file.
You should open an issue on seafile repo to ask for a fix.

Ok i’ll see that.
Thanks for your help

Hi everyone and @Maniack_Crudelis,

Today I realised that the app is no longer maintained. I had to reinstall it and it no longer works at all… Are there any further plans?
Does anyone use a different way to maintain a fallback server?

Many thanks!

I still use that app for my personnal server, but I didn’t check it recently.
Could you tell me what was the error ?

Hi,
Thanks for your reply.
I’m having this:

usage: yunohost {backup} ...
               [-h] [--output-as {json,plain,none}] [--debug] [--quiet]
               [--timeout ==SUPPRESS==] [-v]
yunohost: error: unrecognized arguments: --no-compress

I’ve deleted the --no-compress in send_backup.sh but that hasn’t helped either.

Any ideas would be much appreciated.

That the same issue as for Archivist…
I’ll fix it, I need it as well

1 Like

Thank you. Looking forward to your update. As I’ve said before, I don’t know how others do it.

Fix available on this branch Fix YunoHost 4.1 by maniackcrudelis · Pull Request #23 · YunoHost-Apps/fallback_ynh · GitHub

To be tested though…

I apologise for the late reply.
How can I test it please?

With the command line:

yunohost app upgrade fallback -u https://github.com/YunoHost-Apps/fallback_ynh/tree/fix_41 --force

:crossed_fingers:

Excellent, thank you!
Will get back here as soon as I’m done.

1 Like

So far so good.

Info: Now upgrading fallback…

Info: [++…] > Loading installation settings…

Info: [##+…] > Ensuring downward compatibility…

Info: [###+++…] > Backing up the app before upgrading (may take a while)…

Info: [######++…] > Upgrading source files…

Warning: lsof: WARNING: can’t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs

Warning: Output information may be incomplete.

Info: [########++++++…] > Upgrading dependencies…

Warning: lsof: WARNING: can’t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs

Warning: Output information may be incomplete.

Warning: lsof: WARNING: can’t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs

Warning: Output information may be incomplete.

Warning: lsof: WARNING: can’t stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs

Warning: Output information may be incomplete.

Info: [##############+…] > Reconfiguring Fallback…

Info: [###############…] > Updating the cron…

Warning: grep: /etc/yunohost/apps/fallback/status.json: No such file or directory

Info: [###############++…] > Upgrading logrotate configuration…

Warning: grep: /etc/yunohost/apps/fallback/status.json: No such file or directory

Warning: grep: /etc/yunohost/apps/fallback/status.json: No such file or directory

Warning: Unable to build the changelog…

Info: [####################] > Upgrade of fallback completed

Success! fallback upgraded

Success! Upgrade complete

Not sure why I get the initial warnings (I always get them so not an issue here).
I’ve now launched an backup with send_process.sh > waiting for result.

OK here are some results @Maniack_Crudelis and @tituspijean

(excerpts from the log file)

App save failed :

> Make a temporary backup for agendav_fallback_bck
>> This backup is different than the previous one
>>> Make a real backup for agendav_fallback_bck
Collecting files to be backed up for agendav...
Could not back up agendav
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 72, in <module>
    parser=parser
  File "/usr/lib/moulinette/yunohost/__init__.py", line 29, in cli
    top_parser=parser
  File "/usr/lib/python2.7/dist-packages/moulinette/__init__.py", line 120, in cli
    args, output_as=output_as, timeout=timeout
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/cli.py", line 477, in run
    ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 592, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/backup.py", line 2056, in backup_create
    backup_manager.collect_files()
  File "/usr/lib/moulinette/yunohost/backup.py", line 507, in collect_files
    self._collect_apps_files()
  File "/usr/lib/moulinette/yunohost/backup.py", line 639, in _collect_apps_files
    self._collect_app_files(app_instance_name)
  File "/usr/lib/moulinette/yunohost/backup.py", line 716, in _collect_app_files
    filesystem.rm(tmp_script, force=True)
UnboundLocalError: local variable 'tmp_script' referenced before assignment
./send_backup.sh: line 137: ynh_compress_backup: command not found
>>>> Encryption of agendav_fallback_bck
ccrypt: /home/yunohost.app/fallback/fallback_backup/backup/agendav_fallback_bck.tar.gz: No such file or directory

System backup failed too:

> Make a temporary backup for system_fallback_bck
>> This backup is different than the previous one
>>> Make a real backup for system_fallback_bck
The backup hook 'conf_ynh_mysql' is unknown
[Error] Destination path 'conf/ldap/ldap.conf' already exist
Could not run script: /usr/share/yunohost/hooks/backup/05-conf_ldap
[Error] Destination path 'conf/ssowat' already exist
Could not run script: /usr/share/yunohost/hooks/backup/14-conf_ssowat
[Error] Destination path 'conf/ynh/certs' already exist
Could not run script: /usr/share/yunohost/hooks/backup/21-conf_ynh_certs
[Error] Destination path 'data/mail' already exist
Could not run script: /usr/share/yunohost/hooks/backup/23-data_mail
[Error] Destination path 'conf/xmpp/etc' already exist
Could not run script: /usr/share/yunohost/hooks/backup/26-conf_xmpp
[Error] Destination path 'conf/nginx' already exist
Could not run script: /usr/share/yunohost/hooks/backup/29-conf_nginx
[Error] Destination path 'conf/cron/yunohost' already exist
Could not run script: /usr/share/yunohost/hooks/backup/32-conf_cron
[Error] Destination path 'conf/ynh/current_host' already exist
Could not run script: /usr/share/yunohost/hooks/backup/40-conf_ynh_currenthost
Could not backup the 'data_mail' system part
Could not backup the 'conf_cron' system part
Could not backup the 'conf_ynh_certs' system part
Could not backup the 'conf_xmpp' system part
Could not backup the 'conf_ynh_currenthost' system part
Could not backup the 'conf_nginx' system part
Could not backup the 'conf_ssowat' system part
Could not backup the 'conf_ldap' system part

Nothing to save

./send_backup.sh: line 106: ynh_compress_backup: command not found
>>>> Encryption of system_fallback_bck
ccrypt: /home/yunohost.app/fallback/fallback_backup/backup/system_fallback_bck.tar.gz: No such file or directory

Hope this helps. Please let me know if I can do anything else.

Your first error seems to be related to the backup of Agendav itself, either the backup script of the app or an error with YunoHost.

You should try to backup the app manually from the admin panel or CLI to see if that script works.

The second one for the core is a common error, aparently never fixed…
If YunoHost fails a backup for whatever reason, you’re screw for any other backup you want to do afterward…

Clean the content of /home/yunohost.backup/tmp/ to fix that second error.

OK, script works.

Checked /home/yunohost.backup/tmp = empty

Launching > ./send_backup.sh again.

I was quite sure I did remove that already…
But it was in Archivist, not in this one !