nixys / nxs-backup

The tool for creating, delivering and rotating backups for GNU/Linux distributions.
https://nxs-backup.io
Apache License 2.0
156 stars 7 forks source link

SSH_FX_FAILURE when use incremental backup #47

Open rgonzlz opened 3 weeks ago

rgonzlz commented 3 weeks ago

Hi!

When I try to create an incremental backup I get a lot of errors. This is the first time I run the incremental.

INFO [2024-06-07 16:04:39.752] Backup starting.
INFO [2024-06-07 16:04:39.752] No external jobs.
INFO [2024-06-07 16:04:39.752] No databases jobs.
INFO [2024-06-07 16:04:39.752] Starting backup files jobs.
INFO [2024-06-07 16:04:39.753][projets] Starting
WARNING [2024-06-07 16:04:39.787][projets](scp_bk) Unable to get previous metadata 'year.inc' from storage. Error: file does not exist 
WARNING [2024-06-07 16:04:39.787][projets] Failed to find backup year metadata. Error: file does not exist
INFO [2024-06-07 16:04:39.787][projets] Incremental backup will be reinitialized.
DEBUG [2024-06-07 16:04:39.787][projets] Starting rotate outdated backups.
ERROR [2024-06-07 16:04:39.822][projets](scp_bk) Failed to delete '/opt/backups/projets/enk' with next error: file does not exist
DEBUG [2024-06-07 16:04:39.832][projets] Created temp backup /var/backups/tmp_dump/inc_files_2024-06-07_16-04/projets/enk_2024-06-07_16-04.tar.gz
WARNING [2024-06-07 16:04:39.867][projets](scp_bk) Unable to get previous metadata 'year.inc' from storage. Error: file does not exist 
WARNING [2024-06-07 16:04:39.867][projets] Failed to find backup year metadata. Error: file does not exist
INFO [2024-06-07 16:04:39.867][projets] Incremental backup will be reinitialized.
DEBUG [2024-06-07 16:04:39.868][projets] Starting rotate outdated backups.
ERROR [2024-06-07 16:04:39.902][projets](scp_bk) Failed to delete '/opt/backups/projets/prx' with next error: file does not exist
DEBUG [2024-06-07 16:04:41.891][projets] Created temp backup /var/backups/tmp_dump/inc_files_2024-06-07_16-04/projets/prx_2024-06-07_16-04.tar.gz
WARNING [2024-06-07 16:04:41.925][projets](scp_bk) Unable to get previous metadata 'year.inc' from storage. Error: file does not exist 
WARNING [2024-06-07 16:04:41.925][projets] Failed to find backup year metadata. Error: file does not exist
INFO [2024-06-07 16:04:41.925][projets] Incremental backup will be reinitialized.
DEBUG [2024-06-07 16:04:41.925][projets] Starting rotate outdated backups.
ERROR [2024-06-07 16:04:41.959][projets](scp_bk) Failed to delete '/opt/backups/projets/trux' with next error: file does not exist
DEBUG [2024-06-07 16:04:42.263][projets] Created temp backup /var/backups/tmp_dump/inc_files_2024-06-07_16-04/projets/trux_2024-06-07_16-04.tar.gz
INFO [2024-06-07 16:04:42.675][projets](scp_bk) Successfully copied metadata to /opt/backups/projets/enk/2024/inc_meta_info/year.inc
INFO [2024-06-07 16:04:42.881][projets](scp_bk) file /opt/backups/projets/enk/2024/year/enk_2024-06-07_16-04.tar.gz uploaded
INFO [2024-06-07 16:04:43.767][projets](scp_bk) Successfully copied metadata to /opt/backups/projets/prx/2024/inc_meta_info/year.inc
INFO [2024-06-07 16:06:36.376][projets](scp_bk) file /opt/backups/projets/prx/2024/year/prx_2024-06-07_16-04.tar.gz uploaded
INFO [2024-06-07 16:06:37.252][projets](scp_bk) Successfully copied metadata to /opt/backups/projets/trux/2024/inc_meta_info/year.inc
INFO [2024-06-07 16:06:47.609][projets](scp_bk) file /opt/backups/projets/trux/2024/year/trux_2024-06-07_16-04.tar.gz uploaded
DEBUG [2024-06-07 16:06:48.124][projets] Starting rotate outdated backups.
ERROR [2024-06-07 16:06:48.158][projets](scp_bk) Failed to get access to directory '/opt/backups/projets/enk/2023' with next error: file does not exist
ERROR [2024-06-07 16:06:48.193][projets](scp_bk) Failed to get access to directory '/opt/backups/projets/prx/2023' with next error: file does not exist
ERROR [2024-06-07 16:06:48.227][projets](scp_bk) Failed to get access to directory '/opt/backups/projets/trux/2023' with next error: file does not exist
INFO [2024-06-07 16:06:48.227][projets] Finished
ERROR [2024-06-07 16:06:48.228] cmd routine fail: (details: Some of backups failed with next errors:
6 errors occurred:
        * file does not exist
        * file does not exist
        * file does not exist
        * file does not exist
        * file does not exist
        * file does not exist

)
INFO [2024-06-07 16:06:48.228] Backup finished.

Second incremental backup run

INFO [2024-06-07 16:09:04.908] Backup starting.
INFO [2024-06-07 16:09:04.908] No external jobs.
INFO [2024-06-07 16:09:04.909] No databases jobs.
INFO [2024-06-07 16:09:04.909] Starting backup files jobs.
INFO [2024-06-07 16:09:04.909][projects] Starting
WARNING [2024-06-07 16:09:04.943][projects](scp_bk) Unable to get previous metadata 'year.inc' from storage. Error: file does not exist 
WARNING [2024-06-07 16:09:04.943][projects] Failed to find backup year metadata. Error: file does not exist
INFO [2024-06-07 16:09:04.944][projects] Incremental backup will be reinitialized.
DEBUG [2024-06-07 16:09:04.944][projects] Starting rotate outdated backups.
ERROR [2024-06-07 16:09:05.013][projects](scp_bk) Failed to delete '/opt/backups/projects/prx' with next error: sftp: "Failure" (SSH_FX_FAILURE)
DEBUG [2024-06-07 16:09:07.128][projects] Created temp backup /var/backups/tmp_dump/inc_files_2024-06-07_16-09/projects/prx_2024-06-07_16-09.tar.gz
WARNING [2024-06-07 16:09:07.163][projects](scp_bk) Unable to get previous metadata 'year.inc' from storage. Error: file does not exist 
WARNING [2024-06-07 16:09:07.163][projects] Failed to find backup year metadata. Error: file does not exist
INFO [2024-06-07 16:09:07.163][projects] Incremental backup will be reinitialized.
DEBUG [2024-06-07 16:09:07.163][projects] Starting rotate outdated backups.
ERROR [2024-06-07 16:09:07.232][projects](scp_bk) Failed to delete '/opt/backups/projects/trux' with next error: sftp: "Failure" (SSH_FX_FAILURE)
DEBUG [2024-06-07 16:09:07.618][projects] Created temp backup /var/backups/tmp_dump/inc_files_2024-06-07_16-09/projects/trux_2024-06-07_16-09.tar.gz
WARNING [2024-06-07 16:09:07.653][projects](scp_bk) Unable to get previous metadata 'year.inc' from storage. Error: file does not exist 
WARNING [2024-06-07 16:09:07.653][projects] Failed to find backup year metadata. Error: file does not exist
INFO [2024-06-07 16:09:07.653][projects] Incremental backup will be reinitialized.
DEBUG [2024-06-07 16:09:07.653][projects] Starting rotate outdated backups.
ERROR [2024-06-07 16:09:07.722][projects](scp_bk) Failed to delete '/opt/backups/projects/enk' with next error: sftp: "Failure" (SSH_FX_FAILURE)
DEBUG [2024-06-07 16:09:07.727][projects] Created temp backup /var/backups/tmp_dump/inc_files_2024-06-07_16-09/projects/enk_2024-06-07_16-09.tar.gz
INFO [2024-06-07 16:09:07.868][projects](scp_bk) Successfully copied metadata to /opt/backups/projects/enk/2024/inc_meta_info/year.inc
INFO [2024-06-07 16:09:08.013][projects](scp_bk) file /opt/backups/projects/enk/2024/year/enk_2024-06-07_16-09.tar.gz uploaded
ERROR [2024-06-07 16:09:08.151][projects](scp_bk) Unable to create symlink: sftp: "Failure" (SSH_FX_FAILURE)
INFO [2024-06-07 16:09:08.357][projects](scp_bk) Successfully copied metadata to /opt/backups/projects/prx/2024/inc_meta_info/year.inc
INFO [2024-06-07 16:11:00.766][projects](scp_bk) file /opt/backups/projects/prx/2024/year/prx_2024-06-07_16-09.tar.gz uploaded
ERROR [2024-06-07 16:11:00.905][projects](scp_bk) Unable to create symlink: sftp: "Failure" (SSH_FX_FAILURE)
INFO [2024-06-07 16:11:01.078][projects](scp_bk) Successfully copied metadata to /opt/backups/projects/trux/2024/inc_meta_info/year.inc
INFO [2024-06-07 16:11:08.495][projects](scp_bk) file /opt/backups/projects/trux/2024/year/trux_2024-06-07_16-09.tar.gz uploaded
ERROR [2024-06-07 16:11:08.564][projects](scp_bk) Unable to create symlink: sftp: "Failure" (SSH_FX_FAILURE)
ERROR [2024-06-07 16:11:08.601][projects] Failed to delivery backup. Errors: 3 errors occurred:
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)

DEBUG [2024-06-07 16:11:08.656][projects] Starting rotate outdated backups.
ERROR [2024-06-07 16:11:08.691][projects](scp_bk) Failed to get access to directory '/opt/backups/projects/enk/2023' with next error: file does not exist
ERROR [2024-06-07 16:11:08.731][projects](scp_bk) Failed to get access to directory '/opt/backups/projects/prx/2023' with next error: file does not exist
ERROR [2024-06-07 16:11:08.766][projects](scp_bk) Failed to get access to directory '/opt/backups/projects/trux/2023' with next error: file does not exist
INFO [2024-06-07 16:11:08.767][projects] Finished
ERROR [2024-06-07 16:11:08.768] cmd routine fail: (details: Some of backups failed with next errors:
9 errors occurred:
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)
        * sftp: "Failure" (SSH_FX_FAILURE)
        * file does not exist
        * file does not exist
        * file does not exist

)
INFO [2024-06-07 16:11:08.768] Backup finished.

nxs-backup.conf

server_name: srv1
project_name: infra

loglevel: info

notifications:
  mail:
    enabled: true
    mail_from: xxxx
    smtp_server: xxxxx
    smtp_port: 25
    smtp_user: xxxx
    smtp_password: xxxxx
    message_level: debug
    recipients:
      - xxxxxx
  webhooks:
    enabled: false

storage_connects:
- name: scp_bk
  scp_params:
    host: xxxxxx
    port: 22
    user: backups
    key_file: srv-backups
    connection_timeout: 10
jobs: []
include_jobs_configs: [ "./conf.d/*.conf" ]

projects.conf

job_name: projects
type: inc_files
tmp_dir: /var/backups/tmp_dump

sources:
- name: "projects"
  save_abs_path: yes
  targets:
    - /opt/projects/enk
    - /opt/projects/prx
    - /opt/projects/trux
  gzip: true

storages_options:
- storage_name: scp_bk
  backup_path: /opt/backups/projects
  retention:
    days: 30
    weeks: 4
    months: 12

NXS version: 3.7.0 Platform: Ubuntu 22

randreev1321 commented 3 weeks ago

Hi, @rgonzlz.

Thanks for your interest in nxs-backup.

The file does not exist errors were not handled and returned to you, which is a bug. This point will be corrected.

The SSH_FX_FAILURE error requires further analysis.

We will try to solve it in the nearest future.