-
Notifications
You must be signed in to change notification settings - Fork 895
-
Notifications
You must be signed in to change notification settings - Fork 895
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
PathTooLongException when using USNJournal #3311
Comments
Possible avenues for tackling this windows specific nuisance:
It looks as if it may be possible to configure the (duplicati) dotnet assembly so that it copes with long paths, however I'm not a dotnet developer and don't have the MS tools nor knowledge to try this out. From the MS article linked regarding unicode.
|
Thanks for the detailed bug report :) It looks like this originates from the call System.IO.DirectoryInfo(path).Root.FullName from within USNJournal.GetVolumeRootFromPath , which is called from several places. Possibly other places raise similar issues once this call is fixed though. @kenkendk, @dgehri: I cannot test this right now since I'm on the road with only Linux at hand. On the weekend I will look into this. |
I have just encountered this error; while ideally the error wouldn't occur, it would be helpful if the log at least identified the specific path(s) which is too long. |
@verhoek : I just encountered the problem myself. I suggest we do as you suggest and switch to using |
Yes I will, either tonight or tomorrow. |
refs ##3311 : fix for PathTooLongException
Any idea when a new canary build will be released with this fix? I just hit this issue and without knowing what file is the cause so I can maybe fix it, my backup is no longer completing successfully. |
After the first time this happened I used Everything by VoidTools to find and rename or delete the items with overlong paths in my backup range, but I am still getting the same error. I have some full paths that are between 248 and 260 characters long, but in none of those are the directories above 248 characters.
EDIT: Still failing with same error after getting directories and absolute paths under 240 and 255 character respectively as in OP |
Just upgraded to 2.0.3.12_canary_2018-10-23 which I thought had the fix, got the same error:
|
Apparently then also getpathroot triggers this exception, though this is not documented. I don't see a clean solution to this problem: things like adding to the registry a certain option to fix this for .NET is not so clean (and only works on windows 10?). EDIT: It seems we're already using such a library in other places, namely AlphaFS. I will create a pull request using AlphaFS. |
It is so ridiculous that .Net still uses the old Windows API with the 260 character limit. We can add support for long paths as explained here: But it still requires users to tweak their machine settings, so for now the best approach is probably just to avoid all calls directly to |
Is there a reason that the app is not spitting out the rejected path (or part of it) into the log so we can see where the failure is happening? I have a computer with this problem and I cannot for the life of me figure out what file it is. Also the hotfix mentioned has been taken down by Microsoft so that people will get windows 10. That annoys me to no end. Update: So I ended up having to delete the entire backup and start over. Whatever it was, it was not coming from the folders being backed up. |
Environment info
Description
When re-running a backup set which contains long file/folder names, and using the Journal USN feature introduced in #3184, the backup fails with a
System.IO.PathTooLongException
.Full scan backups of the set works however, such as when making the initial backup, or when changing the include / exclude filters for the set, so the problem only seems to occur when the USN Journal code branch is triggered.
Steps to reproduce
usn-policy
toRequired
.Actual result:
The second time the backup is executed it fails with the exception
System.IO.PathTooLongException
.Expected result:
Successful backup without the mentioned exception.
Debug log
The text was updated successfully, but these errors were encountered: