Steps to Reproduce:
This has been happening for the last few weeks so it isn't a recent development, but with the daily builds now it's a little more annoying. Downloading the most recent version from the website and replacing it works fine. The stable build of Code I have installed does the automatic update fine. I have both builds installed in my Applications folder.
Does it always happen? In other words, was an Insider update never successful for you?
@joaomoreno As far as I can remember it's always happened with the insiders build and has never been successful.
Have you ever opened Code with sudo
?
Not that I remember. Is there a way I can check to see if I did and fix it?
Basically, you can check the permissions of ~/.vscode-insiders
and ~/Library/Application Support/Code - Insiders
.
~/.vscode-insiders
- drwxr-xr-x 7 myusername
~/Library/Application Support/Code - Insiders
- drwx------ 10 myusername
I tried removing both of those folders and reinstalling an insiders build from a couple of days ago and it still won't update.
@scottaddie Let's do something else:
Here's a copy of the log from when the app started and for the next few minutes after I clicked the 'update' button in vs code. The service errors continue to happen even after quitting vs code. Let me know if there's anything else I can provide.
electron/electron#5139 - did you try restarting your machine? š
Restarting me machine stopped the errors, but they just started again the next time I tried to update the program.
I'm still having this problem. If anyone wants to remote debug my machine, I'm here! Any time I update manually, i.e. grabbing the latest and overwriting it in my applications folder, I still have the problem. the stable build never hiccups.
I am also experiencing this same issue with similar Console.app logs. Also resorting to overwriting every time I need to update.
@ryanmagoon @stephenlaughton Can we take a look at your logs too?
Sure! Iāll grab them in the morning.
Ryan Magoon
Sent with Airmail
On September 2, 2016 at 4:42:00 PM, João Moreno ([email protected])
wrote:
@ryanmagoon https://github.com/ryanmagoon @stephenlaughton
https://github.com/stephenlaughton Can we take a look at your logs too?
ā
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/7426#issuecomment-244482363,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFFJutEuRtA3AlhFNEG4Rex55k3oL3S4ks5qmIoVgaJpZM4IxH5w
.
The same thing is happening to me with El Capitan 10.11.6. The problem is that the update process asks to elevate to do the update:
An update is ready to install. Visual Studio Code - Insiders is trying to add a new helper tool. Type you password to allow this.
Here are the relevant folder permissions on my machine:
// from ~/
drwxr-xr-x 3 <user> <group> 102 Aug 25 18:50 .vscode-insiders
// from ~/Library/Application Support/
drwx------ 9 <user> <group> 306 Aug 25 19:26 Code - Insiders
drwxr-xr-x 6 <user> <group> 204 Sep 19 13:49 com.microsoft.VSCodeInsiders.ShipIt
Here's listing of the com.microsoft.VSCodeinsiders.ShipIt
directory:
$ ll ~/Library/Application\ Support/com.microsoft.VSCodeInsiders.ShipIt/
total 822504
drwxr-xr-x 6 <user> <group> 204 Sep 19 13:49 .
drwx------+ 33 <user> <group> 1122 Sep 19 13:53 ..
-rw-r--r-- 1 root <group> 421115668 Sep 19 13:55 ShipIt_stderr.log
-rw-r--r-- 1 root <group> 0 Aug 25 19:26 ShipIt_stdout.log
-rw-r--r-- 1 <user> <group> 362 Sep 19 13:49 ShipItState.plist
drwx------ 3 <user> <group> 102 Sep 19 13:48 update.62fOJxv
Because the updater asked to elevate, the log files are owned by the root user. While the ShipItState.plist
and update.62fOJxv
update archive files exist there, the ShipIt_stderr.log
file contains a continuous stream of errors trying to read it under the root user, which doesn't exist:
2016-08-25 19:26:44.094 ShipIt[4831:46300] Installation error: Error Domain=SQRLShipItRequestErrorDomain Code=2 "Could not read update request" UserInfo={NSLocalizedDescription=Could not read update request, NSUnderlyingError=0x7fbc3b800ad0 {Error Domain=NSCocoaErrorDomain Code=260 "The file āShipItState.plistā couldnāt be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Application Support/com.microsoft.VSCodeInsiders.ShipIt/ShipItState.plist, NSUnderlyingError=0x7fbc3b800850 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
I only invoke code-insiders from terminal windows (as a regular user, not sudo), but I tried running it via Spotlight and had the same problem.
Also, the ShipItState.plist
file does point to the user install:
$ cat ~/Library/Application\ Support/com.microsoft.VSCodeInsiders.ShipIt/ShipItState.plist
{"launchAfterInstallation":1,"updateBundleURL":"file:\/\/\/Users\/<user>\/Library\/Application%20Support\/com.microsoft.VSCodeInsiders.ShipIt\/update.62fOJxv\/Visual%20Studio%20Code%20-%20Insiders.app\/","useUpdateBundleName":0,"bundleIdentifier":"com.microsoft.VSCodeInsiders","targetBundleURL":"file:\/\/\/Applications\/Visual%20Studio%20Code%20-%20Insiders.app"}
Found it - the /Applications/Visual Studio Code - Insiders.app
file was originally installed by another user in the same group. The group doesn't have write access, which caused the elevation. I think for my case, chmod g+w
on the app file should do the trick.
Nope, that didn't work either. Full reinstall of Code and Code Insiders with my user account didn't seem to work, either.
Btw in order to kill the update service for VSCode Insiders from continually failing in the background, I had to do this for the original sudo update attempts:
> sudo launchctl remove com.microsoft.VSCodeInsiders.ShipIt
and this without for the later user-scoped attempts after full reinstalls of Code that did not involve elevation:
> launchctl remove com.microsoft.VSCode.ShipIt
Even with a complete reinstallation and without elevation requests, the Code updater was continually failing because it was still looking for the ShipItState.plist file in /var/root/... instead of the user folder.
This is Squirrel/Squirrel.Mac#182, _fixed_ by Squirrel/Squirrel.Mac#186, combined with the fact that we seem not to display update error messages anywhere. So, I will use this issue to implement the error message displaying.
@joaomoreno is there a temp fix for this? I ended up there again, and i can't get out of it!
The fix is to put Code on a different folder. What I will do in this issue is make sure the user gets an error message, which for some reason isn't happening.
@joaomoreno makes no sense. I won't change my app to another folder. Especially when it was in my applications folder.
The issue is with gatekeeper which seems to put the app in quarantine, making it ask for password
I also have this issue, and moving the app to another folder is not helping.
@johnfn i finally fixed it here using this
xattr -dr com.apple.quarantine "/Applications/Visual Studio Code - Insiders.app"
You are my hero
--
Ryan Magoon
On December 3, 2016 at 3:41:48 AM, Martin Guillon ([email protected])
wrote:
@johnfn https://github.com/johnfn i finally fixed it here using this
xattr -dr com.apple.quarantine "/Applications/Visual Studio Code -
Insiders.app"ā
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/7426#issuecomment-264626329,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFFJuhcSZx3CvOS0mY8spq3hE-66b6arks5rEStMgaJpZM4IxH5w
.
2fe31ce makes the error visible in the UI. The error is Squirrel/Squirrel.Mac#182.
A possible fix, as @farfromrefug found out, is to run:
xattr -dr com.apple.quarantine "/Applications/Visual Studio Code - Insiders.app"
@joaomoreno / @farfromrefug unfortunately, the fix isn't working. Is there something I can check to make sure the command worked as expected?
Update: I realized my work laptop wasn't updated to Sierra. I tried the command again and it works!
Thanks for the fix! š
Setting verified based on user comment.
I hate to be the bearer of bad news, but even xattr -dr com.apple.quarantine "/Applications/Visual Studio Code - Insiders.app"
does not make a difference for me. I'm on VSCI version 1.8.0 and updating VSCI just closes it and does not update anything.
@johnfn does the system as for your admin password? If not that must be another issue
No, it doesn't.
@johnfn what version of macOS are you on? The command didn't work when I was on El Capitan. Once I updated, though, it worked.
I'm on macOS Sierra as well.
I have the same problem, I'm on Sierra
Yes I too see this issue. I'm on 10.12.2, VSC 1.6.1 and I originally installed VSC as another user. My current account (i.e. the one failing) does not have admin privileges, so I'm prompted for user/password for an admin user which I supply successfully but it fails to update. I also saw this behavior under 10.12.1
Interestingly I could update it without problem from the account of the user that originally installed it suggesting it was either a permissions problem or a privilege problem as the user account that was successful has admin privileges.
I also have had the same problem for many, many releases of code and for different mac os x versions incl. Sierra. It is the single most annoying problem with visual code. The xattr trick did not help. This issue is marked as closed - but it really is not
I have this same issue and it seems to be an electron issue since I had the same issue with Atom until they fixed it in a release. Now it seems to be cropping up on VSCode too. Maybe the VSCode team should look at what Atom did to fix it. Might be a Squirrel framework problem
I also have this issue upgrading v1.8.0 of VS code. I am running macOS 10.12.2 (16C67) and the xattr ...
did not fix the issue š
Any alternative suggestions?
Same as @anisylen. I'm seeing this from Slack as well, so seems related to electron apps.
BTW: I got different behaviour on different machines with same Sierra OS and seemingly identical setup. On one machine update does not work, on one it works fine.
@joaomoreno What about reopening this issue, since the supposed fix does not really work ?
As mentioned before, this is Squirrel/Squirrel.Mac#182.
There was no fix on our side other than showing an error message when the update fails.
@joaomoreno This is now in our Inbox.
If we cannot fix this can we close this as expected? If there is an option to show error message who is the right person to do this?
@sandy081 I am mystified why you want to close this. It is not working and there is no error message shown either. It just restarts and restarts without and end. The user experience is plain awful and overshadows many of the great features of visual code.
@joaomoreno Not sure this is the corresponding reason. I originally had VS code installed before I upgraded to sierra so I think path randomisation might not be in effect. Also, I see now error messages just endless restarts. An actual error message and a reference to the VS log would be nice!
@joaomoreno Also, if it is indeed a sierra path randomisation bug than why does VS update fail on one of my Sierra Macs yet fails on another of my Sierra Macs. I.e. it should fail on ALL my Sierra installations and not just on 50% ?
We'll keep it open while it's not fixed, but we are blocked upstream from Squirrel.Mac. There's certainly some randomness as to whom it happens. I am on Sierra and it works, both my machines.
@joaomoreno Does Squirrel also block you from providing an error message and easy access to the VS log to help investigate this ? It would be nice progress, if at least this first step to a solution was provided. Right now it just endless restarts WITHOUT warnings and there is NO link to a log file or somewhere to investigate (VS should have some command to show to log).
Have you checked in Console.app?
Too much info in the console.app - is there not a dedicated log file for VS ?
We don't have one, sorry.
Another thing you can do is launch Code from the command line like this:
/Applications/Visual\ Studio\ Code\ -\ Insiders.app/Contents/MacOS/Electron
You will get to see Squirrel's output.
Thanks for the command line suggestion. I will try next time I update.
One friendly suggestion: When faced with an apparently "random" error like and many users where only some report errors, I would:
1) Provide a helpful error message in case of failure.
2) Make it VERY easy for users to submit error logs back to the developer.
3) Analyse the failures in order to find a common pattern.
Right now you "think" you are blocked but you really don't know for sure because of the "randomness" of things. You need some data from users to be sure.
BTW: I placed at the supposedly blocking issue (Squirrel/Squirrel.Mac#182) and it speaks about disabling updates for readonly folders. I do not think my personal expereince supports that this is what is wrong. Again, need more data.
The error message should show up: 2fe31ce2c1f4d3022b5699e8700e84a435cbe13e. But in your case, it seems that the error doesn't happen when Squirrel tries to apply the update, but when the app is restarted. I'm giving you directions to try to get more info when it happens.
Now, the fact that what you experience might not be Squirrel/Squirrel.Mac#182 is simply a consequence of you having commented on this issue, when it is indeed a different one. The first post reads that
Code closes but doesn't reopen even after waiting a very long time.
While in your case:
It just restarts and restarts without and end.
I chose to continue discussing your case here, in the odd eventuality that it relates to the original issue, but we can move the discussion to a separate issue if it makes it any better.
Yes, you are right - it might be slightly other case. You are exactly right - I don't see an error just that the app restarts without update applied. I can create a new issue and link to this one if you want?
I'm having the same issue as @mmc41. I do not believe it to be a proxy issue as extensions are able to update just fine. The experience is such that it asks to update every time I start code-insiders, and if I press "update now", code just closes and no update occurs.
I'm on MacOS Sierra. I tried the xattr command above to no avail.
I too can not update my VS code. On macOS Sierra. It randomly asks me to enter my username and password to install a "Helper". I do this, then I click "Update Now" and then it closes and does not re-open. When it does, its still an old version.
Update not working on Sierra for me either. Code keeps reminding me of update, when I restart nothing happens and it warns me again.
had anyone solved this issue by any method, i am still having the same problem till now ?!
i have started the editor with electron from the command line as stated above but no logs at all.
+1 still having this problem for 1.8.1 -> 1.9 on MacOS, kinda frustrating -- even running as root as suggested in the other threads, it doesn't work. I am not using the insider version.
fix for me
sudo chown myuser:staff /Users/myuser/Library/Caches/com.microsoft.VSCode.ShipIt/*
you have to change myuser (in 2 places) to your user name
@ankopainting 's solution worked me as well.
I was finally able to upgrade from 1.7.1 to 1.9.0
I hate to be the bearer of yet more bad news, but @ankopainting's solution did not fix my copy of VSCode.
@johnfn , have you checked if the chown
command actually changed the ownership of all the files within the /Users/myuser/Library/Caches/com.microsoft.VSCode.ShipIt/
folder?
Everything appears to be owned by johnfn/staff, with the exception of ShipIt_stdout.log and ShipIt_stderr.log, which I then switched manually.
I actually ran the command on com.microsoft.VSCodeInsiders.ShipIt/ since I am running an insiders build. Hopefully that doesn't make a difference?
Upstream from electron/electron#6345
@ankopainting's solution worked well for me.
Also Squirrel/Squirrel.Mac#199
I'm pretty sure that this can be fixed with xattr
.
I could reproduce the issue on a brand new macOS machine. I confirmed that it happens because the com.apple.quarantine
gets recursively set on the application bundle and Gatekeeper then launches Code from a temporary path, which isn't writable by the user thus explaining the escalation dialog.
There are two steps for the fix:
com.apple.quarantine
attribute from Code, just as @farfromrefug recommendedsudo chown -R $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
I would love if someone that has this issue tries the fix above and let me know the results. @johnfn @jarecsni @islam-taha @TheChuckster @AleskiWeb etc
@joaomoreno I had this issue with a normal install of VS Code, not the insider build. I had just tried to do the update Code closed, came here, did the permissions line sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
and after entering my password it immediately updated Code and relaunched it.
THank yOU!
change xattr and chown solved my problem, if you still fail, try to remove vscode completely, then re-install. I success after I use appdelete to remove all of them.
@joaomoreno Yup, I can confirm that the xattr thing worked!!! š
@joaomoreno
sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
this fixed it for me many thanks
Unfortunately, these steps do not work on my end.
Then VSC restarted, but it still is at 1.9.0 and the update check still asks me to install 1.9.1.
Do I miss anything? Is it because the current user is a non-admin user?
@christophberger If you need admin credentials for copying Code to /Applications
, then update won't work. I suggest to put Code in ~/Applications
.
Actually, that should work. You should get a dialog prompting you for credentials.
What do you get with ls -lad /Applications
@joaomereno I get
drwxrwxr-x+ 193 root admin 6562 9 Feb 16:51 /Applications//
Not sure if directory permissions or ownership can be a problem here, as other self-updating applications usually work just fine.
@joaomoreno it also worked for me! Just updated from 1.9.0 to 1.9.1
I also updated from 1.9.0 to 1.9.1 with any issue.
Not working for me. Since installing on Sierra using a managed Mac I cannot apply updates.
Have tried the settings changes mentioned above.
Set ownership in /Applications to same as successful auto update apps e.g. chrome.
@risingnote Can you put Code in ~/Application
instead? This is exactly the same as @christophberger.
@joaomoreno Yes, this works (just tested it). I'll leave it that way for now although I would love to see a fix for this. (I prefer keeping my apps in /Applications
.)
BTW, VSC has become my favourite tool for Go coding, even though I previously used Vim for virtually everything since years over years! Great job folks.
@christophberger @risingnote Let's track the issue of updating Code when in /Applications
and the user has no perms in #20429
@joaomoreno Thanks for feedback. Have reinstalled into ~/Application and initially got 'Could not create temporary directory.' error when trying to update.
I deleted ~/Library/Caches/com.microsoft.VSCode.ShipIt/ which had somehow got wrong permissions and now seems to update.
Will report any ongoing issues in #20429 as mentioned.
I am also having this issue. I have tried both:
sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
But I am still getting repeated requests for credentials, and not having the application update after it quits.
@libeja Have you tried running both commands, while making sure VS Code is shutdown? Where is VS Code located, in your system?
@joaomoreno Nevermind, I got it to work! I had moved the app to my applications folder, but I kept using the icon in my dock to open it, which I guess was pointing at some other version? Regardless, it works now. Thanks!
I had the same issue, was falling over on xattr
. For some reason /Applications/Visual Studio Code.app
was owned by the root user and not my user which is why it kept falling over. chown
ing that directory and then running xattr fixed it :)
Still having the endless update issue even with 1.9.1, please fix!!!
@TheChuckster Do you mind reading a little bit this thread, especially this post and see whether that fixes it for you?
Yes, that band-aid fix worked this time, still hoping for a real solution for end users.
ls -l /Applications
drwxr-xr-x@ 3 user staff 102 9 Nov 16:15 Visual Studio Code.app
drwxr-xr-x 3 user staff 102 16 Nov 02:32 iTerm.app
The difference is, iTerm can update, VSC will stuck on version 1.8.1 after VSC restart. Icon in the dock points to the Application in /Applications
.
I can confirm that the fix mentioned by @joaomoreno worked for me to update 1.9 to 1.10.1 on MacOS Sierra.
I am still having this issue and already tried the workaround to move "Visual Studio Code.app" to ~/Applications and the sudo chown
/ xattr
commands above.
If it matters, I had Visual Studio Code installed via Managed Software Center (munki) on my work computer.
MacOS: 10.11.6 (El Capitan)
VS Code: 1.8.1
@lyahdav Make sure your user can modify the parent folder of where Code is located. Make sure Code is shutdown. Run the sudo
command. Then, clean the attributes with the xattr
command. Then try again, everyone else reported the workaround has fixed it for them.
If still fails, please provide more details on what you see. Do you get a popup? Does it restart without opening?
@joaomoreno I'm on VS Code 1.8.1. When I launch it, I get this popup:
.
After putting in my credentials I see:
After clicking Update Now, VS Code quits and then never restarts. I noticed my Console log has:
3/7/17 6:18:16.228 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt[45645]) Service exited with abnormal code: 1
3/7/17 6:18:16.228 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt) Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
3/7/17 6:18:18.253 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt[45646]) Service exited with abnormal code: 1
3/7/17 6:18:18.253 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt) Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
3/7/17 6:18:20.276 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt[45650]) Service exited with abnormal code: 1
3/7/17 6:18:20.276 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt) Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
3/7/17 6:18:22.301 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt[45651]) Service exited with abnormal code: 1
3/7/17 6:18:22.301 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt) Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
3/7/17 6:18:24.332 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt[45659]) Service exited with abnormal code: 1
3/7/17 6:18:24.332 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt) Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
3/7/17 6:18:26.359 PM com.apple.xpc.launchd[1]: (com.microsoft.VSCode.ShipIt[45663]) Service exited with abnormal code: 1
This keeps repeating in the logs.
I tried running launchctl remove com.microsoft.VSCodeInsiders.ShipIt
(with and without sudo
) to stop it from continually failing in the background but it wouldn't stop. I assume until I can make that stop I shouldn't try any other commands, so any ideas how to make it stop?
Thanks for this thread @joaomoreno. The chown
& xattr
approach did the trick. Great! Now I am on 1.10 like everyone else.
The chown & xattr approach worked for me as well. Updated from 1.8 to 1.10 successfully.
@lyahdav You should not get the authentication popup at all. There are two reasons why you are getting it:
ls -la@ Visual\ Studio\ Code.app
. If so, read my post above.Just came to this thread as I've been having this updating problems for months. It's been fixed with:
sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
Although initially VSCode wasn't in Applications but after the first line I moved it and did the second line, all worked :) Thanks!
@joaomoreno I figured it out. My issue was that Visual Studio Code.app
was in /Applications
AND it had the wrong owner. So the fix was:
Visual Studio Code.app
to ~/Applications
.sudo chown $USER ~/Applications/Visual\ Studio\ Code.app
EDIT: I'm actually not sure if I really needed to move the app to ~/Applications
. I moved it back to /Applications
and it's working fine, but will have to wait until another update is available to know for sure.
sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
Worked for me
ShipItState.plist < had $USER - no update needed
ShipIt_stder.log < root user updated to $USER
ShipIt_stdout.log root user updated to $USER
The solution of moving code to the ~/applications and running
sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
worked for me, but now its broken both my code shortcut (and an alias I used so I could type vsc instead of code) from the terminal. Has anyone had this problem? If so, how do you fix it?
I was able to get the shortcuts to work by moving the app back to /Applications, but presumably now the updates won't work again.
@MJGwater You should simply put alias vsc=code
in your bashrc or equivalent.
@joaomoreno That shortcut works when Visual Studio Code is in /Applications, but not when its in ~/Applications. However, the updates only work when Visual Studio Code is in ~/Applications.
04/05/17: Actually updating just worked with Visual Studio Code in /Applications. Not sure what change I made that caused this. Maybe you just need to move it to ~/Applications once?
I have a lot of errors while launch vs code on my mac, can anyone help me with that?
Thank you
This seems to happen after every macOS system update.
As a little contribution, I've experienced same issue on MacOs Sierra v10.12.14 and updating VSCode from 1.10.2 to 1.11.1. I've solved setting permissions to admin
group (in my case owner
was correct but group
was set to staff
) to Visual Studio Code.app
in /Applications
as others apps that do auto-update correctly and in ~/LIbrary/Caches
path:
sudo chown -R $USER:admin ~/Library/Caches/com.microsoft.VSCode
sudo chown -R $USER:admin ~/Library/Caches/com.microsoft.VSCode.ShipIt
and to app in /Applications
too:
sudo chown -R $USER:admin /Applications/Visual Studio Code.app
(not sure if last chown in /Applications is relevant, after update I've noticed that group has been reverted to staff
)
@Spike81 thx worked for me with only the 2 firsts commands
sudo chown -R $USER:admin ~/Library/Caches/com.microsoft.VSCode
sudo chown -R $USER:admin ~/Library/Caches/com.microsoft.VSCode.ShipIt
ShipIt_stderr.log:
2017-04-12 22:22:04.324 ShipIt[94566:769471] Beginning installation
2017-04-12 22:22:04.344 ShipIt[94566:769472] Couldn't abort install and restore owned bundle to previous location file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app, error NSError { domain: NSPOSIXErrorDomain, code: 2, description: "No such file or directory" }
2017-04-12 22:22:12.886 ShipIt[94566:769472] Installation error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied}
2017-04-12 22:22:12.886 ShipIt[94566:769472] ShipIt quitting
2017-04-12 22:22:12.923 ShipIt[94583:769889] Resuming installation attempt 2
2017-04-12 22:22:12.944 ShipIt[94583:769892] Couldn't abort install and restore owned bundle to previous location file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app, error NSError { domain: NSPOSIXErrorDomain, code: 2, description: "No such file or directory" }
2017-04-12 22:22:17.012 ShipIt[94583:769892] Installation error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied}
2017-04-12 22:22:17.012 ShipIt[94583:769892] ShipIt quitting
2017-04-12 22:22:17.052 ShipIt[94586:769941] Resuming installation attempt 3
2017-04-12 22:22:17.073 ShipIt[94586:769943] Couldn't abort install and restore owned bundle to previous location file:///Applications/Visual%20Studio%20Code%20-%20Insiders.app, error NSError { domain: NSPOSIXErrorDomain, code: 2, description: "No such file or directory" }
2017-04-12 22:22:21.780 ShipIt[94586:769943] Installation error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=Permission denied}
2017-04-12 22:22:21.780 ShipIt[94586:769943] ShipIt quitting
2017-04-12 22:22:21.818 ShipIt[94595:770139] Too many attempts to install, aborting update
2017-04-12 22:22:21.820 ShipIt[94595:770140] Error aborting installation: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSLocalizedDescription=No such file or directory}
2017-04-12 22:22:21.820 ShipIt[94595:770140] ShipIt quitting
ShitIt has to ask for username / password for rights to write to /Applications.
Also
/Applications/Visual%20Studio%20Code%20-%20Insiders.app
does not exist but
/Applications/Visual Studio Code - Insiders.app
Hmm, I'm also back at this. chown (tried both the non-admin-group-one and the ones with admin group) and xattr did _not_ help. This is my system.log
:
Apr 20 13:26:09 ecvaawplun5 ShipIt[96584]: Installation error: Error Domain=SQRLInstallerErrorDomain Code=-1 "Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.SlTaDvEr/Visual%20Studio%20Code.app" UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSLocalizedDescription=Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.SlTaDvEr/Visual%20Studio%20Code.app, NSUnderlyingError=0x7f90dec20ce0 {Error Domain=NSCocoaErrorDomain Code=260 "The file āVisual Studio Code.appā couldnāt be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSUnderlyingError=0x7f90dec20b70 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
Apr 20 13:26:09 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt[96584]): Service exited with abnormal code: 1
Apr 20 13:26:09 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt): Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
Apr 20 13:26:11 ecvaawplun5 ShipIt[96588]: Too many attempts to install, aborting update
Apr 20 13:26:11 ecvaawplun5 ShipIt[96588]: Application launched at file:///Applications/Visual%20Studio%20Code.app
Maybe I should just get a PC instead... š
(My problem is that I've used multiple accounts on my Mac and run the update on the other account, so it's quite likely that some more permission or something is messed up.)
I gave up and move the *.app from ~/Library/Caches/com.microsoft.VSCode*.ShipIt/
to /Applications
.
Hey, I too face the same issue, vscode display the update notification and whether you click on Update now or do a manual restart nothing happens, once opened again it displays the same notification momentarily
.
Tried rebooting, then xattr and chmod. Still get errors. š¢
Apr 25 14:23:04 ecvaawplun5 Electron[4010]: Download completed to: file:///Users/plundberg/Library/Caches/com.microsoft.VSCode.ShipIt/update.81KZy3H/VSCode-darwin-stable.zip
Apr 25 14:23:16 ecvaawplun5 ShipIt[4638]: Beginning installation
Apr 25 14:23:16 ecvaawplun5 ShipIt[4638]: Installation error: Error Domain=SQRLInstallerErrorDomain Code=-1 "Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.Y3c9kPyG/Visual%20Studio%20Code.app" UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSLocalizedDescription=Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.Y3c9kPyG/Visual%20Studio%20Code.app, NSUnderlyingError=0x7fe44620f960 {Error Domain=NSCocoaErrorDomain Code=260 "The file āVisual Studio Code.appā couldnāt be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSUnderlyingError=0x7fe44620fe20 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
Apr 25 14:23:16 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt[4638]): Service exited with abnormal code: 1
Apr 25 14:23:16 ecvaawplun5 ShipIt[4642]: Resuming installation attempt 2
Apr 25 14:23:16 ecvaawplun5 ShipIt[4642]: Installation error: Error Domain=SQRLInstallerErrorDomain Code=-1 "Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.DPqbVSGM/Visual%20Studio%20Code.app" UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSLocalizedDescription=Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.DPqbVSGM/Visual%20Studio%20Code.app, NSUnderlyingError=0x7ff94e50a460 {Error Domain=NSCocoaErrorDomain Code=260 "The file āVisual Studio Code.appā couldnāt be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSUnderlyingError=0x7ff94e5133d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
Apr 25 14:23:16 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt[4642]): Service exited with abnormal code: 1
Apr 25 14:23:16 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt): Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
Apr 25 14:23:18 ecvaawplun5 ShipIt[4644]: Resuming installation attempt 3
Apr 25 14:23:18 ecvaawplun5 ShipIt[4644]: Installation error: Error Domain=SQRLInstallerErrorDomain Code=-1 "Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.Awtc0q55/Visual%20Studio%20Code.app" UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSLocalizedDescription=Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.Awtc0q55/Visual%20Studio%20Code.app, NSUnderlyingError=0x7f878f523af0 {Error Domain=NSCocoaErrorDomain Code=260 "The file āVisual Studio Code.appā couldnāt be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSUnderlyingError=0x7f878f523980 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
Apr 25 14:23:18 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt[4644]): Service exited with abnormal code: 1
Apr 25 14:23:18 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt): Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
Apr 25 14:23:21 ecvaawplun5 ShipIt[4648]: Too many attempts to install, aborting update
@joaomoreno any ideas?
This is the fix. I am tempted to lock this thread so people would stop burying it further.
When you execute Code, run ps ax | grep Code
. If you see that Code runs from a weird path like the one below, you haven't fixed the xattr issue.
/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.SlTaDvEr/Visual Studio Code.app
So, fully read the fix and try again.
Worked like a charm, thanks @joaomoreno
@joaomoreno Understand your frustration.
I checked and my Code is _not_ running from the strange path and still, I am getting this error.
It is running from paths under /Applications/Visual Studio Code.app
.
Should we treat this as a separate issue and debug it there? It's not clear to me if it has the same root cause or if it's a different beast.
ājoaomorenoā solution worked for me also, Iām a new mac user crossing over from windows world. Just needed to do the 1st step and it upgraded instantlyā¦ā¦ā¦.I didnāt have the ācom.apple.quarantineā issue, so I didnāt do that stepā¦ā¦ā¦..but anyway Thank you.
@joaomoreno before trying to apply the update, here are my Code processes:
$ ps -fe | grep Code
0 461 1 0 Tue02PM ?? 0:01.64 /System/Library/Frameworks/Security.framework/Versions/A/XPCServices/com.apple.CodeSigningHelper.xpc/Contents/MacOS/com.apple.CodeSigningHelper
501 41234 1 0 9:17AM ?? 3:25.84 /Applications/Visual Studio Code.app/Contents/MacOS/Electron
501 41235 41234 0 9:17AM ?? 0:00.75 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --type=gpu-process --channel=41234.0.1121821213 --mojo-application-channel-token=A0E7712AA25C3FD859EEC5667A36CA23 --no-sandbox --supports-dual-gpus=true --gpu-driver-bug-workarounds=18,20,40,51,52,56,58,66,67,71,73,75 --gpu-vendor-id=0x1002 --gpu-device-id=0x6821 --gpu-driver-vendor --gpu-driver-version --gpu-driver-date --gpu-secondary-vendor-ids=0x8086 --gpu-secondary-device-ids=0x0d26 --gpu-active-vendor-id=0x1002 --gpu-active-device-id=0x6821
501 41236 41234 0 9:17AM ?? 0:00.83 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=SharedProcess
501 41239 41234 0 9:17AM ?? 0:08.03 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --type=renderer --no-sandbox --primordial-pipe-token=425C308A4380EB11330BD7956BB948DE --lang=en-GB --node-integration=true --background-color=#171717 --enable-pinch --num-raster-threads=4 --enable-zero-copy --disable-partial-raster --enable-gpu-memory-buffer-compositor-resources --content-image-texture-target=3553,3553,3553,3553,3553,34037,3553,3553,3553,3553,3553,34037,3553,34037,34037 --video-image-texture-target=3553,3553,3553,3553,3553,34037,3553,3553,3553,3553,3553,34037,3553,34037,34037 --mojo-channel-token=98DCE7B7DFDA1C33F82F5BFB05E5762C --mojo-application-channel-token=425C308A4380EB11330BD7956BB948DE --channel=41234.1.1318110059
501 41789 1 0 9:17AM ?? 0:00.01 /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Resources/crashpad_handler --database=/var/folders/2p/f5tb9h_j15ngqjdpdkmwrd_00000gn/T/VSCode Crashes --url=https://ticinocrashreporter.azurewebsites.net/crash --handshake-fd=59
501 41790 41239 0 9:17AM ?? 0:02.37 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=extensionHost
501 41791 41239 0 9:17AM ?? 0:20.11 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=watcherService
501 41794 41239 0 9:17AM ?? 0:00.43 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap /usr/local/bin/git /Volumes/extra/git/ecraft/ecraft-fieldops utf8 /Applications/Visual Studio Code.app/Contents/MacOS/Electron 2.10.0
501 41824 41790 0 9:17AM ?? 0:00.41 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json/node_modules/vscode-languageclient/lib/utils/electronForkStart /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json/server/out/jsonServerMain.js --node-ipc
501 41826 41790 0 9:17AM ?? 0:02.34 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/plundberg/.vscode/extensions/streetsidesoftware.code-spell-checker-1.0.2/node_modules/vscode-languageclient/lib/utils/electronForkStart /Users/plundberg/.vscode/extensions/streetsidesoftware.code-spell-checker-1.0.2/server/src/server.js --node-ipc
The fix does unfortunately not help. I have rebooted, I have run:
$ sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
$ sudo xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
Unfortunately, no can do - still get the errors in system.log saying the update failed:
May 2 09:27:47 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt): Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
May 2 09:27:49 ecvaawplun5 ShipIt[43736]: Resuming installation attempt 3
May 2 09:27:49 ecvaawplun5 ShipIt[43736]: Installation error: Error Domain=SQRLInstallerErrorDomain Code=-1 "Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.qdjtdoLO/Visual%20Studio%20Code.app" UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSLocalizedDescription=Failed to copy bundle file:///var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual%20Studio%20Code.app/ to directory file:///var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/com.microsoft.VSCode.ShipIt.qdjtdoLO/Visual%20Studio%20Code.app, NSUnderlyingError=0x7ff83ad29110 {Error Domain=NSCocoaErrorDomain Code=260 "The file āVisual Studio Code.appā couldnāt be opened because there is no such file." UserInfo={NSFilePath=/var/root/Library/Caches/com.microsoft.VSCode.ShipIt/update.0sNg83X/Visual Studio Code.app, NSUnderlyingError=0x7ff83ad21770 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}}
May 2 09:27:49 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt[43736]): Service exited with abnormal code: 1
May 2 09:27:49 ecvaawplun5 com.apple.xpc.launchd[1] (com.microsoft.VSCode.ShipIt): Service only ran for 0 seconds. Pushing respawn out by 2 seconds.
May 2 09:27:51 ecvaawplun5 ShipIt[43739]: Too many attempts to install, aborting update
May 2 09:27:51 ecvaawplun5 ShipIt[43739]: Application launched at file:///Applications/Visual%20Studio%20Code.app
I did a manual uninstall now, but I wouldn't be sure that it will work the next time an update is rolled out.
(Sorry if I sound negative. I love VSCode and the work you're doing, and I also promote it to colleagues etc. It's just a bit annoying when this happens and the suggested workaround still doesn't help.)
I've again got message
"Could not create temporary directory: Permission denied."
I did chow and xattr before. But it was showed again.
Version 1.11.2
masOS Sierra
I downloaded version 1.12 and replace it old version. Error message hasen't displayed.
It works for me, too!
$ sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
Tried various things in this Issue. This is the one that worked for me.
(I've never had this much difficulty updating software. I hope this is fixed in the future)
Thanks @jagloro it is definitely related to that dir, also for vscode insiders.
After:
sudo chown $USER ~/Library/Caches/com.microsoft.VSCodeInsiders.ShipIt/*
vscode update complained that my copy was corrupted and advised to reinstall.
Instead I did a:
rm -rf ~/Library/Caches/com.microsoft.VSCodeInsiders.ShipIt
And that did the trick for me.
This is the fix suggested by @joaomoreno which has been working for most of us, most of the time.
Joao - please lock the discussion now, so we don't bury it further. Other similar installation/update problems can be reported in other issues, to keep the threads more separate.
This is due to a well known Squirrel issue: https://github.com/Squirrel/Squirrel.Mac/issues/182
Workaround: Move Code out of Downloads and into the Applications folder.
Workaround 2: If updates still don't work after moving Code to the Applications folder, you can fix it with xattr
:
sudo chown $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt/*
xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app
Closing this issue since the fix for #57664 allows us to inform users of this situation, instead of failing silently.
Most helpful comment
I'm pretty sure that this can be fixed with
xattr
.I could reproduce the issue on a brand new macOS machine. I confirmed that it happens because the
com.apple.quarantine
gets recursively set on the application bundle and Gatekeeper then launches Code from a temporary path, which isn't writable by the user thus explaining the escalation dialog.There are two steps for the fix:
com.apple.quarantine
attribute from Code, just as @farfromrefug recommendedI would love if someone that has this issue tries the fix above and let me know the results. @johnfn @jarecsni @islam-taha @TheChuckster @AleskiWeb etc