Skip to content
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

permission denied #456

Open
sdarwin opened this issue Mar 8, 2022 · 2 comments
Open

permission denied #456

sdarwin opened this issue Mar 8, 2022 · 2 comments

Comments

@sdarwin
Copy link

sdarwin commented Mar 8, 2022

When installing multiple xcode versions, using a command such as:

xcversion install 11.3 --no-switch

There were occasionally errors such as this:

xip: error: The archive “Xcode_11.3.xip” failed to be moved to the final destination due to the error: The operation couldn’t be completed. Permission denied.
No `Xcode.app(or Xcode-beta.app)` found in XIP. Please remove /Users/administrator/Library/Caches/XcodeInstall/Xcode_11.3.xip if you suspect a corrupted download or run `xcversion update` to see if the version you tried to install has been pulled by Apple. If none of this is true, please open a new GH issue. 

However,

  • running the xcversion command again later, eventually everything succeeded. So, it was not consistent.
  • If manually unzipping the file left at Users/administrator/Library/Caches/XcodeInstall/Xcode_11.3.xip , it did unzip ok.

The question is about those error messages. The above message included:

  1. Permission Denied.

Permission to do what? Permission on which file or directory? Could the message be more verbose?

  1. No Xcode.app(or Xcode-beta.app) found in XIP.

Did not seem to be true, because I could manually unxip it. Also - if the problem really was " No Xcode.app(or Xcode-beta.app) found in XIP. " then why did it also say "permission denied"?

@sdarwin
Copy link
Author

sdarwin commented Mar 9, 2022

If this is an edge-case that nobody has ever encountered, the issue can probably be closed. Nevertheless, here are some ideas to mitigate it. Because the install process can be slow, any quick steps to precheck a success or failure are preferable to waiting many minutes to discover there is a problem.

  1. Add a preflight check to "xcversion install" which occurs before downloading xcode or taking any actions. In the pre-check phase, make sure the user can write to the final destination folder. Write a very small file and then remove it. If the step fails, then clearly indicate which directory is lacking permissions.

  2. Download the xip file. After the download, but before continuing further, verify the shasum, https://github.com/notpeter/apple-installer-checksums/blob/master/xcode.md . Display to the user that the download and checksum were successful. Unless, this is already being done, then nevermind :-)

@renfrenkel
Copy link

renfrenkel commented Mar 9, 2022

This is happening to me today too. It's consistently failing every time for me, but the manual unxip works. I can't debug at all since running the command manually works and no useful information is being output by the xcversion command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants