Skip to content
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

MacOS: Backup stuck. Command-line with same args works. Not sure how to debug. #486

Open
jamesb93 opened this issue Sep 20, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@jamesb93
Copy link

jamesb93 commented Sep 20, 2024

Describe the bug
Backing up my Apple photos to B2 is stuck indefinitely. Backing up via the command-line manually works as normal.

To Reproduce

  1. Create a plan that backs up the Apple photos container.
  2. Start a backup

Expected behavior
Backup should work like restic cli.

Screenshots

in this instance I've manually killed the backup via the GUI. This is all it ever shows. The sqlite file is only around 200mb.

image

Platform Info

  • Darwin arm64
  • Backrest 1.5.0

Additional context
Add any other context about the problem here.

@jamesb93 jamesb93 added the bug Something isn't working label Sep 20, 2024
@garethgeorge
Copy link
Owner

garethgeorge commented Sep 20, 2024

Hey, not great. Is this reproducible e.g. every time you run a backup operation through backrest? And is it always stalling on the same file?

I'd be curious if you can try killing Backrest itself and dumping the stack e.g. is backrest hung if you press ctrl+c on the process? If you send sigkill twice in quick succession backrest will forcefully exit and dump running coroutines to the console.

It's possible something is deadlocking. Odd though, I use B2 on all of my systems and haven't seen this happen. Definitely interested to look into it.

@garethgeorge
Copy link
Owner

garethgeorge commented Sep 20, 2024

I've just noticed you're running on MacOS -- this is likely macOS's file permissions kicking in. It may be that your global restic install is trusted but Backrest and Backrest's managed version of restic are untrusted / getting blocked.

Try running sudo xattr -d com.apple.quarantine $(which backrest) to clear apple's quarantine flags. Some experimentation may be needed -- you might also need to add backrest (or it's managed version of restic? or both?) to programs with full disk access. It's also possible you'll see a system dialogue popup during the backup process (maybe it's getting hidden or was accidentally rejected in a prior run) which will ask for access to various folders. This is what I've seen happen on my macOS runs.

Will be very interested to hear what works for you, would like to add this to the readme if there are undocumented footguns here w/MacOS.

@garethgeorge garethgeorge changed the title Backup stuck. Command-line with same args works. Not sure how to debug. MacOS: Backup stuck. Command-line with same args works. Not sure how to debug. Sep 20, 2024
@jamesb93
Copy link
Author

Hey! Thanks for the considered answer. I suspect your hunch is correct. Other backups work just fine, it's only on this particular container.

Here is what I tried in order:

  1. Adding backrest to full disk access 👎
  2. Trying to give the managed instance full-disk access.

I'm stuckon number 2, because its a document and not an executable I can't add it through the GUI. Any pointers?

@garethgeorge
Copy link
Owner

Hmm. Surprising that nothing pops up requesting access -- try chmod +x on the executable such that it'll show up in that UI.

I should also go ahead and fix the restic installer to actually chmod the binary into an executable if I'm not doing that correctly.

@jamesb93
Copy link
Author

Looks like even after running chmod +x on the binary it still is treated as a document in the Finder GUI, though on the CLI it looks correct.

image

@jamesb93
Copy link
Author

I can also confirm this is perhaps specific to b2. I am able to successfully backup the photos container to a local repo.

@jamesb93
Copy link
Author

Hey, did you have any ideas for this? I used Kopia which to see if that could reproduce the behaviour with permissions. It seems to also get blocked, but full disk permissions overcome it.

@garethgeorge
Copy link
Owner

Hey, I now have an apple silicon mac to test on. In the latest version of backrest, restic is now consistently installed at ~/.local/share/backrest/restic and the version info is removed from the name (which seemed to be preventing the binary from showing up as an option for full disk access and other permissions dialogues?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants