Unfortunately I have not made much progress. I think this part of your logs is significant:
2023-01-29 17:21:16 2023-01-29T17:21:16.705Z root ERROR Unexpected error when firing event on build did complete. file:///c%3A/Users/Bob2/AppData/Local/Temp/arduino-sketch-D9FBEEC0EA425D97E67DD50D19412CA4
2023-01-29 17:21:16 2023-01-29T17:21:16.705Z root ERROR Request executeCommand failed with error: command 'arduino.languageserver.notifyBuildDidComplete' not found
I did manage to reproduce the problem once and sure enough I had the same message.
However, my hypothesis is this error message is a symptom rather than the cause. The reason I think this is because this arduino.languageserver.notifyBuildDidComplete
command runs at the end of the compilation process. But from your description, it seems the IDE is already in a bad state before the compilation process even starts. So the error is only the result of the IDE trying to run that command while already in the bad state. I didn't find anything in the logs to give an idea of the cause of the bad state.
Unfortunately I only had that one lucky reproduction out of dozens of attempts so I don't have any idea of what the required conditions are to reproduce it.
What I think would be interesting is to see the Arduino Language Server logs from an IDE session when this fault occurs. There is an advanced option to enable this type of logging. Unfortunately the language server produces a huge quantity of logs, so this is not really the sort of thing you would want to leave running while you used the Arduino IDE normally. It is more suited to enabling just before running a minimal procedure to reproduce a fault, then immediately grabbing the log files before they grow into many megabytes of difficult to interpret content.
In case you want to give it a try, or are just interested in knowing about this feature for your own support work, I'll share my stock instructions for enabling and accessing these logs:
Arduino IDE has an advanced option for enabling logging by the Arduino Language Server tool that proves the code-aware features in Arduino IDE such as problem detection, code information on mouse hover, Go to..., code suggestions, and auto format. Although these logs are not of value for regular usage of Arduino IDE, they can be helpful for troubleshooting problems with the language server.
These are the instructions for generating the log files:
Enable Language Server Logging
- Use the Ctrl/⌘+Shift+P keyboard shortcut to open the "Command Palette" in Arduino IDE.
- Select the "Preferences: Open Settings (UI)" command from the "Command Palette".
The "Preferences" tab will now open in the editor panel.
- In the "Search Settings" field, type
arduino.language.log
- Under the "Arduino > Language: Log", section, check the box next to "☐ True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default."
- Close the Preferences tab by clicking its X icon.
Gather Logs
- Perform the procedure that caused the problem.
- Select Sketch > Show Sketch Folder from the Arduino IDE menus.
The folder containing the sketch will open in your file browser.
- ZIP the entire sketch folder.
-
Instructions for Windows:
- Right click the sketch folder.
- From the context menu that opens, select "Send to".
- Select "Compressed (zipped) folder" from the "Send to" menu.
-
Instructions for Linux:
- Right click the sketch folder.
- From the context menu that opens, select "Compress...".
- In the "Create Archive" dialog that opens, click the Create button.
-
Instructions for macOS:
- Control-click the sketch folder.
- From the shortcut menu that opens, select "Compress"
- Attach the "ZIP" file that was created to a reply here on this forum thread.
You can do this by drag and dropping the file onto a reply, copy/pasting the file, or by clicking the upward pointing arrow icon ("Upload") on the post composer toolbar.
- Close the Preferences tab by clicking its X icon.
Disable Language Server Logging
When language server logging is enabled, log files are saved to every sketch you open in Arduino IDE and they steadily grow in size whenever you are editing the sketch. So the logging is something you would usually want to disable whenever generation of logs is not needed.
- Use the Ctrl/⌘+Shift+P keyboard shortcut to open the "Command Palette" in Arduino IDE.
- Select the "Preferences: Open Settings (UI)" command from the "Command Palette".
The "Preferences" tab will now open in the editor panel.
- In the "Search Settings" field, type
arduino.language.log
- Under the "Arduino > Language: Log", section, uncheck the box next to "
☑
True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default."
- Close the Preferences tab by clicking its X icon.
You are now welcome to delete the .log
files that were added to the sketch folder.