mcrudelis / archivist

GNU General Public License v3.0
10 stars 3 forks source link

Attempting to upload backups to another server via SSH fails, causes the encrypted backups to be deleted #17

Open csolisr opened 2 years ago

csolisr commented 2 years ago

When attempting to run Archivist, the section where it uploads the backup to an external server via SSH and rsync fails with no apparent reason. Please review the log file: archivist-log.txt

Relevant lines:

rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/ePSWKxAbTsIp783m7,7g8vob,kw56QlWemCzRPwUD2sp9,") failed: Input/output error (5)

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1333) [sender=3.2.3]

Furthermore, after the script finishes running, the whole /home/yunohost.app/archivist/encrypted_backup/ folder is completely empty, likely a side effect of the rsync process failing to send files to the external server.

maniackcrudelis commented 2 years ago

Hello

The encrypted directory is expected to be empty after the operation, because this directory is only an encrypted mount of the real directory, it doesn't really contain anything. But, in your case, with a previous copy of 11G, I suspect encfs umount the directory too early during the previous local rsync. Which would be obviously an error on Archivist side no one encountered before.

I believe that to add mount_encrypt_directory at the line 726 may be a solution.

Could you try that ?

csolisr commented 2 years ago

I will try to do that as soon as my backups sync with my main computer via Nextcloud. (That might take a while since it's 11 GB)

csolisr commented 2 years ago

Just tried your tip, and while the files are not deleted anymore, they're still not being transferred either:

> Clean old backup files
> Encrypt backups

-> Build the list of files for the recipient local
> Copy backups files in /home/yunohost.multimedia/share/archives.
building file list ... done
.d..tpog... ./
.d..tpog... ynh_backup/
>f..tpog... ynh_backup/archivist_backup.info.json
>f.stpog... ynh_backup/archivist_backup.tar.zst
.f...pog... ynh_backup/collabora_backup.info.json
.f...pog... ynh_backup/collabora_backup.tar.zst
.f...pog... ynh_backup/converse_backup.info.json
.f...pog... ynh_backup/element_backup.info.json
.f...pog... ynh_backup/element_backup.tar.zst
>f..tpog... ynh_backup/gitea_backup.info.json
>f.stpog... ynh_backup/gitea_backup.tar.zst
.f...pog... ynh_backup/halcyon_backup.info.json
.f...pog... ynh_backup/halcyon_backup.tar.zst
>f..tpog... ynh_backup/jellyfin_backup.info.json
>f.stpog... ynh_backup/jellyfin_backup.tar.zst
.f...pog... ynh_backup/jitsi_backup.info.json
.f...pog... ynh_backup/jitsi_backup.tar.zst
.f...pog... ynh_backup/librespeed_backup.info.json
.f...pog... ynh_backup/librespeed_backup.tar.zst
>f..tpog... ynh_backup/nextcloud_backup.info.json
>f.stpog... ynh_backup/nextcloud_backup.tar.zst
>f..tpog... ynh_backup/pleroma_backup.info.json
>f.stpog... ynh_backup/pleroma_backup.tar.zst
.f...pog... ynh_backup/prosody_backup.info.json
.f...pog... ynh_backup/prosody_backup.tar.zst
>f..tpog... ynh_backup/roundcube_backup.info.json
>f.stpog... ynh_backup/roundcube_backup.tar.zst
.f...pog... ynh_backup/searx_backup.info.json
.f...pog... ynh_backup/searx_backup.tar.zst
>f..tpog... ynh_backup/synapse_backup.info.json
>f.stpog... ynh_backup/synapse_backup.tar.zst
>f..tpog... ynh_backup/vaultwarden_backup.info.json
>f.stpog... ynh_backup/vaultwarden_backup.tar.zst
>f..tpog... ynh_backup/ynh_core_backup.info.json
>f.stpog... ynh_backup/ynh_core_backup.tar.zst

Number of files: 35 (reg: 33, dir: 2)
Number of created files: 0
Number of deleted files: 0
Number of regular files transferred: 18
Total file size: 10.50G bytes
Total transferred file size: 10.37G bytes
Literal data: 10.37G bytes
Matched data: 0 bytes
File list size: 0
File list generation time: 0.015 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 10.37G
Total bytes received: 416

sent 10.37G bytes  received 416 bytes  21.49M bytes/sec
total size is 10.50G  speedup is 1.01

-> Build the list of files for the recipient rsync
> Copy backups files in /home/admin/archives.
building file list ... 
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/ePSWKxAbTsIp783m7,7g8vob,kw56QlWemCzRPwUD2sp9,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/npEefKTegAs1pMeV91fH5eDLfe6w8DST0BVVyFu6pM8lA1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/N-mw,B4Bzn4X,DuRUY-i6dl8qlIuL5Di39PHoWusebKxI1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/4S4TTVm6vBg7I8Otr9EMoFpmcmd57Wla2bddVoQAab,nh0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/cBM05kqVej-SgXvkRQAnHGDiB73UtskEDahKyw5MxoKKU,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/et4hiIN4YU4NacNFz,PhtOuVAPhZ8LRy4dTa,cTQVOOse,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/WOEMJ0a9wgaEMWq2OWKguEabxmx,6v0UpTX2nbj9r6uYy0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/JDFbKtr9ltl0PMipTRsOnb0EIbzLqUHXJy,Cadn6VG2ws1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/hsp9AsghoyQkLJE24xk5CaQJsOmhvWl89A-zBiLLj9cUC1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/lK8K75-JKjF1D8L65TxEEczb8UqAtWdTHMtL3DzeYrcek0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/PBsvs0bC-Viu7we2u0aFkPoyeb9egfYnjKEpnxBsbNkoy0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/CnpPuAtzPacnKCF5S1Byibz2xVjHdsv,mzfCxphiiP6301") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/U8FsQtLIjLFuVJYOCNZk,JMvDe3iApLK1POagGKSUEngS-") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/qQLccekXvreY,fvHsQAqngD-liB3bebJ7suPNryhgdX-e,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/uMCMNB1ZLwwhvzGKpRLB3wb7yx0TOdXrNuK,QJWag6D2-1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/UCHh8f24i7FY695aWLirRYXsXd54QdByRWwdXbSVkYq3u1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/f5A5klalol9Fi5A1abHTUGB5jomYU0VMay6paOKXQwEHz1") failed: Input/output error (5)
done
IO error encountered -- skipping file deletion
.d..t...... ./

Number of files: 2 (dir: 2)
Number of created files: 0
Number of deleted files: 0
Number of regular files transferred: 0
Total file size: 0 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 0
File list generation time: 0.120 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 88
Total bytes received: 77

sent 88 bytes  received 77 bytes  47.14 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1333) [sender=3.2.3]
maniackcrudelis commented 2 years ago

I wonder, is your file system unusual ? Is it a simple ext4 or something more exotic ?

I'm quite surprised to see rsync modifying each time permission, owner and group !

csolisr commented 2 years ago

Regarding permissions, the target storage folder is being added to my Nextcloud instance as an external folder, so it can be synced to my main computer. Is it due to the permissions of the storage folder that I'm having this incident?

maniackcrudelis commented 2 years ago

I think maybe there's something weird with the file system or something like that. You should try either to mount manually the encrypted directory to see if it's working and/or add some debug to the encfs command, it seems that the encryption is having some trouble that I can't explain with the current log.

csolisr commented 2 years ago

Just to confirm, that'd be adding a -v on line 281 right?

csolisr commented 2 years ago

Regarding the file system, it's currently configured to copy the backups to the main backup folder, apparently via symlinks:

 sudo ls /home/yunohost.app/archivist/backup/ynh_backup -oah                                                                                                                                           total 9.8G                                                                                                                                                                                                                                  drwxr-xr-x 2 root 4.0K Jul 21 21:40 .                                                                                                                                                                                                       drwxr-xr-x 3 root 4.0K Jul 21 21:40 ..                                                                                                                                                                                                      lrwxrwxrwx 1 root   57 Jun  5 02:05 archivist_backup.info.json -> /home/yunohost.backup/archives/archivist_backup.info.json                                                                                                                 -rw-r--r-- 1 root   33 Jul 21 18:20 archivist_backup.md5                                                                                                                                                                                    -rw-r--r-- 1 root  47K Jul 21 18:20 archivist_backup.tar.zst                                                                                                                                                                                lrwxrwxrwx 1 root   57 May 22 02:23 collabora_backup.info.json -> /home/yunohost.backup/archives/collabora_backup.info.json                                                                                                                 -rw-r--r-- 1 root   33 Jun 12 03:51 collabora_backup.md5                                                                                                                                                                                    -rw-r--r-- 1 root 101K Jun 12 03:51 collabora_backup.tar.zst                                                                                                                                                                                lrwxrwxrwx 1 root   56 Feb 13 02:07 converse_backup.info.json -> /home/yunohost.backup/archives/converse_backup.info.json                                                                                                                   -rw-r--r-- 1 root   33 Feb 13 02:07 converse_backup.md5                                                                                                                                                                                     lrwxrwxrwx 1 root   55 Jun  5 02:33 element_backup.info.json -> /home/yunohost.backup/archives/element_backup.info.json                                                                                                                     -rw-r--r-- 1 root   33 Jul 17 02:54 element_backup.md5
-rw-r--r-- 1 root  32M Jul 17 02:54 element_backup.tar.zst
lrwxrwxrwx 1 root   53 Jun  5 02:06 gitea_backup.info.json -> /home/yunohost.backup/archives/gitea_backup.info.json
-rw-r--r-- 1 root   33 Jul 21 18:21 gitea_backup.md5
-rw-r--r-- 1 root  48M Jul 21 18:21 gitea_backup.tar.zst
lrwxrwxrwx 1 root   55 Jun  5 02:33 halcyon_backup.info.json -> /home/yunohost.backup/archives/halcyon_backup.info.json                                                                                                                     -rw-r--r-- 1 root   33 Jun 26 02:54 halcyon_backup.md5
-rw-r--r-- 1 root 2.0M Jun 26 02:54 halcyon_backup.tar.zst
lrwxrwxrwx 1 root   56 Jun  5 02:30 jellyfin_backup.info.json -> /home/yunohost.backup/archives/jellyfin_backup.info.json                                                                                                                   -rw-r--r-- 1 root   33 Jul 21 20:52 jellyfin_backup.md5
-rw-r--r-- 1 root 3.0G Jul 21 21:11 jellyfin_backup.tar.zst
lrwxrwxrwx 1 root   53 Jun  5 02:30 jitsi_backup.info.json -> /home/yunohost.backup/archives/jitsi_backup.info.json
-rw-r--r-- 1 root   33 Jun  5 13:27 jitsi_backup.md5
-rw-r--r-- 1 root  74M Jun  5 13:27 jitsi_backup.tar.zst
lrwxrwxrwx 1 root   58 Jun  5 02:30 librespeed_backup.info.json -> /home/yunohost.backup/archives/librespeed_backup.info.json                                                                                                               -rw-r--r-- 1 root   33 Jun 26 02:50 librespeed_backup.md5
-rw-r--r-- 1 root 2.8M Jun 26 02:50 librespeed_backup.tar.zst
lrwxrwxrwx 1 root   57 Jun  5 02:11 nextcloud_backup.info.json -> /home/yunohost.backup/archives/nextcloud_backup.info.json                                                                                                                 -rw-r--r-- 1 root   33 Jul 21 18:44 nextcloud_backup.md5
-rw-r--r-- 1 root 4.0G Jul 21 19:12 nextcloud_backup.tar.zst
lrwxrwxrwx 1 root   55 Jun  5 02:23 pleroma_backup.info.json -> /home/yunohost.backup/archives/pleroma_backup.info.json                                                                                                                     -rw-r--r-- 1 root   33 Jul 21 19:44 pleroma_backup.md5
-rw-r--r-- 1 root 1.2G Jul 21 20:33 pleroma_backup.tar.zst
lrwxrwxrwx 1 root   55 Jun  5 02:30 prosody_backup.info.json -> /home/yunohost.backup/archives/prosody_backup.info.json                                                                                                                     -rw-r--r-- 1 root   33 Jul  3 03:18 prosody_backup.md5
-rw-r--r-- 1 root  19K Jul  3 03:18 prosody_backup.tar.zst
lrwxrwxrwx 1 root   57 Jun  5 02:24 roundcube_backup.info.json -> /home/yunohost.backup/archives/roundcube_backup.info.json
-rw-r--r-- 1 root   33 Jul 21 20:36 roundcube_backup.md5
-rw-r--r-- 1 root  20M Jul 21 20:37 roundcube_backup.tar.zst
lrwxrwxrwx 1 root   53 Jun  5 02:31 searx_backup.info.json -> /home/yunohost.backup/archives/searx_backup.info.json
-rw-r--r-- 1 root   33 Jul 17 02:49 searx_backup.md5
-rw-r--r-- 1 root  22M Jul 17 02:49 searx_backup.tar.zst
lrwxrwxrwx 1 root   55 Jun  5 02:33 synapse_backup.info.json -> /home/yunohost.backup/archives/synapse_backup.info.json
-rw-r--r-- 1 root   33 Jul 21 21:27 synapse_backup.md5
-rw-r--r-- 1 root 952M Jul 21 21:39 synapse_backup.tar.zst
lrwxrwxrwx 1 root   59 Jun  5 02:24 vaultwarden_backup.info.json -> /home/yunohost.backup/archives/vaultwarden_backup.info.json
-rw-r--r-- 1 root   33 Jul 21 20:38 vaultwarden_backup.md5
-rw-r--r-- 1 root  36M Jul 21 20:39 vaultwarden_backup.tar.zst
lrwxrwxrwx 1 root   56 Jun  5 02:05 ynh_core_backup.info.json -> /home/yunohost.backup/archives/ynh_core_backup.info.json
-rw-r--r-- 1 root   33 Jul 21 18:15 ynh_core_backup.md5
-rw-r--r-- 1 root 553M Jul 21 18:20 ynh_core_backup.tar.zst
sudo ls /home/yunohost.backup/archives -oah
total 32G                                                                                                                                                                                                                                   drwxr-x--- 2 admin 4.0K Jul 21 21:34 .
drwxr-x--- 4 admin 4.0K Jan  5  2022 ..
-rw-r--r-- 1 root   293 Jul 21 18:20 archivist_backup.info.json                                                                                                                                                                             -rw-r--r-- 1 root  300K Jul 21 18:20 archivist_backup.tar                                                                                                                                                                                   -rw-r--r-- 1 root   293 Jan 26 08:59 archivist-pre-upgrade1.info.json
-rw-r--r-- 1 root  260K Jan 26 08:59 archivist-pre-upgrade1.tar                                                                                                                                                                             -rw-r--r-- 1 root   346 Jan 31 10:33 code-server-pre-upgrade1.info.json                                                                                                                                                                     -rw-r--r-- 1 root   351 Jun 12 03:51 collabora_backup.info.json
-rw-r--r-- 1 root  220K Jun 12 03:51 collabora_backup.tar                                                                                                                                                                                   -rw-r--r-- 1 root   351 May 15 12:37 collabora-pre-upgrade1.info.json
-rw-r--r-- 1 root  220K May 15 12:37 collabora-pre-upgrade1.tar
-rw-r--r-- 1 root   308 Feb 13 02:07 converse_backup.info.json
-rw-r--r-- 1 root  8.0M Feb 13 02:07 converse_backup.tar                                                                                                                                                                                    -rw-r--r-- 1 root   316 Jan  5  2022 converse-pre-upgrade1.info.json
-rw-r--r-- 1 root   12M Jan  5  2022 converse-pre-upgrade1.tar                                                                                                                                                                              -rw-r--r-- 1 root   298 Jul 17 02:54 element_backup.info.json                                                                                                                                                                               -rw-r--r-- 1 root  115M Jul 17 02:54 element_backup.tar
-rw-r--r-- 1 root   297 Jul 16 13:45 element-pre-upgrade1.info.json                                                                                                                                                                         -rw-r--r-- 1 root   84M Jul 16 13:45 element-pre-upgrade1.tar                                                                                                                                                                               -rw-r--r-- 1 root   292 Jul 21 18:21 gitea_backup.info.json
-rw-r--r-- 1 root  106M Jul 21 18:21 gitea_backup.tar                                                                                                                                                                                       -rw-r--r-- 1 root   307 Jun 26 02:54 halcyon_backup.info.json                                                                                                                                                                               -rw-r--r-- 1 root  5.5M Jun 26 02:54 halcyon_backup.tar
-rw-r--r-- 1 root   307 Jun 21 10:16 halcyon-pre-upgrade1.info.json
-rw-r--r-- 1 root  5.5M Jun 21 10:16 halcyon-pre-upgrade1.tar                                                                                                                                                                               -rw-r--r-- 1 root   317 Mar  3 10:37 invidious-pre-upgrade2.info.json                                                                                                                                                                       -rw-r--r-- 1 root   329 Jul 21 21:02 jellyfin_backup.info.json                                                                                                                                                                              -rw-r--r-- 1 root  3.7G Jul 21 21:02 jellyfin_backup.tar                                                                                                                                                                                    -rw-r--r-- 1 root   336 Jun 21 10:20 jellyfin-pre-upgrade1.info.json                                                                                                                                                                        -rw-r--r-- 1 root  3.5G Jun 21 10:20 jellyfin-pre-upgrade1.tar                                                                                                                                                                              -rw-r--r-- 1 root   312 Jun  5 13:27 jitsi_backup.info.json                                                                                                                                                                                 -rw-r--r-- 1 root  112M Jun  5 13:27 jitsi_backup.tar                                                                                                                                                                                       -rw-r--r-- 1 root   308 Jun 26 02:50 librespeed_backup.info.json                                                                                                                                                                            -rw-r--r-- 1 root  3.8M Jun 26 02:50 librespeed_backup.tar                                                                                                                                                                                  -rw-r--r-- 1 root   308 Jun 21 10:24 librespeed-pre-upgrade1.info.json                                                                                                                                                                      -rw-r--r-- 1 root  3.8M Jun 21 10:24 librespeed-pre-upgrade1.tar                                                                                                                                                                            -rw-rw-rw- 1 root   349 Jan 30 22:30 navidrome-pre-upgrade2.info.json                                                                                                                                                                       -rw-r--r-- 1 root   353 Jul 21 19:01 nextcloud_backup.info.json                                                                                                                                                                             -rw-r--r-- 1 root  6.6G Jul 21 19:01 nextcloud_backup.tar                                                                                                                                                                                   -rw-r--r-- 1 root   353 Jul 16 13:48 nextcloud-pre-upgrade1.info.json                                                                                                                                                                       -rw-r--r-- 1 root  2.2G Jul 16 13:48 nextcloud-pre-upgrade1.tar                                                                                                                                                                             -rw-r--r-- 1 root   338 Mar  3 10:51 nitter-pre-upgrade2.info.json                                                                                                                                                                          -rw-r--r-- 1 root   377 Jul 12 11:01 peertube-pre-upgrade1.info.json                                                                                                                                                                        -rw-r--r-- 1 root  2.1G Jul 12 11:01 peertube-pre-upgrade1.tar                                                                                                                                                                              -rw-r--r-- 1 root   345 Jul 21 20:20 pleroma_backup.info.json                                                                                                                                                                               -rw-r--r-- 1 root  7.2G Jul 21 20:20 pleroma_backup.tar                                                                                                                                                                                     -rw-r--r-- 1 root   351 Jan 19  2022 pleroma-pre-upgrade1.info.json                                                                                                                                                                         -rw-r--r-- 1 root   306 Jul  3 03:18 prosody_backup.info.json                                                                                                                                                                               -rw-r--r-- 1 root  160K Jul  3 03:18 prosody_backup.tar                                                                                                                                                                                     -rw-r--r-- 1 root   306 Jun 26 21:30 prosody-pre-upgrade2.info.json                                                                                                                                                                         -rw-r--r-- 1 root  150K Jun 26 21:30 prosody-pre-upgrade2.tar                                                                                                                                                                               -rw-r--r-- 1 root   311 May  1 03:04 rainloop_backup.info.json                                                                                                                                                                              -rw-r--r-- 1 root   25M May  1 03:04 rainloop_backup.tar                                                                                                                                                                                    -rw-r--r-- 1 root   311 May  6 14:10 rainloop-pre-upgrade1.info.json
-rw-r--r-- 1 root   47M May  6 14:10 rainloop-pre-upgrade1.tar                                                                                                                                                                              -rw-r--r-- 1 root   308 Jul 21 20:37 roundcube_backup.info.json
-rw-r--r-- 1 root   68M Jul 21 20:37 roundcube_backup.tar
-rw-r--r-- 1 root   308 Jun 28 09:31 roundcube-pre-upgrade1.info.json                                                                                                                                                                       -rw-r--r-- 1 root   67M Jun 28 09:31 roundcube-pre-upgrade1.tar                                                                                                                                                                             -rw-r--r-- 1 root   314 Jul 17 02:49 searx_backup.info.json
-rw-r--r-- 1 root   79M Jul 17 02:49 searx_backup.tar                                                                                                                                                                                       -rw-r--r-- 1 root   314 Jul 16 14:07 searx-pre-upgrade1.info.json                                                                                                                                                                           -rw-r--r-- 1 root   79M Jul 16 14:07 searx-pre-upgrade1.tar
-rw-r--r-- 1 root   316 May 15 13:45 shellinabox_backup.info.json                                                                                                                                                                           -rw-r--r-- 1 root  140K May 15 13:45 shellinabox_backup.tar
-rw-r--r-- 1 root   321 Jul 21 21:34 synapse_backup.info.json
-rw-r--r-- 1 root  3.4G Jul 21 21:34 synapse_backup.tar
-rw-r--r-- 1 root   329 May 15 13:45 torrelay_backup.info.json                                                                                                                                                                              -rw-r--r-- 1 root   80K May 15 13:45 torrelay_backup.tar
-rw-r--r-- 1 root   338 Jul 21 20:38 vaultwarden_backup.info.json                                                                                                                                                                           -rw-r--r-- 1 root  141M Jul 21 20:38 vaultwarden_backup.tar                                                                                                                                                                                 -rw-r--r-- 1 root   338 Jul 12 11:10 vaultwarden-pre-upgrade1.info.json
-rw-r--r-- 1 root  133M Jul 12 11:10 vaultwarden-pre-upgrade1.tar                                                                                                                                                                           -rw-r--r-- 1 root   338 Jun  5 18:11 vaultwarden-pre-upgrade2.info.json                                                                                                                                                                     -rw-r--r-- 1 root   318 May 29 02:30 vpnclient_backup.info.json
-rw-r--r-- 1 root  250K May 29 02:30 vpnclient_backup.tar                                                                                                                                                                                   -rw-r--r-- 1 root   780 Jul 21 18:19 ynh_core_backup.info.json                                                                                                                                                                              -rw-r--r-- 1 root  2.5G Jul 21 18:19 ynh_core_backup.tar
csolisr commented 2 years ago

Config file relevant lines:

backup_dir=/home/yunohost.app/archivist/backup
enc_backup_dir=/home/yunohost.app/archivist/encrypted_backup
encrypt=true
cryptpass=/opt/yunohost/archivist/password
ynh_compression_mode=zstd
files_compression_mode=zstd

> recipient name=local
type=local
destination directory=/home/yunohost.multimedia/share/archives
encrypt=false
pre_backup=
#required to properly sync with Nextcloud, maybe this is the issue?
post_backup=chmod -R 777 /home/yunohost.multimedia/share/archives 
exclude backup=
include backup=

> recipient name=rsync
type=rsync_ssh
destination directory=/home/admin/archives
encrypt=true
ssh_host=[REDACTED]
ssh_user=[REDACTED]
ssh_port=[REDACTED]
ssh_pwd=[REDACTED]
maniackcrudelis commented 2 years ago

Just to confirm, that'd be adding a -v on line 281 right?

Indeed. You may also do that manually without the script.

required to properly sync with Nextcloud, maybe this is the issue?

post_backup=chmod -R 777 /home/yunohost.multimedia/share/archives

This explain that rsync change the permission each time.

Does your distant server has anything into its /home/admin/archives directory ? I'd like to know if that's really all the files that fail to transfer or only part of them.

csolisr commented 2 years ago

Does your distant server has anything into its /home/admin/archives directory ? I'd like to know if that's really all the files that fail to transfer or only part of them.

The remote folder is empty, this is attempting the first synchronization. Is there a specific step to be taken before the first remote sync?

maniackcrudelis commented 2 years ago

You may need to initiate an ssh connection a first time to ensure ssh is ready to work. But nothing more. Anyway, it's unlikely the error here.

Did you get any error message from encfs when mounting the encrypted directory ?

csolisr commented 2 years ago

I ran the script again, this is the error message (had to manually translate a few errors from Spanish to English, hopefully they match the original strings):


-> Build the list of files for the recipient rsync
VERBOSE Root directory: /home/yunohost.app/archivist/backup/ [main.cpp:686]
VERBOSE Fuse arguments: (daemon) (threaded) (timeout 5) (keyCheck) (reverseEncryption) encfs /home/yunohost.app/archivist/encrypted_backup/ -o use_ino -o default_permissions  [main.cpp:687]
VERBOSE found new serialization format [FileUtils.cpp:299]
VERBOSE subVersion = 20100713 [FileUtils.cpp:313]
VERBOSE checking if ssl/aes(3:0:2) implements ssl/aes(3:0) [Interface.cpp:103]
VERBOSE allocated cipher ssl/aes, keySize 24, ivlength 16 [SSL_Cipher.cpp:395]
VERBOSE getUserKey: fds = 3, 4 [FileUtils.cpp:1519]
VERBOSE checking if ssl/aes(3:0:2) implements ssl/aes(3:0) [Interface.cpp:103]
VERBOSE allocated cipher ssl/aes, keySize 24, ivlength 16 [SSL_Cipher.cpp:395]
VERBOSE cipher key size = 44 [FileUtils.cpp:1673]
VERBOSE checking if nameio/block(4:0:2) implements nameio/block(4:0) [Interface.cpp:103]
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
fuse has failed. Common problems:
- The fuse kernel module is not installed (modprobe fuse)
- invalid options -- view the help message
VERBOSE waking up monitoring thread [main.cpp:824]
VERBOSE joining with idle monitoring thread [main.cpp:828]
/opt/yunohost/archivist/archivist.sh: line 279: 258135 Segmentation fault  sudo encfs -v --reverse --idle=5 --extpass="cat \"$cryptpass\"" --standard "$backup_dir" "$enc_backup_dir"
> Copy backups files in /home/admin/archives.
building file list ... 
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/ePSWKxAbTsIp783m7,7g8vob,kw56QlWemCzRPwUD2sp9,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/npEefKTegAs1pMeV91fH5eDLfe6w8DST0BVVyFu6pM8lA1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/N-mw,B4Bzn4X,DuRUY-i6dl8qlIuL5Di39PHoWusebKxI1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/4S4TTVm6vBg7I8Otr9EMoFpmcmd57Wla2bddVoQAab,nh0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/cBM05kqVej-SgXvkRQAnHGDiB73UtskEDahKyw5MxoKKU,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/et4hiIN4YU4NacNFz,PhtOuVAPhZ8LRy4dTa,cTQVOOse,") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/WOEMJ0a9wgaEMWq2OWKguEabxmx,6v0UpTX2nbj9r6uYy0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/JDFbKtr9ltl0PMipTRsOnb0EIbzLqUHXJy,Cadn6VG2ws1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/hsp9AsghoyQkLJE24xk5CaQJsOmhvWl89A-zBiLLj9cUC1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/lK8K75-JKjF1D8L65TxEEczb8UqAtWdTHMtL3DzeYrcek0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/PBsvs0bC-Viu7we2u0aFkPoyeb9egfYnjKEpnxBsbNkoy0") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/CnpPuAtzPacnKCF5S1Byibz2xVjHdsv,mzfCxphiiP6301") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/U8FsQtLIjLFuVJYOCNZk,JMvDe3iApLK1POagGKSUEngS-") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/uMCMNB1ZLwwhvzGKpRLB3wb7yx0TOdXrNuK,QJWag6D2-1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/UCHh8f24i7FY695aWLirRYXsXd54QdByRWwdXbSVkYq3u1") failed: Input/output error (5)
rsync: [sender] readlink_stat("/home/yunohost.app/archivist/encrypted_backup/2UXLD7rtnefGHjDcSlvU4FqW/f5A5klalol9Fi5A1abHTUGB5jomYU0VMay6paOKXQwEHz1") failed: Input/output error (5)
done
IO error encountered -- skipping file deletion
.d..t...... ./

Number of files: 2 (dir: 2)
Number of created files: 0
Number of deleted files: 0
Number of regular files transferred: 0
Total file size: 0 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 0
File list generation time: 0.018 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 83
Total bytes received: 77

sent 83 bytes  received 77 bytes  64.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1333) [sender=3.2.3]
maniackcrudelis commented 2 years ago

OK, but that was probably the second mount that occurs while the first one was not yet expired.

I was expecting an error that would tell us more. I'll made a branch with a few tweaks to help you debug that. Hope we can find what's the issue here.

maniackcrudelis commented 2 years ago

Ok, do try please with this version of the main script, https://github.com/maniackcrudelis/archivist/blob/encryption_debug/archivist.sh

It will avoid a remount of the directory and prevent such failure from encfs, but still gives us a log.

What we should check is the first log of encfs, when mounting the directory for the first time. Also, if you can try to mount manually the directory, it could help determine if there's a error with encfs.