Backup did not work

NethServer release 7.9.2009 (final)
Module: Backup
Good Evening Guys, i still struggle with the Backup and i really did not get it working. I cancel to try the sftp solution cause there is something not working from transmitting the passwort. Now i try to do a backup on a nfs share, but still no luck. I got this error when i try to backup data:

Backup: backup-data
Backup started at 2021-12-17 16:27:46
Pre backup scripts status: SUCCESS
Error while mounting 192.168.2.2:Server\sicherungsbs : mount.nfs: access denied by server while mounting 192.168.2.2:Server\sicherungsbs at /etc/e-smith/events/actions/mount-nfs line 88.
Can’t mount /mnt/backup-backup-data
Action ‘backup-data-duplicity backup-data’: FAIL
Backup status: FAIL.
And i have only the possibility doing a config with the old server manager, the new one did not open up for backup, just a spinning wheel how i explained in my message from yesterday. Did someone have an advice? Thanks a lot.

Try to provide more info on your installation, where you’re going to backup your server and how did you set it. No one on the other side of the screen is aware of your environment :slight_smile:
If you feel to post screenshot, consider to post them in english and avoiding big (pixels x pixels) images, so anyone is able to read them, even on smartphones.

1 Like

I think there should be a slash instead of a backslash like

192.168.2.2:/Server/sicherungsbs

or maybe it’s a permission issue.

1 Like

Hi,

perhaps “sicherungssbs”? - in german I would have writen it like this?

1 Like

first of all, thank you very much for your answers.

The installation is actually very simple. I try to backup to a NFS share of the same server, this backup is then copied to a device outside the building at a later time. But the NFS share has some kind of problem, the name is correct, it’s called sicherungsbs. I think it’s indeed a permission problem, but I can’t find it. When I start the backup manually, everything works until I mount the NFS share.

Hi

NFS to itself will often cause problems…
It starts with do I use localhost (127.0.0.1) or the IP.
Even if you add in both you’ll still have problems…

Anyway, a backup on itself is never a good idea - even if you’re planning on using some last century method to move the data… It used to be called “Sneaker-Net” instead of “Ether-Net”…

rsync offsite is MUCH better and reliable!

:slight_smile:

My 2 cents
Andy

1 Like

I think there’s a misconfiguration and you should clean up the backups db.

Please backup the configuration first.

To show the backup entries:

db backups keys

Delete them one after the other:

db backups delete <key>

Now it should be possible to create a backup in cockpit.

As @Andy_Wismer already explained, it’s not a good idea. I think we should find a way to make SFTP work to do rsync or restic backup.

You need to use the interface IP address, localhost doesn’t work:

I think you need to exclude the backup location from the backup to avoid a backup of the backup.

1 Like

@hucky am i wrong or… you tweaked a lot the configuration and the system?
I don’t remember NethServer as NFS-shares server.
May I assume that you “Nethfied” a CentOS 7 installation?

1 Like

There’s an NFS module in the wiki.

1 Like

first again thank you for helping me guys. i was able with the advice from @mrmarkuz to delete the wrong backup configuration and the cockpit backup site comes up. and yes, i installed the nfs share possibility from the wiki, but it did not work. it would be a dream to get it done with sftp, i see at the synology nas outside the LAN that the connection comes in but i am not able to get the connection running cause it says allways the password is wrong, but it is not. somone told me that it would not be working that way. he describe it “nethserver-backup needs to be able to ssh into the server before initiating the SFTP connection. In a way it’s more SFTP over SSH than pure SFTP.” but ssh is possible, just not with the standard port. this is the message on the nas system
User [backup] from [xxx.xxx.xxx.xxx] failed to log in via [SSH] due to authorization failure.
Got the loggin working now, i see the client connect, but i am not sure what i need to wrote as SFTP Directory if i do the checkup, i see login worked, but i guess the directory maybe is wrong…
i found this in messages.log:
Dec 21 17:16:28 server cockpit-bridge: ECDSA host key for IP address ‘xxx.xxx.xx.xxx’ not in list of known hosts.
Dec 21 17:16:28 server cockpit-bridge: touch: cannot touch ‘/backup/backup/Server/tmp.NY5jobE4RU’: No such file or directory

Great, did you go through configuring an SFTP backup? Did it pass the check?

This is strange, as you did connect by SSH already.

Please login to the NAS via SSH as the backup user and check the present working dir with:

pwd

This path should be the first part of the used path for the backup settings in NethServer.

1 Like

i am one step further, i had to change the backup client to admins group for getting the connection done, now this is working and also the path i checked, is doing the connection. the check from Cockpit Backup works, it safes the Backup Job etc. But somehow it does not finishing the backup job. after the whole prebackup stuff is done i got this error:

Backup: sicherungsbs
Backup started at 2021-12-22 10:10:00
Pre backup scripts status: SUCCESS
subprocess ssh: Permission denied, please try again.
subprocess ssh: Authentication failed.
Fatal: create repository at sftp:backup@xxx.xxx.xx:/var/services/homes/backup failed: unable to start the sftp session, error: read |0: file already closed

subprocess ssh: ssh_exchange_identification: read: Connection reset by peer
Fatal: unable to open repo at sftp:backup@xxx.xxx.xx:/var/services/homes/backup: unable to start the sftp session, error: EOF
Backup failed
Action ‘backup-data-restic sicherungsbs’: FAIL
Backup status: FAIL

But i saw at the beginning also that the backup do login correct, but with the backup something changed. it becomes an authorization error and after 5 times it got blocked from the Nas System.

good morning everyone, purtroppo no luck with the backup. i have no idea how to go further cause the main things are working. when the backup starts i got this result:

Backup: sicherungsbs
Backup started at 2021-12-28 21:05:02
Pre backup scripts status: SUCCESS
subprocess ssh: Permission denied, please try again.
subprocess ssh: Authentication failed.
Fatal: create repository at sftp:backup@xxx.xx.xx:/var/services/homes/backup failed: unable to start the sftp session, error: EOF
subprocess ssh: ssh_exchange_identification: read: Connection reset by peer
Fatal: unable to open repo at sftp:backup@xxx.xx.xx:/var/services/homes/backup: unable to start the sftp session, error: EOF Backup failed Action ‘backup-data-restic sicherungsbs’: FAIL Backup status: FAIL

has anyone got the backup working with sftp?

I think the NAS still restricts SSH login in some way. Only pre-backup is working, the main backup process fails.

Did you try to connect via SSH to the NAS i.e. with putty?

Which NAS do you use for backup? Maybe we can find something in the manual…

Yes, it works i.e. with NethServer as SFTP host.

2 Likes

Hi

Most commercial NAS like Synology or Qnap will not easily work.
SSH login as root isn’t allowed, only as admin.
And admin is not root, nor has equal rights!

admin can’t set via SSH permissions…

This is often an issue, even when using rsync, an “officially” supported backup protocoll…

I have one client with 2 Snyology medium 8-Bay NAS. One in the office, the other at home as Off-Site Backup.

Rsync will give me a lot of errors relating to permissions, even though i use the ignore permssions flag (all options, groups et al.) in the rsync command…

:frowning:

My 2 cents
Andy

1 Like

its an synology nas a 2 bay, 2014 play. it is just for doing the backups. i can log via putty as admin.
so i would give also rsync a chance, i saw in the past that there is an option to set for rsync. @Andy_Wismer du you have an howto for the configuration?
I just try to log via ssh by the backup user, its also possible to log in via ssh and go into the directory then
grafik

and again, thanks a lot for helping me guys.

The 2 Bay Synos only allow Ext4, no Btrfs (Much better, as size restrictions actually work across all OS…).

I evade the 2 Bays…

I had to leave it to using Duplicity…
The others never worked, or only once…

Duplicity works, no issues. It’s not the most modern, not the fastest, but it works!

I do have about 25 clients using Synology…

My 2 cents
Andy

1 Like

hmm… i am confused now. the backup system of the nethserver is not possible to make a connection to a synology nas by sftp? okay. so, the nethserver is also not possible doing it with rsync? so the only possibility doing it is with duplicity and over sftp? is this correct? is there maybe a howto?
And how does other people make the backups out of the Lan?

Yes, or the NAS does not provide a proper SSH connection for restic or rsync.

Here’s a tutorial about enabling ssh/sftp/home dir and login without password. I hope it helps to make backups work on the NAS:

The problem is the SSH connection so all backups over SFTP/SSH like rsync or restic won’t work.

Not over sftp but all other backup methods should work for example using duplicity on a NAS samba share.

Just some ideas:

Use SSH/SFTP on a NethServer:

NethServer supports B2 with restic:

1 Like

@mrmarkuz Hey Markus, thanks a lot again for checking things out for me. Its a bit irritating me, that the Backup is so… difficult from my point of view, not to complain just for saying. I got it done now with one step more, but it doesent worked with the normal backup system. i do a rsync on a network share with all the for me important data and then, ones at night i copy it via sftp from a client at an extern nas system.

Again thanks a lot for everyone who try to be helpful, wish everyone a good start into the second week of the year. (mabe also a happy new year to everyone who read this, its not so old the year) :sweat_smile:

1 Like