-
-
Notifications
You must be signed in to change notification settings - Fork 398
Recover from interrupted discovery/monitor installation #1669
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
Comments
This now results in a cryptic panic that gives no clue about the cause to mere mortals:
The demo was done using Linux, but the problem also occurs on Windows. |
Is this happening when there is only the directory without the executable? |
That is correct.
|
#1814 fixed the panic I reported in my previous comment, but it did not resolve the feature request for Arduino CLI to recover from a situation where a discovery executable goes missing.
|
I'm reopening this issue because, although a nice improvement in this area, #2107 is not a complete solution. The most common conditions where the user's encounter this issue are that only the executable file is missing (most often due to being quarantined by the user's security software). #2107 detects the broken installation state only when the tool release installation folder is empty (per the issue's original simplified demo, which cleared the entire folder), but we are including a
|
May I suggest installing in a temporary directory and then only after everything has been extraced copy it over to the final installation path? If even a single file copy fails abort the whole process and remove the ones that have been copied. Also I's suggest blocking the possibility of interrupting the execution to prevent it being interrupted during steps that would leave files behind. |
Also to check if the installation is valid I'd create a checksum of the whole folder when it's first installed. |
The issue here is that the copy is successful, but the antivirus will move the file into quarantine after the installation has been completed.
This is an expensive operation to do at every run of the CLI.... |
We could add an after install check to verify the integrity and warn the user that installation wasn't successfull cause of the antivirus maybe. Even using the same checksum strategy, assuming the file is removed immediately after the copy.
Fair enough, less expensive and frustrating than a bad UX for me though. Maybe do it only when the CLI is trying to run a certain tool, and act accordingly. |
Given the very simple format of the discoveries, I guess that just checking if the executable is there is enough. |
UX wise you are adding a fixed delay to 100% of the users to solve an issue that 0.01% are experiencing... |
Yeah, if the issue is present only for discoveries it would make sense to check only for those.
True that, I have no metrics either way. 😉 |
Describe the request
Reinstall pluggable discovery and monitor tools of the
builtin
package if the tool executable is not found.Describe the current behavior
Arduino CLI automatically installs pluggable discovery and pluggable monitor tools of the
builtin
package when missing or updatable. These tools allow Arduino CLI to find the "ports" used for communication with Arduino boards.It can happen that the installation process is interrupted or interfered with.
🙁 If a problem during the installation results in the creation of the tool's release installation folder without the tool executable, Arduino CLI can no longer do discovery. It will not automatically recover from this condition and the user must manually delete the incomplete installation in order to restore Arduino CLI to functionality.
To reproduce
Arduino CLI version
2c2a5cc
Operating system
Windows, Linux
Operating system version
Windows 11, Ubuntu 22.04
Additional context
Originally reported at https://forum.arduino.cc/t/ide-2-0-lost-all-com-ports/960650
This situation is more problematic for Arduino IDE users, since the error message about the missing tool is not visible to them and they only notice the symptom of the IDE not seeing their ports.
It might seem unlikely for this interrupted installation to occur under real world conditions, but the equivalent issue with Boards Manager producing incomplete tools installations has been reported by users periodically ever since the introduction of Boards Manager, at sufficient volume for Arduino Support to consider it worth a Help Center article:
https://support.arduino.cc/hc/en-us/articles/360018444739-Error-file-does-not-exist-no-such-file-or-directory-system-cannot-find-the-file-specified
The text was updated successfully, but these errors were encountered: