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

Sync Failing Immediately After Uploading Torrent File #11877

Closed
Nealon01 opened this issue Oct 16, 2018 · 6 comments
Closed

Sync Failing Immediately After Uploading Torrent File #11877

Nealon01 opened this issue Oct 16, 2018 · 6 comments

Comments

@Nealon01
Copy link

So I'm hosting my own nextcloud server on Unraid using the latest versions of everything (linuxserver/nextcloud docker container, I can give more details if needed).

I'm using the windows sync tool to sync some of my Unraid shares to my computer, pretty basic stuff.

The only thing that I'm doing that is a little complicated is that I download .torrent files to a folder on my computer, included in the nextcloud sync. So, as expected, the sync app loads it to my Unraid share, all perfect there. However, as soon as that happens, the Unraid share is watched by a Transmission Docker container that automatically starts torrenting that file (saves it to a different location).

As soon as that happens, the sync tool get's all screwed up saying it can't sync that file with a "service unavailable" error.

I have to remove the files, and redo the share (meaning it has to rescan all the folders) to get it to fix. What are my options here? Am I just SOL if I want to sync files that might be in use by programs at one point or another?

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #1371 (No file-uploading possible at all), #4392 (Error while syncing/uploading large files), #10184 (Uploading medium size files fails), #5438 (Nextcloud won't upload larger files), and #8954 (Uploading large files fails).

@Nealon01
Copy link
Author

GitMate.io thinks possibly related issues are #1371 (No file-uploading possible at all), #4392 (Error while syncing/uploading large files), #10184 (Uploading medium size files fails), #5438 (Nextcloud won't upload larger files), and #8954 (Uploading large files fails).

All the files are .torrent files, and never even close to 1MB in size, so I don't think it was any of the size related issues above. And the fact that it uploads fine, and only throws errors on files that are being accessed by another process seems pretty indicative of what's going on.

@MorrisJobke
Copy link
Member

However, as soon as that happens, the Unraid share is watched by a Transmission Docker container that automatically starts torrenting that file (saves it to a different location).

That looks like the problem. Nextcloud uploads the files to an upload folder inside the data directory and once this is done moves the file to the correct location (to have atomic writes on the disk). I guess your tool opens the file and Nextcloud can't move it anymore, because another process has opened the file. This is then the error you see. Maybe exclude the upload folder from the "watch".

You could also check the nextcloud.log for more details about this issue.

@Nealon01
Copy link
Author

Maybe exclude the upload folder from the "watch".

I could, but that would defeat the purpose of what I'm trying to do. I'd like to use this to transfer files from my computer to a folder where it gets used by another program.

That's the whole point of my post. Which is why I end it with the question "Am I just SOL if I want to sync files that might be in use by programs at one point or another?".

@MorrisJobke
Copy link
Member

I could, but that would defeat the purpose of what I'm trying to do. I'd like to use this to transfer files from my computer to a folder where it gets used by another program.

That's the whole point of my post. Which is why I end it with the question "Am I just SOL if I want to sync files that might be in use by programs at one point or another?".

Manipulating the DB manually is not supported. My point was that locking a file on the filesystem by opening it, while Nextcloud is using it, is simply not supported. Just don't do this. And if you want to hook into this process, then don't use the filesystem as layer, but Nextcloud as application. You could write an app that hooks into the file upload trigger and then calls some script somewhere or starts a docker container.

Does that solve your problem?

@Nealon01
Copy link
Author

It doesn't but I can figure something else out. Thanks anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants