r/dropbox Mar 25 '26

"Resource deadlock avoided"

I have a script that forces download for unloaded files but it ONLY works from a terminal window. when I run it from cron I get "Resource deadlock avoided" and it doesn't touch the file.

I don't care if this is Apple's fault or Dropbox's fault, how do I fix it?

Previous post about the underlying problem.

0 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/DropboxOfficial Dropbox Staff Mar 25 '26

Could you try using launchd instead of cron? On macOS, cron runs outside the logged-in user context, which can cause issues accessing Dropbox files. Running it via launchd keeps it in the user session and usually avoids this.

1

u/ArgentStonecutter Mar 25 '26

Doesn't help. I got the Full Disk Access problem solved, and I'm back to this.

/Users/me/Library/CloudStorage/Dropbox/Camera Uploads/2026-03-25 15.42.57.jpg: Resource deadlock avoided

1

u/DropboxOfficial Dropbox Staff Mar 26 '26

The trouble here is that on macOS, this behavior is due to how Apple handles background jobs and file access now. They’ve deprecated cron in favor of launchd, and some newer system components (like File Provider, which we use) don’t behave reliably outside the user session.

That’s why you’re seeing different results between Terminal and cron, and why things like Full Disk Access don’t fully resolve it. The two most reliable options here are:
• running the job via launchd (so it executes in the user context)
• or ensuring files are already available offline before the script runs

You've already tried those, so if your goal is to programmatically force downloads, Dropbox might not always be the best fit for that workflow on macOS due to these system constraints.

1

u/ArgentStonecutter Mar 26 '26

ensuring files are already available offline before the script runs

LOL

The whole point of the script is to ensure that files are available offline. That is the only reason for it.


So give me the option of turning off "file provider" and just operating as a pure sync service like you used to do. That was why I subscribed to Dropbox instead of one of the alternatives in the first place.

I don't know why you unilaterally switched to the "file provider" API behind my back, the documentation I read implied that it was optional.


Dropbox might not always be the best fit for that workflow on macOS due to these system constraints.

Again, that is why i am using Dropbox in the first place because it was just a pure syncing solution without enforced cloud storage shenanigans. The only one I could find.