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

Temp folder cannot be found #1111

Open
ThexXTURBOXx opened this issue Aug 14, 2022 · 8 comments
Open

Temp folder cannot be found #1111

ThexXTURBOXx opened this issue Aug 14, 2022 · 8 comments
Labels
needs-info Additional information needed from the issue author type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@ThexXTURBOXx
Copy link

ThexXTURBOXx commented Aug 14, 2022

When running pana on any project, I get the following error log:

INFO       Running `G:\Programme\Flutter_SDK\bin\cache\dart-sdk\bin\dart.exe --version`...
INFO       Running `flutter.bat --no-version-check --version --machine`...
INFO       Running `git rev-parse --show-toplevel`...
SHOUT      Problem analyzing
           FileSystemException: Deletion failed, path = 'C:\Users\Nico Mexis\AppData\Local\Temp\pana_e1ddb63e' (OS Error: Das System kann den angegebenen Pfad nicht finden.
           , errno = 3)
           #0      _Directory._deleteSync (dart:io/directory_impl.dart:201:7)
           #1      FileSystemEntity.deleteSync (dart:io/file_system_entity.dart:412:7)
           #2      withTempDir (package:pana/src/utils.dart:237:14)
           <asynchronous suspension>
           #3      main (file:///C:/Users/Nico%20Mexis/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pana-0.21.15/bin/pana.dart:174:19)
           <asynchronous suspension>

Das System kann den angegebenen Pfad nicht finden. means basically Path not found.

The error seems to be fairly new since I cannot remember something like this happening a few months ago.

The funny thing is: The folder C:\Users\Nico Mexis\AppData\Local\Temp\pana_e1ddb63e in fact does exist. I suspect it might have something to do with the space in my username as this causes problems most of the time...

Edit: Here you can clearly see that this folder exists:
grafik

@ThexXTURBOXx
Copy link
Author

Addendum: This issue seems to be a lot more fatal than I thought:
When trying to run pana with my pathfix profile (which has no space within its username), the same error occurs:

SHOUT      Problem analyzing
           FileSystemException: Deletion failed, path = 'C:\Users\pathfix\AppData\Local\Temp\pana_d4a1f238' (OS Error: Das System kann den angegebenen Pfad nicht finden.
           , errno = 3)
           #0      _Directory._deleteSync (dart:io/directory_impl.dart:201:7)
           #1      FileSystemEntity.deleteSync (dart:io/file_system_entity.dart:412:7)
           #2      withTempDir (package:pana/src/utils.dart:237:14)
           <asynchronous suspension>
           #3      main (file:///C:/Users/pathfix/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pana-0.21.15/bin/pana.dart:174:19)
           <asynchronous suspension>

So, there is something fundamentally wrong now here.

@ThexXTURBOXx
Copy link
Author

After successfully using pana on some packages, I found out that this issue seems to be related to specific packages only.
The package where this issue arises is this one: https://github.com/ThexXTURBOXx/catcher

@isoos isoos added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Aug 14, 2022
@isoos
Copy link
Collaborator

isoos commented Aug 22, 2022

I am able to run pana on ThexXTURBOXx/catcher without issues on Linux, so I guess the root cause could be something on Windows or with the anti-virus or other protective programs you are running. Do you have Windows Protection enabled? It could block deleting from the temp directory if it finds something suspicious.

@ThexXTURBOXx
Copy link
Author

@isoos Thanks for the suggestion: I have Kaspersky Internet Security installed and disabled it for another test run. Alas, it still does not work. I also updated pana to 0.21.16 in the mean time.

F:\Misc\SelfBuilt\catcher>pana --no-warning
INFO       Running `G:\Programme\Flutter_SDK\bin\cache\dart-sdk\bin\dart.exe --version`...
INFO       Running `flutter.bat --no-version-check --version --machine`...
INFO       Running `git rev-parse --show-toplevel`...
SHOUT      Problem analyzing
           FileSystemException: Deletion failed, path = 'C:\Users\Nico Mexis\AppData\Local\Temp\pana_979eb086' (OS Error: Das System kann den angegebenen Pfad nicht finden.
           , errno = 3)
           #0      _Directory._deleteSync (dart:io/directory_impl.dart:201:7)
           #1      FileSystemEntity.deleteSync (dart:io/file_system_entity.dart:412:7)
           #2      withTempDir (package:pana/src/utils.dart:237:14)
           <asynchronous suspension>
           #3      main (file:///C:/Users/Nico%20Mexis/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/pana-0.21.16/bin/pana.dart:174:19)
           <asynchronous suspension>

@ThexXTURBOXx
Copy link
Author

I think I have found the core of the issue: I played around with pana for a bit now.
When ignoring the exception and letting pana just run beyond that, I get another error:

SHOUT      Problem analyzing
           PathNotFoundException: Directory listing failed, path = 'C:\Users\Nico Mexis\AppData\Local\Temp\pana_6133c333\.\example\linux\flutter\ephemeral\.plugin_symlinks\catcher\example\build\app\intermediates\desugar_graph\debug\out\currentProject\jar_ee708911add644a9179f9bf5c8d2af6084c48105faeeb835fc9a66a103388c35_bucket_0\*' (OS Error: Das System kann den angegebenen Pfad nicht finden.
           , errno = 3)

I think, that the OS Error is misleading in this case: As you can tell, the path is exactly 260 characters long (i.e., 257 without the drive letter). Even though I have enabled long paths on my system, this seems to have no effect on pana or rather the DeleteRecursively function from the SDK.
This all boils down to exactly this issue: dart-lang/sdk#27825
When adding the workaround suggested in that thread like this, I was also able to get beyond this error.
Alas, directory listing apparently cannot be fixed this way since I tried adding the same workaround here, but then a new error message appears:

SHOUT      Problem analyzing
           FileSystemException: Directory listing failed, path = '\\?\C:\Users\Nico Mexis\AppData\Local\Temp\pana_8aba7b52\.\*' (OS Error: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
           , errno = 123)

Translation: The syntax for the file name, directory name or volume label is incorrect

All in all, the underlying SDK issue should be fixed such that this issue here will be fixed as well.

@ThexXTURBOXx
Copy link
Author

After looking through the SDK issues, it seems like there aren't any plans to fix this issue on their side.
Thus, for the time being I would suggest a similar workaround to this inside pana:
https://github.com/alexmercerind/safe_local_storage/blob/f72eb27a023508e2462110e654fe4fe4a1d3d426/lib/file_system.dart#L6-L21

@ThexXTURBOXx
Copy link
Author

Actually, including safe_local_storage as a package in pana works fine to some extent.
My full changes can be found here: ThexXTURBOXx@10f4ca0
There are still many errors being logged, but overall, pana completes and gives me a more-or-less correct summary (some things are wrong as far as I can tell).
However, this comes to show that the underlying issue seems to be rather easy to solve inside pana

@sigurdm
Copy link
Contributor

sigurdm commented Oct 10, 2024

Is this still an issue?

@sigurdm sigurdm added the needs-info Additional information needed from the issue author label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants