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

Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent (v4.6.5) #20849

Closed
Rubber-Duckie opened this issue May 15, 2024 · 11 comments

Comments

@Rubber-Duckie
Copy link

Rubber-Duckie commented May 15, 2024

qBittorrent & operating system versions

qBittorrent: 4.6.4 x64
qBittorrent: 4.6.5 x64
Operating system: Windows 11 pro Version 10.0.22631.3593

What is the problem?

The following error is raised wherever you specify a subset of the content within a torrent that you wish to download using the content tab within the UI.

I deselected the folder and file path within the content tab corresponding to "SomeSubFolder" in the example below.

File error alert. Torrent: "SomeTorrent". File: "F:\SomeTorrent\SomeSubFolder\SomeFile1.!qB". Reason: "SomeFile1 partfile_write (F:\SomeTorrent\SomeSubFolder\SomeFile1.!qB) error: Access is denied"

It seems the engine is in conflict with the user content selection criteria, since "SomeSubFolder" does not exist on disk, which is expected, but the file engine is still attempting to download and save to the folder regardless, hence the error.

Not only that, but "Access is denied" is in fact the wrong error anyway, as one would expect "folder does not exist".

This seems to affect files irrespective of a file being within a sub folder or not. As long as you deselected them from download within said content tab, the torrent will fail with the aforementioned error after an amount of time - presumably it starts to download the files with a positive priority first, then eventually turns attention to the "no not download" files and tries to do so anyway resulting in the exception raised.

This also happens if you deselect files within the content tab after starting the torrent, or at commencement during the save torrent dialogue form. Example shown below.

image

Steps to reproduce

  1. Initiate the download of a torrent that contains multiple files and subfolder content.
  2. Deselect files, using the content tab after the torrent has started OR before starting during the save torrent dialogue form.
  3. Observe the error.

Additional context

Despite having undertaken a 'force recheck' operation, that does not clear the condition and the error persists.

Log(s) & preferences file(s)

image

@Rubber-Duckie
Copy link
Author

Possibly related #18410 , #19048

@Rubber-Duckie
Copy link
Author

Rubber-Duckie commented May 15, 2024

Error
image

There are errors seem related and lead up to the access denied error, see below.

(W) 2024-05-15T14:28:27 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:27 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:27 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:27 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:28 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:28 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:28 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:28 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:30 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:30 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:30 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:30 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:31 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:31 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:31 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:33 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:33 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:33 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:34 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:34 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:34 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:36 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:36 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:36 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:37 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:37 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:37 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:39 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:39 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:39 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:40 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:41 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:42 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:42 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:42 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:42 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:42 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:43 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:43 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:43 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:43 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:43 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:44 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:44 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:44 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:44 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:45 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:45 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:45 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:45 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:45 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:46 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:46 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:46 - Unexpected data detected. Torrent: SomeTorrent. Data: total_wanted=10340482053 total_wanted_done=10340483072.
(W) 2024-05-15T14:28:46 - File error alert. Torrent: "SomeTorrent". File: "F:\SomeTorrent\SomeSubFolder\SomeFile1.!qB". Reason: "SomeTorrent partfile_write (F:\SomeTorrent\SomeSubFolder\SomeFile1.!qB) error: Access is denied"

@Rubber-Duckie
Copy link
Author

Update; If I then go back into the content tab, then ensure I check/select ALL files within the torrent, then click resume. The missing files proceed to download and the torrent finally completes as normal.

@Rubber-Duckie
Copy link
Author

Rubber-Duckie commented May 15, 2024

Not sure if this issue shown below is linked, but I noticed a progress bar suddenly spread across all columns, seems to be another bug on the progress bar, lasted 10 seconds or so before it then converted to "Completed".
Possibly due to Progress Remaining registering as "unknown" for some reason, not sure.

image

This is happening also if you keep resuming a torrent with partial content selected for download after it has stopped due to the aforementioned error. Notice the last file, despite the Priority set to "Do not download" at the get-go, the Progress bar suddenly bugged out. (The file was actually downloaded too!!)

image

@Rubber-Duckie Rubber-Duckie changed the title Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent explicitly Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent May 15, 2024
@Rubber-Duckie Rubber-Duckie changed the title Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent (v4.6.4) May 15, 2024
@Rubber-Duckie Rubber-Duckie changed the title Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent (v4.6.4) Error: ‘partfile_write Access Denied’ when selecting partial content within a Torrent (v4.6.5) May 28, 2024
@glassez
Copy link
Member

glassez commented May 29, 2024

It seems the engine is in conflict with the user content selection criteria, since "SomeSubFolder" does not exist on disk, which is expected, but the file engine is still attempting to download and save to the folder regardless, hence the error.

For me it looks like your torrent has cross-file piece that matches both "unselected" and "selected" files but qBittorrent (namely libtorrent) couldn't write unused part of such a piece in .parts file for some reason thus partfile_write error is raised.

Not only that, but "Access is denied" is in fact the wrong error anyway, as one would expect "folder does not exist".

Given the above, I would not dismiss "Access is denied" as the real reason for the error. Are you sure that the current permissions allow you (qBittorrent) to create files in the root of the disk F:?

@Rubber-Duckie
Copy link
Author

For me it looks like your torrent has cross-file piece that matches both "unselected" and "selected" files but qBittorrent (namely libtorrent) couldn't write unused part of such a piece in .parts file for some reason thus partfile_write error is raised.

This happens with any torrent containing multiple files. You change one or more of the content (files) to priority "do not download" and the error occurs.

Given the above, I would not dismiss "Access is denied" as the real reason for the error. Are you sure that the current permissions allow you (qBittorrent) to create files in the root of the disk F:?

It does have full permissions to create files. Keep in mind, if the application did not have permissions to read and write to the target directory or its cache directory, it would not be able to start the torrent. It would not download parts of the torrent. This is about the setting of some of the files within a torrent to the priority "do not download" and those files causing the error. When the Torrent is in the error state, the only way to continue is to set the files you prioritised to "do not download" to any other priority i.e. normal, high or maximum. Then the torrent will continue to download to completion.

@Rubber-Duckie
Copy link
Author

Rubber-Duckie commented May 29, 2024

Here is an example torrent to try, this has multiple files within it. It seems to be a copy of the audio from shows on you tube. https://www.youtube.com/@howardstern/videos

magnet:?xt=urn:btih:6cfe0714aa4363fd6cb123395e7d62e6f1d3f837&dn=Howard Stern Interview Pack 2 [Dbaum2]&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.birkenwald.de%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.moeking.me%3A6969%2Fannounce&tr=udp%3A%2F%2Fipv4.tracker.harry.lu%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce

Select only one of the files;
image

Observe the error;
image

Then change all the files to normal priority and click resume. Torrent now downloads.

image

image

@glassez
Copy link
Member

glassez commented May 29, 2024

Here is an example torrent to try, this has multiple files within it.

No problem with it.

000

001

Keep in mind that if the application does not work correctly in some case, it does not necessarily mean that the problem is with this application. At least there are some specific conditions in your environment that cause this problem. And it would be nice for you to try to figure it out better before you say something like "This app is seriously broken" out loud.

@glassez
Copy link
Member

glassez commented May 29, 2024

Given the above, I would not dismiss "Access is denied" as the real reason for the error. Are you sure that the current permissions allow you (qBittorrent) to create files in the root of the disk F:?

It does have full permissions to create files.

Would you mind to run the following command in PowerShell and provide its output?

Get-ACL -Path F:\ | Format-Table -Wrap

@Rubber-Duckie
Copy link
Author

I have removed that comment, good point.

I have executed the script;
image

@Rubber-Duckie
Copy link
Author

Rubber-Duckie commented May 29, 2024

You are right!
The permissions are indeed unusual. Typically, built-in users should be granted modify rights, not merely the ability to create files.

The file storage permissions had been customised in an unconventional manner which masked the issue, since the user can still create and delete files and folders.

After resetting the directory permissions to their standard configuration, we’re now seeing the expected behaviour.

image

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

2 participants