arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.3k stars 390 forks source link

IDE startup hangs due to folder-structure recursion in the sketch folder #381

Closed nielsnl68 closed 2 years ago

nielsnl68 commented 3 years ago

Describe the problem

After starting i get the splashscreen and the window with a running wait icon. nothing happens after this.

To reproduce

  1. Start Arduino IDE. No errors are found in the console.
  2. Try to open en skatch

🐛 it crashes with a message behind the splashscreen.

Expected behavior

That it at least removed the splashscreen and gives an overview of the workwindow.

Arduino IDE version

Not stated

Operating system

Windows

Operating system version

10

Additional context

It seems to have been introduced by 2.0.0-beta.3 or 2.0.0-beta.4


I run the latest version of Arduino IDE 1.18.5 as well.


I like to help out on finding what is happening. when someone can politely ask the right questions i will do what i can to updated this bug report

Issue checklist

NikilXYZ commented 3 years ago

Have experienced a similar issue on Surface Go laptops and some older Acer laptop, Windows 10 (student computers).

Seems to hang on that splash screen

NikilXYZ commented 3 years ago

For the record, the IDE opened fine for a couple of weeks and then all of a sudden started this freezing. Not sure what changed

nielsnl68 commented 3 years ago

Did you do an upgrade? Which version did you use when it worked fine?

NikilXYZ commented 3 years ago

Nope no upgrade. Have always been on beta 2.0 v4

Occasionally restarting the entire computer seems to work

On Tue, May 18, 2021 at 9:23 AM nielsnl68 @.***> wrote:

Did you do an upgrade? Which version did you use when it worked fine?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/arduino/arduino-ide/issues/381#issuecomment-843215410, or unsubscribe https://github.com/notifications/unsubscribe-auth/APW66ENQA4AN4N7PA4O5OL3TOJZ5PANCNFSM45CO5PAQ .

kittaakos commented 3 years ago

3. when i try to open en skatch it crashes with a message behind the splashscreen.

Could you please start the IDE from a CMD.exe (instead of clicking on the application icon) and share the terminal output with us after the app crash? Thank you!

nielsnl68 commented 3 years ago

Here is the output of the cmd line:

Starting backend process. PID: 17596
...
daemon INFO Error during sketch processing: Filesystem bottom is too deep (directory recursion or filesystem really deep): c:\...\Arduino\sketch_jan31a\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader
daemon ERROR Error during sketch processing: Filesystem bottom is too deep (directory recursion or filesystem really deep): c:\...\Arduino\sketch_jan31a\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader
root ERROR Uncaught Exception:
root ERROR Error: 13 INTERNAL: Received RST_STREAM with code 2 triggered by internal client error: read ECONNRESET
    at Object.callErrorFromStatus (C:\...\AppData\Local\Programs\arduino-ide\resources\app\node_modules\@grpc\grpc-js\build\src\call.js:31:26)
    at Object.onReceiveStatus (C:\...\AppData\Local\Programs\arduino-ide\resources\app\node_modules\@grpc\grpc-js\build\src\client.js:387:49)
    at Object.onReceiveStatus (C:\...\AppData\Local\Programs\arduino-ide\resources\app\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:299:181)
    at C:\...\AppData\Local\Programs\arduino-ide\resources\app\node_modules\@grpc\grpc-js\build\src\call-stream.js:145:78
    at processTicksAndRejections (internal/process/task_queues.js:76:11)
daemon INFO Daemon exited with exit code: 1.

let of warning as i saw looking around. I hope it helps.

kittaakos commented 3 years ago

Thank you! This is the problematic part from the logs:

daemon ERROR Error during sketch processing: Filesystem bottom is too deep (directory recursion or filesystem really deep): c:\Users\HP\Documents\Arduino\sketch_jan31a\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader\rfid-reader
root ERROR Uncaught Exception:

The IDE cannot start because there is a folder-structure recursion under: c:\Users\HP\Documents\Arduino\sketch_jan31a\rfid-reader\rfid-reader. If you know how to reproduce it, or if you remember what you did with the IDE, please share the steps so that someone can fix it.

always been on beta 2.0 v4

😕 Unfortunate. A recursion-related issue was fixed as part of 2.0.0-beta.4 the release.

I had the same issue previously on Windows, and there is a workaround. I had to wipe the corrupted folder structure manually. Unfortunately, I am not aware of any kind of solution other than deleting c:\Users\HP\Documents\Arduino\sketch_jan31a\rfid-reader\rfid-reader from your file system.

For me, it was tricky. Deleting the file recursion took forever on Windows. I tried with Explorer, CMD.EXE, and Total Commander. Finally, I ended up using Git Bash for deletion. If you use Git Bash, you have to do the followings to delete the folder recursively:

Please make sure to make a backup before you perform some unrecoverable deletion

rm -rf ~/Documents/Arduino/sketch_jan31a/rfid-reader/rfid-reader

@per1234, do you happen to know any other less invasive solution than rm -rf? Thank you!

nielsnl68 commented 3 years ago

I had the same issue previously on Windows, and there is a workaround. I had to wipe the corrupted folder structure manually. Unfortunately, I am not aware of any kind of solution other than deleting c:\Users\HP\Documents\Arduino\sketch_jan31a\rfid-reader\rfid-reader from your file system.

For me, it was tricky. Deleting the file recursion took forever on Windows. I tried with Explorer, CMD.EXE, and Total Commander. Finally, I ended up using Git Bash for deletion. If you use Git Bash, you have to do the followings to delete the folder recursively:

Owww, i should have read the whole message, then i would not have taken so much time to try the same options. I managed to move the folder away from the Arduino skatch folder, after that arduino-ide started up again.

Please make sure to make a backup before you perform some unrecoverable deletion

rm -rf ~/Documents/Arduino/sketch_jan31a/rfid-reader/rfid-reader

@per1234, do you happen to know any other less invasive solution than rm -rf? Thank you!

Thanks for your help, sadly the rm -rf solution was not working for me. I'm getting a 'File name too long' message. So for me de damage is more serious, then yours. I think

nielsnl68 commented 3 years ago

@dev's could you share the code that created this issue. Maybe it can be used to resolve the issue as well. when it can create so many sub-folders maybe it can delete them as well.

kittaakos commented 3 years ago

I'm getting a 'File name too long' message.

Please share the entire error/output so that we can figure out what's wrong. Thanks!

nielsnl68 commented 3 years ago

noting much only a lot of \rfid-reader after i called rm -rf <recursingfolder> in the git bash as you suggested above. Btw. The error message is from rm -rf So the number of recursion folders was just to much for rm.

per1234 commented 3 years ago

Hi all. I apologize for being so slow to respond. I had this same problem and also had trouble removing the deep folder structure.

I had resigned myself to having the folder as a permanent memento of my beta testing work then when I was providing support to someone on the forum who had the same problem it was mentioned that rm -rf with Git Bash had worked for them to remove it. Even though I had already tried it without success, I gave it another try and was pleasantly surprised to find that it worked. My hypothesis was that some process attempting to deal with the difficult folder structure had gone zombie and locked it. At some point after my initial attempts, I restarted my computer, which killed the process and unlocked the folder, allowing it to be deleted.

I just did some experiments and, after a few false starts when I was able to delete the folders normally without any problems, was finally able to reproduce the problem of the impossible to delete folder structure. I restarted my computer and sure enough I was then able to delete it.

So please restart your computer and then try another attempt at rm -rf @nielsnl68. After that, please let us know what the results are.

Ho-Ro commented 3 years ago

This is the same behaviour as already mentioned in #351 (big directory structures with circular links exist in sketchbook directory).

nielsnl68 commented 3 years ago

True, at the time of posting, i did not know what the issue was. Later someone pointed me to that same issue.

Still waiting for a good solution from the Arduino-edi team, to fix this.

Ho-Ro commented 3 years ago

Yes, it's nasty since I organize my documents and directories heavily with (criss-cross) softlinks.

per1234 commented 2 years ago

Since we have not received any additional reports from users who were affected by https://github.com/arduino/arduino-ide/pull/211 in over a year, I think this issue has served its purpose of documenting remediation measures. So I will close this.

We will track the need for the IDE to gracefully handle problematic sketchbook folder structures intentionally produced by the user in https://github.com/arduino/arduino-ide/issues/351.