mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Bug when temporary download path is exactly 255 characters long (Windows) #5486
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#5486
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bluikko on GitHub (Apr 30, 2017).
Please provide the following information
qBittorrent version and Operating System:
qBittorrent 3.3.12 x64, Windows 7 x64 fully updated
What is the problem:
If the download temporary path on NTFS is exactly 255 characters long (including the ".qb!" temporary file additional extension), qBittorrent fails to complete the download when the file reaches 100%. Instead an IO error is displayed and the torrent stalls.
What is the expected behavior:
After downloaded file reaches 100%, the temporary "unfinished" file with ".qb!" extension should be completed. Instead, qBittorrent gives an IO error with "The system cannot find the file specified".
Steps to reproduce:
Download a torrent that includes a file that when put to the "unfinished" folder has a pathname of exactly 255 characters, including the ".qb!" unfinished file extension. Wait until file reaches 100% and the file will get an IO error.
Extra info(if any):
Seems to be an edge case that was missed - issue #18 probably handles cases where the path length is longer than the maximum length and not the case where the path reaches exactly the maximum path length.
@arvidn commented on GitHub (Apr 30, 2017):
the 255 character restriction applies to each individual path element, right? libtorrent uses UNC paths which are supposed to extend the limit of the full path to 32k characters, but you're right that there may still be logic to make sure each individual name in the path does not exceed 255.
@arvidn commented on GitHub (Apr 30, 2017):
actually, the current logic (when loading .torrent files) is to truncate directory names with long names to avoid this problem. The current limit is 240 characters (+ file extension).
https://github.com/arvidn/libtorrent/blob/RC_1_1/src/torrent_info.cpp#L340
Can you tell whether this logic triggers?
@bluikko commented on GitHub (Apr 30, 2017):
The issue I am having is for path that is exactly 255 characters long total, including drive, path to unfinished downloads, torrent directory and filename, plus the ".qb!" extension of unfinished download file. Example:
d:\torrent\unfinished\torrent_with_long_path\torrent_with_long_file....ext.qb!
The whole above path is 255 characters long.
@arvidn commented on GitHub (Apr 30, 2017):
I see, so perhaps libtorrent makes sure that it won't produce longer filenames, but once qBT appends its extension it exceeds the limit. Perhaps libtorrent should leave some margin
@FranciscoPombal commented on GitHub (Mar 22, 2020):
Should be fixed by https://github.com/qbittorrent/qBittorrent/pull/12154, which will land in 4.2.2. Open a new issue report if you experience the same problem with that version.