-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Failed to restore a backup to file by the scripts/restore-backup-to-file.sh with a CIFS backup target. #8126
Comments
Pre Ready-For-Testing Checklist
|
Hi @mantissahz I got error when using longhornio/longhorn-engine:master to restore cifs backup, but the restore success when using v1.6.2-rc2 engine image, could you help me on this? thank you. master > ./restore-backup-to-file.sh --cifs-username "longhorn-cifs-username" \
--cifs-password "longhorn-cifs-password" \
--backup-url "cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a" \
--output-file "volume.raw" \
--output-format raw \
-v master
time="2024-03-22T02:16:54Z" level=info msg="Running restore to file command: backup-url=cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a backing-file= output-file=/tmp/restore/volume.raw output-format=raw"
time="2024-03-22T02:16:54Z" level=info msg="Output file path=/tmp/restore/volume.raw"
time="2024-03-22T02:16:54Z" level=info msg="Start to restore cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a to backup.img"
time="2024-03-22T02:16:54Z" level=error msg="failed to remove tmp file=backup.img: remove /backup.img: no such file or directory"
time="2024-03-22T02:16:54Z" level=error msg="failed to remove tmp file=backup.img.converted: remove /backup.img.converted: no such file or directory"
time="2024-03-22T02:16:54Z" level=error msg="failed to remove tmp file=backing.img.cp: remove /backing.img.cp: no such file or directory"
time="2024-03-22T02:16:54Z" level=fatal msg="Error running restore to file command: Driver cifs is not supported!"
v1.6.2-rc2 ./restore-backup-to-file.sh --cifs-username "longhorn-cifs-username" \
--cifs-password "longhorn-cifs-password" \
--backup-url "cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a" \
--output-file "volume.raw" \
--output-format raw \
-v v1.6.1-rc2
time="2024-03-22T02:16:13Z" level=info msg="Running restore to file command: backup-url=cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a backing-file= output-file=/tmp/restore/volume.raw output-format=raw" func=cmd.BackupCmd.RestoreToFileCmd.func4 file="restore_to_file.go:65"
time="2024-03-22T02:16:13Z" level=info msg="Output file path=/tmp/restore/volume.raw" func=cmd.restoreToFile file="restore_to_file.go:141"
time="2024-03-22T02:16:13Z" level=info msg="Start to restore cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a to backup.img" func=cmd.restoreToFile file="restore_to_file.go:145"
time="2024-03-22T02:16:13Z" level=info msg="Mounting CIFS share cifs://10.43.35.102/backupstore on mount point /var/lib/longhorn-backupstore-mounts/10_43_35_102/backupstore with options [soft]" func="cifs.(*BackupStoreDriver).mount" file="cifs.go:115" pkg=cifs
time="2024-03-22T02:16:13Z" level=info msg="Loaded driver for cifs://10.43.35.102/backupstore" func=cifs.initFunc file="cifs.go:94" pkg=cifs
time="2024-03-22T02:16:13Z" level=info msg="Saving config in backupstore" func=backupstore.SaveConfigInBackupStore file="config.go:81" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=start
time="2024-03-22T02:16:13Z" level=info msg="Saved config in backupstore" func=backupstore.SaveConfigInBackupStore file="config.go:92" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=complete
time="2024-03-22T02:16:13Z" level=info msg="Stored lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck type 1 on backupstore" func=backupstore.saveLock file="lock.go:190" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="Loading config in backupstore" func=backupstore.LoadConfigInBackupStore file="config.go:56" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=start
time="2024-03-22T02:16:15Z" level=info msg="Loaded config in backupstore" func=backupstore.LoadConfigInBackupStore file="config.go:67" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=complete
time="2024-03-22T02:16:15Z" level=info msg="Loaded lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck type 1 on backupstore" func=backupstore.loadLock file="lock.go:171" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="Trying to acquire lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck" func="backupstore.(*FileLock).canAcquire" file="lock.go:65" lock="{ volume: pvc-325033b4-90c9-46b0-92c7-643d7199894a, name: lock-30f8bd951b3a49b1, type: 1, acquired: false, serverTime: 2024-03-22 02:16:13.6094932 +0000 UTC }" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="backupstore volume pvc-325033b4-90c9-46b0-92c7-643d7199894a contains locks [{ volume: , name: lock-30f8bd951b3a49b1, type: 1, acquired: false, serverTime: 2024-03-22 02:16:13.6094932 +0000 UTC }]" func="backupstore.(*FileLock).canAcquire" file="lock.go:66" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="Acquired lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck type 1 on backupstore" func="backupstore.(*FileLock).Lock" file="lock.go:114" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="Saving config in backupstore" func=backupstore.SaveConfigInBackupStore file="config.go:81" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=start
time="2024-03-22T02:16:15Z" level=info msg="Saved config in backupstore" func=backupstore.SaveConfigInBackupStore file="config.go:92" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=complete
time="2024-03-22T02:16:15Z" level=info msg="Stored lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck type 1 on backupstore" func=backupstore.saveLock file="lock.go:190" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="Loading config in backupstore" func=backupstore.LoadConfigInBackupStore file="config.go:56" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/volume.cfg kind=cifs object=config pkg=backupstore reason=start
time="2024-03-22T02:16:15Z" level=info msg="Loaded config in backupstore" func=backupstore.LoadConfigInBackupStore file="config.go:67" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/volume.cfg kind=cifs object=config pkg=backupstore reason=complete
time="2024-03-22T02:16:15Z" level=info msg="Loading config in backupstore" func=backupstore.LoadConfigInBackupStore file="config.go:56" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/backups/backup_backup-5a0948028f414983.cfg kind=cifs object=config pkg=backupstore reason=start
time="2024-03-22T02:16:15Z" level=info msg="Loaded config in backupstore" func=backupstore.LoadConfigInBackupStore file="config.go:67" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/backups/backup_backup-5a0948028f414983.cfg kind=cifs object=config pkg=backupstore reason=complete
time="2024-03-22T02:16:15Z" level=info msg="Restoring delta block backup" func=backupstore.RestoreDeltaBlockBackup file="deltablock.go:683" backup_url="cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a" event=restore object=snapshot original_volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a pkg=backupstore reason=start snapshot=backup-5a0948028f414983 volume_dev=backup.img
time="2024-03-22T02:16:15Z" level=info msg="Saving config in backupstore" func=backupstore.SaveConfigInBackupStore file="config.go:81" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=start
time="2024-03-22T02:16:15Z" level=info msg="Saved config in backupstore" func=backupstore.SaveConfigInBackupStore file="config.go:92" filepath=backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck kind=cifs object=config pkg=backupstore reason=complete
time="2024-03-22T02:16:15Z" level=info msg="Stored lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck type 1 on backupstore" func=backupstore.saveLock file="lock.go:190" pkg=backupstore
time="2024-03-22T02:16:15Z" level=info msg="Truncate backup.img to size 2147483648" func=backupstore.RestoreDeltaBlockBackup.func2 file="deltablock.go:710" pkg=backupstore
0 / 100 [______________________________________________________________________________] 0.00% ? p/stime="2024-03-22T02:16:16Z" level=info msg="Removed lock backupstore/volumes/9c/df/pvc-325033b4-90c9-46b0-92c7-643d7199894a/locks/lock-30f8bd951b3a49b1.lck type 1 on backupstore" func=backupstore.removeLock file="lock.go:180" pkg=backupstore
0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/s0 / 100 [______________________________________________________________________________] 0.00% ? p/stime="2024-03-22T02:16:17Z" level=info msg="Done restoring cifs://10.43.35.102/backupstore?backup=backup-5a0948028f414983&volume=pvc-325033b4-90c9-46b0-92c7-643d7199894a to backup.img" func=cmd.restoreToFile file="restore_to_file.go:149"
time="2024-03-22T02:16:17Z" level=info msg="Start ConvertImage (raw) backup.img -> /tmp/restore/volume.raw" func=cmd.ConvertImage file="restore_to_file.go:236"
time="2024-03-22T02:16:17Z" level=info msg="Done ConvertImage (raw) backup.img -> /tmp/restore/volume.raw" func=cmd.ConvertImage file="restore_to_file.go:242"
time="2024-03-22T02:16:17Z" level=error msg="Failed to remove tmp file=backup.img.converted" func=cmd.CleanupTempFiles file="restore_to_file.go:228" error="remove /backup.img.converted: no such file or directory"
time="2024-03-22T02:16:17Z" level=error msg="Failed to remove tmp file=backing.img.cp" func=cmd.CleanupTempFiles file="restore_to_file.go:228" error="remove /backing.img.cp: no such file or directory"
time="2024-03-22T02:16:17Z" level=info msg="Done running restore to file command. Produced image: /tmp/restore/volume.raw" func=cmd.BackupCmd.RestoreToFileCmd.func4 file="restore_to_file.go:70" |
Hi @chriscchien
I think the error is from the option |
Verified pass on longhorn master( I can successfully restore a backup form cifs backupstore to
|
Describe the bug
When using scripts/restore-backup-to-file.sh script with CIFS backend, no credentials can be passed to the engine container.
This results in an error when trying to mount CIFS share:
To Reproduce
Expected behavior
Restoring a backup to file by longhorn/scripts/restore-backup-to-file.sh with a CIFS backup target works well.
Support bundle for troubleshooting
Environment
Additional context
The text was updated successfully, but these errors were encountered: