Open nosknut opened 1 year ago
Identical to the bug I'm seeing after the new macOS update.
I believe you are correct that this is a permissions issue. I'm experiencing the same thing after updating to Sonoma, and in the Mac's Console.app, I see the following for each attempt to verify or upload a sketch:
syspolicyd | Terminating process due to Gatekeeper rejection
I believe you are correct that this is a permissions issue. I'm experiencing the same thing after updating to Sonoma, and in the Mac's Console.app, I see the following for each attempt to verify or upload a sketch:
syspolicyd | Terminating process due to Gatekeeper rejection
Please please please throw the solution in here if you figure it out 🙏
I believe you are correct that this is a permissions issue. I'm experiencing the same thing after updating to Sonoma, and in the Mac's Console.app, I see the following for each attempt to verify or upload a sketch:
syspolicyd | Terminating process due to Gatekeeper rejection
Please please please throw the solution in here if you figure it out 🙏
After some digging around I did find a solution that worked for me. The trick was to toggle some special permissions for the VSCode app in System Settings. What I did was:
Quit and restart VSCode and see if the extension now works.
Interestingly, I was able to remove the special permissions after VSCode started working and it continued to work just fine.
I believe you are correct that this is a permissions issue. I'm experiencing the same thing after updating to Sonoma, and in the Mac's Console.app, I see the following for each attempt to verify or upload a sketch:
syspolicyd | Terminating process due to Gatekeeper rejection
Please please please throw the solution in here if you figure it out 🙏
After some digging around I did find a solution that worked for me. The trick was to toggle some special permissions for the VSCode app in System Settings. What I did was:
- Go to System Settings
- Go the the Privacy & Security section
- Select the Full Disk Access option
- Click the "+" button to add Visual Studio Code, or make sure the toggle is "On" if VSCode is already in the list
- Repeat the process for the Developer Tools and App Management sections within Privacy & Security section
Quit and restart VSCode and see if the extension now works.
Interestingly, I was able to remove the special permissions after VSCode started working and it continued to work just fine.
Awesome, I can confirm that this fixes (well, works around) the issue.
@dbmzzo I had the same problem for days and finally with your help this got solved ! Now VSCode verifies and compiles the .ino again. Thanks!
I don't see that as an issue but really for what it is for: your own security
You understand that giving Visual Studio Code full access to your whole disk creates a risk (if there is a bug or vulnerability in vscode then your whole Mac might be at risk).
It's unfortunate that vscode needs read / write access to areas that are off limits. That's a design flaw there.
that was a good note though (if that works after a reboot)
Interestingly, I was able to remove the special permissions after VSCode started working and it continued to work just fine seems vscode then only need to access whatever location only once and then be done with it...
If that works then it would be a sound advice to revoke the elevated rights if they are not needed.
@benmcmorran @elektronikworkshop @yaohaizh @gcampbell-msft Hello guys, can anyone of you have a look at this very annoying issue for MacOS users?
Thanks
I believe you are correct that this is a permissions issue. I'm experiencing the same thing after updating to Sonoma, and in the Mac's Console.app, I see the following for each attempt to verify or upload a sketch:
syspolicyd | Terminating process due to Gatekeeper rejection
Please please please throw the solution in here if you figure it out 🙏
After some digging around I did find a solution that worked for me. The trick was to toggle some special permissions for the VSCode app in System Settings. What I did was:
- Go to System Settings
- Go the the Privacy & Security section
- Select the Full Disk Access option
- Click the "+" button to add Visual Studio Code, or make sure the toggle is "On" if VSCode is already in the list
- Repeat the process for the Developer Tools and App Management sections within Privacy & Security section
Quit and restart VSCode and see if the extension now works.
Interestingly, I was able to remove the special permissions after VSCode started working and it continued to work just fine.
THX
EDIT: Based on additional experience with this issue, I now believe that I had two issues when I originally wrote this comment: 1) a quarantined extension, indicated by the @
in the file permissions, 2) the issue that is fixed following @dbmzzo's instructions. See also my new comment below.
Original comment unedited:
—
I was able to resolve the {"code": null}
) error on an M1 using these steps:
vsciot-vscode.vscode-arduino
) extensionls -ld ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*
to see whether the extension is still therels -ld …
again to checkls -ld …
will report No such file or directory
Additional notes:
arduino-cli.app
file permissions of the old (broken on Sonoma) extension were:
-rwxr-xr-x@ 1 fredsa primarygroup 27917936 Aug 7 22:14 /Users/fredsa/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-arm64/assets/platform/darwin-arm64/arduino-cli/arduino-cli.app
. Unfortunately, I did not run xattr -l …
, so I don't know what that @
was representing. Whatever it was, it was either added as part of the OS upgrade to Sonoma, or is an attribute that Sonoma has a problem with, but the previous OS did not.-rwxr-xr-x 1 fredsa primarygroup 27917936 Nov 5 12:43 /Users/fredsa/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-arm64/assets/platform/darwin-arm64/arduino-cli/arduino-cli.app
Finally, while I don't think @dbmzzo's steps were needed, for completeness sake, I did try those settings first. Here are the steps I actually followed:
That last step (#3) suggests to me that the "Privacy & Security > {Full Disk Access, Developer Tools, App Management}" settings are not needed, but I could be wrong. It's possible that my machine had two issues: a) the broken extension that needed to be reinstalled on Sonoma, b) VS code needed one-time access to make a change that was granted by the Privacy & Security settings.
I was able to resolve the
{"code": null}
) error on an M1 using these steps:
- Uninstall the Arduino (
vsciot-vscode.vscode-arduino
) extension- Reload (restart) VS Code
- Important: Make sure the the extension has actually been removed from disk:
- Use
ls -ld ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*
to see whether the extension is still there- If that folder does still exists, restart VS code again --> wait a few seconds --> run
ls -ld …
again to check- Once the folder has actually been deleted,
ls -ld …
will reportNo such file or directory
- Once the extension is gone from disk, reinstall the Arduino extension
- The extension should now work normally
Additional notes:
- On my machine I always need to restart VS Code twice after uninstalling the extension. Otherwise the extension is not actually removed from disk. YMMV.
- The broken Arduino extension was working fine before the upgrade to Sonoma.
- The
arduino-cli.app
file permissions of the old (broken on Sonoma) extension were:-rwxr-xr-x@ 1 fredsa primarygroup 27917936 Aug 7 22:14 /Users/fredsa/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-arm64/assets/platform/darwin-arm64/arduino-cli/arduino-cli.app
. Unfortunately, I did not runxattr -l …
, so I don't know what that@
was representing. Whatever it was, it was either added as part of the OS upgrade to Sonoma, or is an attribute that Sonoma has a problem with, but the previous OS did not.- After reinstalling the Extension on Sonoma, the new (working on Sonoma) file permissions were
-rwxr-xr-x 1 fredsa primarygroup 27917936 Nov 5 12:43 /Users/fredsa/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-arm64/assets/platform/darwin-arm64/arduino-cli/arduino-cli.app
Finally, while I don't think @dbmzzo's steps were needed, for completeness sake, I did try those settings first. Here are the steps I actually followed:
- Granted VS Code access under "Privacy & Security > {Full Disk Access, Developer Tools, App Management}" --> Did not appear to fix anything for me.
- Uninstalled Arduino extension --> restarted VS code a couple of times --> confirmed ~/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-arm64 was gone --> reinstalled Arduino extension --> extension immediately started working again
- Undid the grants for VS Code in "Privacy & Security > {Full Disk Access, Developer Tools, App Management}" --> Uninstalled Arduino extension --> confirmed directory was gone --> reinstalled Arduino extension --> extension was still working
That last step (#3) suggests to me that the "Privacy & Security > {Full Disk Access, Developer Tools, App Management}" settings are not needed, but I could be wrong. It's possible that my machine had two issues: a) the broken extension that needed to be reinstalled on Sonoma, b) VS code needed one-time access to make a change that was granted by the Privacy & Security settings.
I know the original disk access fix worked for the people who needed it on my end. It sounds like you had a different problem.
Regarding the @ at the end of the permissions, it’s likely metadata flagging a quarantined file (in this case app downloaded from the web / brought in through a third party app or source) and which drives Gatekeeper’s notifications.
I know the original disk access fix worked for the people who needed it on my end. It sounds like you had a different problem.
Regarding the @ at the end of the permissions, it’s likely metadata flagging a quarantined file (in this case app downloaded from the web / brought in through a third party app or source) and which drives Gatekeeper’s notifications.
Given the file permissions / file attributes issue I found, and the Privacy & Security settings that worked for others, it would be great if others with this issue tried the following:
ls -l ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*/assets/platform/*/arduino-cli/arduino-cli.app
xattr -l ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*/assets/platform/*/arduino-cli/arduino-cli.app
-rwxr-xr-x
:
-rwxr-xr-x
?-rwxr-xr-x
?
Hi, I have the same issue after macos update. I've tried to give full disk access to vscode, uninstalla and reinstall extension, without success. When I execute builtin arduino-cli within extension directory I obtain "killed" message. There is any other protection system?
~/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-x64/assets/platform/darwin-x64/arduino-cli
$ la
total 57488
-rw-r--r-- 1 alfonso staff 34K 7 Nov 21:24 LICENSE.txt
-rwxr-xr-x 1 alfonso staff 28M 7 Nov 21:24 arduino-cli.app
$ ./arduino-cli.app version
[1] 49607 killed ./arduino-cli.app version
✘ ~/.vscode/extensions/vsciot-vscode.vscode-arduino-0.6.0-darwin-x64/assets/platform/darwin-x64/arduino-cli
Thank you in advance for help.
Faced to the very same issue on Macos 14 yesterday. Interesting, it's not possible to find anything useful using Google search - issue is new and not really known by the search engine. Today I decided to have a look on the open issues here and found it immediately :)
I granted full disk access, add to app management and developer tools, so extension started to work - I could verify and upload my sketch. After that I switched the full disk access off again, restarted the VS Code and it looks like still working.
Will keep the setup for a while. Hope, MS will fix this annoying issue or at leas provide official FAQ for it.
As temp solution. Set output folder in your arduino.json, for ex. "output": "./output", create a folder, in Finder click Get Info, unlock in the very bottom, set Read&Write for Everyone, then Apply for enclosed items. Not sure that last one is necessary, but I have already files there after successful built with granted permissions.
UPD After try to build again I'm getting
Error during build: unable to read contents of the source item: open ../output/compile_commands.json: no such file or directory
deleting of this file allows to build. Not quite handy, but maybe will help to solve this issue sooner.
I was able to resolve {"code":null}
without touching any permissions.
I have attempted to install the arduino-cli manually on the first student's computer and using the cli directly through a terminal poses no problems. I was unable to configure the arduino extension to use the cli instead of the bundled cli in the time available.
Like @nosknut, I observed that arduino-cli
was working correctly. After I configured the VSCode extension to use the separate CLI instead of the bundled CLI, the extension works again.
arduino-cli
installed via Homebrew.which arduino-cli
in my terminal to get its path, which in my case was /usr/local/bin-arduino-cli
."arduino.path": "/usr/local/bin"
and "arduino.commandPath": "arduino-cli"
to .vscode/settings.json
.I was able to resolve {"code":null} without touching any permissions.
I confirm this works
Following on from this.. Note: I did/do not have arduino-cli installed via homebrew or similar.
The permissions issue seems to relate to the file name. The bundled version of the arduino-cli has been renamed to arduino-cli.app. This is what I think is triggering gatekeeper to kill it. To show this try the following:
cd ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*/assets/platform/*/arduino-cli/
./arduino-cli.app version
(you get back - zsh: killed ./arduino-cli.app)cp arduino-cli.app arduino-cli
./arduino-cli version
(you get back - arduino-cli Version: 0.31.0 Commit: 940c9457 Date: 2023-02-22T16:15:54Z) ie all is workingmv arduino-cli /usr/local/bin/
) and added the arduino.path and arduino.commandPath to settings [per @btmills above] and restarted vscode and all then works without any permissions changes and using the bundled arduino-cli (which appears be 7 months behind the current released version of 0.34.2 but is the version the devs have tested with I assume).I don't view the above as anything like a permanent solution however it did get me going again without any permissions changes that would take more analysis than i want to do right now.
I'm not sure why the devs changed the file name however it seems to be what is driving the issue so I assume it would be easy enough to change it back in the next version of this plugin.
I've now encountered {"code": null}
a number of times on the same machine running Sonoma. Since I've also installed an upgrade to Sonoma a few times, I suspect that this issue is reappearing each time an OS update is installed.
I have reliably been able to fix the issue every time using @dbmzzo's instructions. Specifically:
{"code": null}
output error message.—
For completeness, I'll note that this first time I encountered this issue after an upgrade from an earlier OS version to Sonoma, I believe I had the additional problem that Arduino extension was quarantined as @JM-FRANCE suggested, indicated by the @
in the file permissions (-rwxr-xr-x@
) when I ran ls -ld ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*
. Unfortunately, I did not run xattr -l ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*
which would've confirmed this.
I've now encountered
{"code": null}
a number of times on the same machine running Sonoma. Since I've also installed an upgrade to Sonoma a few times, I suspect that this issue is reappearing each time an OS update is installed.I have reliably been able to fix the issue every time using @dbmzzo's instructions. Specifically:
- Try "CMD-SHIFT-P > Arduino: Rebuild IntelliSense Configuration", but get
{"code": null}
output error message.- Grant VS Code access 3x under "Privacy & Security > {Full Disk Access, Developer Tools, App Management}"
- Try "CMD-SHIFT-P > Arduino: Rebuild IntelliSense Configuration", which now works
- (Undo the permission grants in step 2)
— For completeness, I'll note that this first time I encountered this issue after an upgrade from an earlier OS version to Sonoma, I believe I had the additional problem that Arduino extension was quarantined as @JM-FRANCE suggested, indicated by the
@
in the file permissions (-rwxr-xr-x@
) when I ranls -ld ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*
. Unfortunately, I did not runxattr -l ~/.vscode/extensions/vsciot-vscode.vscode-arduino-*
which would've confirmed this.
What is the possibility of resolving this issue for macOS Sonoma (M1 MacBook)? And what about PlatformIO for Arduino, What do you think?
As I said above, "all" the devs have to do is rename arduino-cli.app to arduino-cli and then change the default name for the Arduino CLI from arduino-cli.app to arduino-cli in the plugin code and all should be good. I assume this would be quick and easy to do for the Devs. If it is not then I would be interested to hear why.
In the meantime, if you want to avoid having to play with permissions after every restart you can just use the combination of @btmills and my formulas mentioned above.
Go the extensions, search for arduino extension and click on "switch to pre-release version" beside uninstall button and click on "Reload required"
This remains an issue on MacOS. Are there any plans to fix it?
I am curious to hear a dev response to @andrewk123's comment above which looks like the best solution if it works. https://github.com/microsoft/vscode-arduino/issues/1681#issuecomment-1936646817
I fixed the problem with following https://github.com/microsoft/vscode-arduino/issues/1681#issuecomment-1795449722 .
The version of Auduino extension I've fixed is v0.6.230727001 (pre-release).
I have seen this problem on 2 macs now for a pair of students i tutor. The tirst one was unsure of what had changed but the second student pointed out he recently updated from "Big Sur" to "Sonoma".
The error message is produced by these lines in the vscode-areduino extension codebase: https://github.com/microsoft/vscode-arduino/blob/main/src/arduino/arduino.ts#L863-L866
The { "code": null } error comes from the reason object and seems to me the nodejs spawn function is producing a null error code.
I have attempted to install the arduino-cli manually on the first student's computer and using the cli directly through a terminal poses no problems. I was unable to configure the arduino extension to use the cli instead of the bundled cli in the time available.
It seems clear that the issue lies between the run function i linked above and the arduino-cli.
This could be caused by filesystem access issues related to the new os or an issue with the extension being able to execute the command?