Backup failed for the Documents folder in macOS 13.0

Greetings, I recently upgrade my M1 Mac to macOS 13.0. I reinstalled Duplicacy webui (arm64) with the latest cli 3.0.1. I have granted Duplicacy with the full disk access, and every other backups works fine except the Documents folder under user’s home directory. It failed with a exit status 101, and the ~/.duplicacy-web/logs/duplicacy_web.log gives following:

2022/11/03 16:33:39 CLI stderr: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
runtime/debug.Stack(0x34, 0x0, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x88
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x20
github.com/gilbertchen/duplicacy/src.CatchLogException()
        /Users/gchen/zincbox/duplicacy/src/duplicacy_log.go:233 +0x100
panic(0x103b06640, 0x1400218c000)
        /usr/local/go/src/runtime/panic.go:965 +0x14c
github.com/gilbertchen/duplicacy/src.(*BackupManager).Backup(0x14000534000, 0x1400018c040, 0x19, 0x1, 0x4, 0x0, 0x0, 0x1, 0x0, 0x0, ...)
        /Users/gchen/zincbox/duplicacy/src/duplicacy_backupmanager.go:311 +0x2fd4
main.backupRepository(0x140005007e0)
        /Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:791 +0x560
github.com/gilbertchen/cli.Command.Run(0x1037077aa, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10374081e, 0x30, 0x0, ...)
        /Users/gchen/zincbox/go/pkg/mod/github.com/gilbertchen/cli@v1.2.1-0.20160223210219-1de0a1836ce9/command.go:160 +0x578
github.com/gilbertchen/cli.(*App).Run(0x1400000d560, 0x140000ca000, 0x8, 0x8, 0x0, 0x0)
        /Users/gchen/zincbox/go/pkg/mod/github.com/gilbertchen/cli@v1.2.1-0.20160223210219-1de0a1836ce9/app.go:179 +0x4f8
main.main()
        /Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:2231 +0x4f3c
2022/11/03 16:33:39 The CLI executable returned an error: exit status 101, exit code: 101

The iCloud sync for documents is closed as well. Is this a bug or I did something wrong? Thanks for helping.

1 Like

I’ll look into this. Can you try adding the -hash option to the backup job to see if this helps?

Do you still have the log from that backup job? You can open it by clicking the link that says ‘Failed’ under the Status column on the Schedule page.

Thanks for your fast response. The log for backup:

Running backup command from /Users/XXX/.duplicacy-web/repositories/localhost/2 to back up /Users/XXX/Documents
Options: [-log backup -storage YYY -threads 4 -stats]
2022-11-05 12:13:00.387 INFO REPOSITORY_SET Repository set to /Users/XXX/Documents
2022-11-05 12:13:00.387 INFO STORAGE_SET Storage set to s3://eu-central-1@s3.eu-central-1.amazonaws.com/ZZZ/YYY
2022-11-05 12:13:00.874 INFO BACKUP_EXCLUDE Exclude files with no-backup attributes
2022-11-05 12:13:00.904 INFO BACKUP_START No previous backup found
2022-11-05 12:13:00.905 INFO INCOMPLETE_LOAD Previous incomlete backup contains 1 files and 0 chunks
2022-11-05 12:13:00.905 INFO BACKUP_LIST Listing all chunks
2022-11-05 12:13:07.609 INFO BACKUP_INDEXING Indexing /Users/XXX/Documents
2022-11-05 12:13:07.609 INFO SNAPSHOT_FILTER Parsing filter file /Users/XXX/.duplicacy-web/repositories/localhost/2/.duplicacy/filters
2022-11-05 12:13:07.609 INFO SNAPSHOT_FILTER Loaded 0 include/exclude pattern(s)
exit status 101

With the option -hash:

Running backup command from /Users/XXX/.duplicacy-web/repositories/localhost/2 to back up /Users/XXX/Documents
Options: [-log backup -storage YYY -threads 4 -hash -stats]
2022-11-05 12:16:10.751 INFO REPOSITORY_SET Repository set to /Users/XXX/Documents
2022-11-05 12:16:10.751 INFO STORAGE_SET Storage set to s3://eu-central-1@s3.eu-central-1.amazonaws.com/ZZZ/YYY
2022-11-05 12:16:15.530 INFO BACKUP_EXCLUDE Exclude files with no-backup attributes
2022-11-05 12:16:15.559 INFO BACKUP_START No previous backup found
2022-11-05 12:16:15.560 INFO INCOMPLETE_LOAD Previous incomlete backup contains 1 files and 0 chunks
2022-11-05 12:16:15.560 INFO BACKUP_LIST Listing all chunks
2022-11-05 12:16:20.228 INFO BACKUP_INDEXING Indexing /Users/XXX/Documents
2022-11-05 12:16:20.228 INFO SNAPSHOT_FILTER Parsing filter file /Users/XXX/.duplicacy-web/repositories/localhost/2/.duplicacy/filters
2022-11-05 12:16:20.228 INFO SNAPSHOT_FILTER Loaded 0 include/exclude pattern(s)
exit status 101

In this case, ~/.duplicacy-web/logs/duplicacy_web.log gives:

2022/11/05 12:16:20 CLI stderr: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
runtime/debug.Stack(0x34, 0x0, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x88
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x20
github.com/gilbertchen/duplicacy/src.CatchLogException()
        /Users/gchen/zincbox/duplicacy/src/duplicacy_log.go:233 +0x100
panic(0x102fba640, 0x14002182000)
        /usr/local/go/src/runtime/panic.go:965 +0x14c
github.com/gilbertchen/duplicacy/src.(*BackupManager).Backup(0x14000546000, 0x1400058a040, 0x19, 0x0, 0x4, 0x0, 0x0, 0x1, 0x0, 0x0, ...)
        /Users/gchen/zincbox/duplicacy/src/duplicacy_backupmanager.go:311 +0x2fd4
main.backupRepository(0x140006f4120)
        /Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:791 +0x560
github.com/gilbertchen/cli.Command.Run(0x102bbb7aa, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x102bf481e, 0x30, 0x0, ...)
        /Users/gchen/zincbox/go/pkg/mod/github.com/gilbertchen/cli@v1.2.1-0.20160223210219-1de0a1836ce9/command.go:160 +0x578
github.com/gilbertchen/cli.(*App).Run(0x14000542240, 0x14000032090, 0x9, 0x9, 0x0, 0x0)
        /Users/gchen/zincbox/go/pkg/mod/github.com/gilbertchen/cli@v1.2.1-0.20160223210219-1de0a1836ce9/app.go:179 +0x4f8
main.main()
        /Users/gchen/zincbox/duplicacy/duplicacy/duplicacy_main.go:2231 +0x4f3c
2022/11/05 12:16:20 The CLI executable returned an error: exit status 101, exit code: 101

Thanks.

2022-11-05 12:13:00.905 INFO INCOMPLETE_LOAD Previous incomlete backup contains 1 files and 0 chunks

This was likely the cause of the runtime error, especially the 0 chunks part. I’ll try to reproduce.

To work around the bug you can remove the incomplete files /Users/XXX/.duplicacy-web/repositories/localhost/2/.duplicacy/cache/*/incomplete*.

Yes, backup succeed after delete all incomplete files, thanks.

This bug should be fixed by Handle zero-byte files correctly · gilbertchen/duplicacy@3472206 · GitHub