qBittorrent always creates .torrent.invalid files #6020

Closed
opened 2026-02-21 18:10:52 -05:00 by deekerman · 6 comments
Owner

Originally created by @ghost on GitHub (Sep 6, 2017).

Hi, I'm running qBittorrent 3.3.15 on Windows 10 Build 15063.540 (version 1703). Someone had the same issue back in 2014 but the discussion there seems to be "closed".

Windows 10 10.0.15063

I set qB to monitor the desktop, which is the directory every download from the web browser goes to. By the way, I'm using Firefox 55, but the same happens with Chrome. So I download a .torrent file, it gets auto-added to the client and the actual files download regularly. Upon finishing, the downloaded file(s) is(are) correctly moved to the folder I set to move the completed downloads.

However, after the download is finished (not the simple.torrent file, but the actual download), instead of disappearing, the .torrent files sitting on the desktop will be renamed to file.torrent.invalid.

There are no other problems except that I have to manually remove them, which is not good.

How to solve it?

Originally created by @ghost on GitHub (Sep 6, 2017). Hi, I'm running qBittorrent 3.3.15 on Windows 10 Build 15063.540 (version 1703). Someone had the same issue [back in 2014](https://github.com/qbittorrent/qBittorrent/issues/1882) but the discussion there seems to be "closed". Windows 10 10.0.15063 I set qB to monitor the desktop, which is the directory every download from the web browser goes to. By the way, I'm using Firefox 55, but the same happens with Chrome. So I download a .torrent file, it gets auto-added to the client and the actual files download regularly. Upon finishing, the downloaded file(s) is(are) correctly moved to the folder I set to move the completed downloads. However, after the download is finished (not the simple.torrent file, but the actual download), instead of _disappearing_, the .torrent files sitting on the desktop will be _renamed_ to `file.torrent.invalid.` There are no other problems except that I have to manually remove them, which is not good. How to solve it?
Author
Owner

@ihendriks commented on GitHub (Jan 31, 2018):

This is an issue for me as well.

  • qBittorrent 4.0.3 (64-bit)
  • Firefox 58.0.1 (64-bit)
  • Windows 10 (64 bit) Build 16299

Not a huge issue since the torrents still work just fine, just somewhat annoying.

@ihendriks commented on GitHub (Jan 31, 2018): This is an issue for me as well. - qBittorrent 4.0.3 (64-bit) - Firefox 58.0.1 (64-bit) - Windows 10 (64 bit) Build 16299 Not a huge issue since the torrents still work just fine, just somewhat annoying.
Author
Owner

@ghost commented on GitHub (Jan 31, 2018):

What a coincidence. I just formated my PC and decided to give qBittorrent another chance (installing a new version) to replace my good and old uTorrent 2.2.1. qBittorrent is indeed more advanced than that version of uT, and I don't plan to use the newer versions of uT for many reasons.

I still get the torrent.invalid error. I set my desktop as my monitored folder, and my browser is set to download directly to the desktop. Always worked like that. Now, instead of moving the newly downloaded .torrent file to the folder I set to store the .torrent files, it renames itself to name.torrent.invalid. This is very annoying, I mean, very! :(

Edit: I'm running qBittorrent 4.0.3 64b on Windows 10 latest version as of now.

@ghost commented on GitHub (Jan 31, 2018): What a coincidence. I just formated my PC and decided to give qBittorrent another chance (installing a new version) to replace my good and old uTorrent 2.2.1. qBittorrent is indeed more advanced than that version of uT, and I don't plan to use the newer versions of uT for many reasons. I still get the torrent.invalid error. I set my desktop as my monitored folder, and my browser is set to download directly to the desktop. Always worked like that. Now, instead of moving the newly downloaded .torrent file to the folder I set to store the .torrent files, it renames itself to name.torrent.invalid. This is very annoying, I mean, very! :( Edit: I'm running qBittorrent 4.0.3 64b on Windows 10 latest version as of now.
Author
Owner

@ihendriks commented on GitHub (Feb 11, 2018):

I did some searching when I replied to this post last week, and apparently it has to do with how firefox downloads files.

I believe firefox makes two files, and after it's finished downloading it renames/removes the one it doesn't need anymore. qBittorrent, however, manages to snatch the torrent file before firefox gets the chance to rename/remove and you end up with that invalid 0kb file.

The issue doesn't happen in chrome because it doesn't make 2 files, it just makes one and renames it when it's finished. Don't think there's anything qbittorrent can do about it, since it's a firefox-related "issue" (a feature, I guess).

@ihendriks commented on GitHub (Feb 11, 2018): I did some searching when I replied to this post last week, and apparently it has to do with how firefox downloads files. I believe firefox makes two files, and after it's finished downloading it renames/removes the one it doesn't need anymore. qBittorrent, however, manages to snatch the torrent file before firefox gets the chance to rename/remove and you end up with that invalid 0kb file. The issue doesn't happen in chrome because it doesn't make 2 files, it just makes one and renames it when it's finished. Don't think there's anything qbittorrent can do about it, since it's a firefox-related "issue" (a feature, I guess).
Author
Owner

@ghost commented on GitHub (Feb 11, 2018):

Are you sure, man? Because a similar behaviour was supposed to occur with uTorrent 2.2.1 when downloading with Firefox to the monitored folder. I believe both torrent applications work essentially the same way when it comes to auto-add-torrents-from-the-monitored-folder, but uTorrent doesn't create .invalid files, even when downloading with Firefox.

@ghost commented on GitHub (Feb 11, 2018): Are you sure, man? Because a similar behaviour was supposed to occur with uTorrent 2.2.1 when downloading with Firefox to the monitored folder. I believe both torrent applications work essentially the same way when it comes to auto-add-torrents-from-the-monitored-folder, but uTorrent doesn't create .invalid files, even when downloading with Firefox.
Author
Owner

@ihendriks commented on GitHub (Feb 11, 2018):

I'm not 100% sure, no, but it does appear to be this way.

To be exact, the sequence appears to be:

  1. Start download in Firefox
  2. Firefox creates an empty (0kb) file with the name of the downloaded item (filename.torrent)
  3. Firefox starts downloading the file with a temporary name (postfixed with .part: filename.torrent.part)
  4. Firefoxes completes the download of the file (still under filename.torrent.part)
  5. qBittorrent recognizes filename.torrent.part as a torrent file and adds it to it's queue (possibly moving or deleting the file from your original download location)
  6. Since qBittorrent moved or deleted the .part file, it has nothing to replace the placeholder filename.torrent file with, and it leaves that empty 0kb file there
  7. qBittorrent attempts to add the file because it's a .torrent file, but it fails because it's not an actual torrent file
  8. qBittorrent renames the filename.torrent file to filename.torrent.invalid to indicate that it's not a valid torrent file

Basically qBittorrent snatches the .part file before firefox is able to replace the placeholder file.

It doesn't happen in chrome because it doesn't make a placeholder, it only makes the .part file and renames after it finishes.

It might not happen with uTorrent because it only looks for .torrent files, which allows Firefox to finish it's job.

You can see the .part behaviour if you download a somewhat bigger file while looking at the folder's contents.

@ihendriks commented on GitHub (Feb 11, 2018): I'm not 100% sure, no, but it does appear to be this way. To be exact, the sequence appears to be: 1. Start download in Firefox 2. Firefox creates an empty (0kb) file with the name of the downloaded item (`filename.torrent`) 3. Firefox starts downloading the file with a temporary name (postfixed with .part: `filename.torrent.part`) 4. Firefoxes completes the download of the file (still under `filename.torrent.part`) 5. qBittorrent recognizes `filename.torrent.part` as a torrent file and adds it to it's queue (possibly moving or deleting the file from your original download location) 6. Since qBittorrent moved or deleted the `.part` file, it has nothing to replace the placeholder `filename.torrent` file with, and it leaves that empty 0kb file there 7. qBittorrent attempts to add the file because it's a .torrent file, but it fails because it's not an actual torrent file 8. qBittorrent renames the `filename.torrent` file to `filename.torrent.invalid` to indicate that it's not a valid torrent file Basically qBittorrent snatches the .part file before firefox is able to replace the placeholder file. It doesn't happen in chrome because it doesn't make a placeholder, it only makes the .part file and renames after it finishes. It might not happen with uTorrent because it only looks for .torrent files, which allows Firefox to finish it's job. You can see the .part behaviour if you download a somewhat bigger file while looking at the folder's contents.
Author
Owner

@FranciscoPombal commented on GitHub (Sep 13, 2020):

No longer applicable/fixed in recent versions.

@FranciscoPombal commented on GitHub (Sep 13, 2020): No longer applicable/fixed in recent versions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#6020
No description provided.