-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Win 10 - symlink - operation not permitted, symlink #8471
Comments
I have the same "operation not allowed" problem, but for the Electron path
|
Same error as @Fizcko but on version 7.5.0
|
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
I'm having this issue today, on latest version |
Have you referred to the npm documentation? I cannot guarantee it, but perhaps npm install cypress --save-dev --no-bin-links will help. |
@MikeMcC399 Why is this necessary here? Since Cypress downloads the binary to a separate folder, wouldn't we still need the links? I didn't have to use it before. I had cypress 12.7.0 installed fine, but then when upgrading (simply updating version in I am currently clearing my npm cache and deleting |
Are you using a corporate Windows 10 system which has security policies applied or do you have full administrator rights on your system? Could you post your error message, just to make sure that we are looking at the same issue? |
I am not running as administrator. The cache is in AppData/local. Will this only work if running as admin? I would hope that wouldn't be required, but I do have the access if needed. Yes, we are on a corporate system, but this worked on previous installs of Cypress... I am running into this today for some reason. The error matches the description above. Here is the error:
|
Thanks for your exact error log. This does look like it's a Windows permissions problem. Are you able to run (Your Windows version 10.0.18363 looks quite old and https://learn.microsoft.com/en-us/lifecycle/products/windows-10-home-and-pro says support for Windows 10.0.18363 aka 1909 or 19H2 ended on May 11, 2021. I don't know if that would have any influence on the issue. I tried to reproduce on Windows 11 but without success. It all worked for me.) |
Which version of Node.js and npm are you using? I will try to reproduce this on a Windows 10 system instead of a Windows 11 system. Going back to your error message, there are actually two parts:
Edit: This turns out to be one problem. |
@MikeMcC399 As mentioned,
|
Thanks for passing on your node / npm versions! As a troubleshooting step you could attempt to install as Admin. If that works, then that would point to your non-admin user not having sufficient permissions / rights, which could be separately looked at. You could also check to see if you can still re-install cypress@12.7.0 with your non-admin user, as you said, this previously was no problem. You might possibly be able to get some additional information through I can't really say what should or shouldn't work in terms of non-admin. The Cypress documentation does not discuss this and there was no troubleshooting done on the original issue as far as I can see. I am however willing to dig deeper into this one. Your official Cypress.io assignee is however @AtofStryker. I am just one of the community contributors responding to you here. |
@MikeMcC399 @AtofStryker The install does appear to work when running as admin (using Git Bash), so it seems like a permission issue. The rest of the npm install works fine for other dependencies. The cache is pointing to user Why does Cypress require admin to unzip the file? I see in this code: https://github.com/cypress-io/cypress/blob/7ef4300a6b1a367f980e5d6a0182dac292694d01/cli/lib/tasks/install.js#LL345C2-L345C34 |
@MikeMcC399 I think you are going a fantastic job responding to this issue.
That is good at least since this could function as a workaround.
I wouldn't say Cypress requires admin to unzip the file, but your system depending on the directory might require it to link the file. In the post above, do you know who owns this directory:
That should be correct assuming another temp directory is configured on your machine. I don't think its an issue with the actual access of the directory, but the permissions to symlink to/from it. It's hard to say, but we might have a better idea depending on who owns each directory. |
I found the missing debug log instructions! If you could execute the following in a Git Bash terminal, it should show exactly what is happening and where it is failing: export DEBUG='cypress:*'
npm install cypress@latest --loglevel verbose --foreground-scripts If you have previously been successful installing then you may need to execute the following first: npx cypress cache clear
npm uninstall cypress
Thanks for the compliment and for your participation! As always it's a teamwork thing to get to the bottom of these issues. No single person has all the answers! |
Alternatively to debug, it may be sufficient just to execute export DEBUG='cypress:*'
npx cypress install |
@AtofStryker I'm not sure we can confidently say the admin permission workaround is sufficient. Not all users may have the ability to use admin, and there should be no requirement to use it. The relative path I'm not sure how the temp dir is defined. Again, I'm just running Maybe I'm misunderstanding why we even need symlinks at all, but I don't really know everything about cypress is running the post install to get the binary working. It seems like something is broken on Windows if not using admin, and I think Cypress should detect this scenario and work appropriately without the user needing to change the environment/permissions. |
If you run the debug commands you will see which directories are defined, including the os-specific temp directory. We would need to see the output from your system before making any generic judgements. |
@MikeMcC399 Yes, I'm working on that now. For some reason |
Good! That should shed some light on the steps.
I can't reproduce that behavior. You can also use the same debug parameters for uninstall i.e.
|
@MikeMcC399 @AtofStryker Here you go... I did all of this WITHOUT admin mode. I deleted Next, run:
Here is the output (sanitized):
Let me know if any of this is helpful. Even after the unzip error, it couldn't delete some of the node dependencies for cleanup, but that might be unrelated. I wonder if it's related to the npm
Or maybe the symlink command is having trouble? I'm not sure how it tries to create that on Windows. Does it use a |
Yes, definitely! Thanks for the logs! It confirms that unzip is failing on your system trying to create a symlink.
I would concentrate first on the symlink issue, but you might want to try to do a manual clean up and see what happens. The log doesn't say why the
It is using the npm module extract-zip. A non-admin cannot normally create symlinks on Windows 10. There is a developer mode to allow this, however I don't think that symlinks should be created, so it shouldn't be necessary to enable this mode. The problem is not reproducible for me on a standard Windows 10 system. I tested installing Cypress
So it is quite suspicious that in your system it is trying to create a symlink (and then failing). My log file showed:
This is different to your log which has a different file size and says:
I'm wondering if your copy of Cypress You might want to try installing a fresh copy of Cypress If you want to get an even more detailed log you can add export DEBUG='cypress:*,extract-zip'
npm install cypress@latest --loglevel verbose --foreground-scripts |
If that's the case, how do we find why this is even happening? To me, that's the root of the issue - something is happening that shouldn't be needed, and it's causing issues on Windows (at least this version) without admin. I can try the
I do not believe it is an issue with my copy of the file or a download mirror issue, because when running with admin, it works fine. If the file or mirror were an issue, it would still fail with admin.
I'll give this a shot to get more info. |
Here you go:
|
Not much more info, just shows that |
In my detailed log there are no instances of My copy of Cypress is coming directly from Unfortunately I don't think I can contribute any more to this issue since I am unable to reproduce it or to explain it. You may want to give consideration to also trying out bypassing your mirror. |
@MikeMcC399 Did you look specifically at this file: I'm not sure how the mirror would be affecting the nature of the symlinks. Especially since the mirror does not edit the zip in transit, I don't see any reason that those are connected. Also, please make sure you are NOT running as admin when you test this, since running as admin seems to allow permissions to work. |
|
I wonder if the zip we are downloading is different based on different Windows systems or platforms, since Cypress detects that when downloading. It's interesting why mine is being set as a symlink but yours isn't. Note: as shown in the first logs above, the download it is using is |
I also noticed the file path is different - yours is I'm also curious what defines what is a symlink in the zip itself? I assume there is some build process on the Cypress side to create the binary zip file. |
Quick note: I tried v Of course the workaround of running with admin will work, but I don't see why there's a need for symlinks on this zip file at all, or why the Windows install tries to reproduce them. Is there a way to disable that? Or force the zip to have NO symlinks for Windows? This seems like a setup issue for the packaging - the way the zip is created and/or unzipped. (I'm also surprised we need a |
Update: It looks like running with admin doesn't actually solve the problem. It just made Without trying to share all the logs here in this thread since those are likely different issues, I'd like to circle back that the "workaround" to use admin for the install may not actually be sufficient (it should also not be preferred). The binary download and unzip process is having trouble and I'm not sure where to go from here Edit: It makes sense, because that file doesn't exist. I'm not sure why the download says it succeeds, but that doesn't exist. I only have |
Is that the folder structure for a non-Windows download? Is it possible that our mirror is somehow grabbing the file for a different OS? That could explain a lot of this. I'm not sure how the mirror/cache works, but that could be getting in the way - not a corrupt version of the file, just the WRONG version of the file. I'm still not sure why this would happen because the endpoint is This could be an issue with mirroring and/or the Cypress download site logic. The error message itself still aligns to the subject of this issue. I can see if the issue persists from the direct link. That will not be an acceptable workaround for my organization, but it could at least give answers. Edit: |
That could explain the different file sizes, different file structure and symlink differences. The documentation doesn't describe how to set up an exact 1:1 mirror copy of https://download.cypress.io including the ability to process the query parameters I suggest that you refer to the Cypress documentation Advanced Installation > Download path template to ensure that your system is pulling the Cypress binary for the correct architecture. You may need to be using |
@MikeMcC399 The final url it's using is still Here is the line from the log:
So I don't think the url on my client end is the problem. I have no idea why the mirror is getting the MacOS values. It's possible the mirror doesn't forward the query parameters as expected. Our mirror is set up to point to Is there more documentation on how to set up the mirror? Maybe that's why there's an issue. |
I don't have any experience in setting up a download mirror, so I have to defer to the Cypress.io team for questions about how this is supposed to work and I don't have any private information about this. I would however assume that a mirror would be a COPY of the Cypress download site and not simply a proxy which forwards requests. If you install without using a mirror and you are on a Windows machine, then accessing https://download.cypress.io/ will (at the time of writing) redirect the request to https://cdn.cypress.io/desktop/12.13.0/win32-x64/cypress.zip. Probably your mirror site will not work that way and that would be the reason for the existence of the Are you bound to using a mirror server or do you have the option to install directly from Cypress? |
We need to use a mirror for security and network access reasons. I believe the mirror acts as both a proxy and it caches the downloads so it saves the copies. It does not copy everything right up front (even if it did, that wouldn't work forever as new versions come out). If something does not exist in the mirror cache, it pulls from the source (like a proxy), scans it, then makes it available. If download.cypress.io does a redirect to cdn.cypress.io, maybe we should point our mirror directly to cdn.cypress.io and then we can use the rest of the download path template so we can explicitly define the params. That may unfortunately be required for a mirror setup change. I would expect that the mirror could point to |
The documentation says "If you choose to mirror the entire Cypress download site," when referencing The Advanced Installation > Download path template link you mentioned indicates that
Ok, I will look into requesting our mirror be updated to point to Second question - I also see in the docs that it talks about
It looks like we don't have to put it as a full environment variable. Will this work for the |
https://download.cypress.io/desktop.json shows the directory structure for the current version: {
"name": "Cypress",
"version": "12.13.0",
"packages": {
"mac": {
"url": "https://cdn.cypress.io/desktop/12.13.0/darwin-x64/cypress.zip"
},
"linux64": {
"url": "https://cdn.cypress.io/desktop/12.13.0/linux-x64/cypress.zip"
},
"darwin": {
"url": "https://cdn.cypress.io/desktop/12.13.0/darwin-x64/cypress.zip"
},
"linux": {
"url": "https://cdn.cypress.io/desktop/12.13.0/linux-x64/cypress.zip"
},
"darwin-x64": {
"url": "https://cdn.cypress.io/desktop/12.13.0/darwin-x64/cypress.zip"
},
"darwin-arm64": {
"url": "https://cdn.cypress.io/desktop/12.13.0/darwin-arm64/cypress.zip"
},
"linux-x64": {
"url": "https://cdn.cypress.io/desktop/12.13.0/linux-x64/cypress.zip"
},
"linux-arm64": {
"url": "https://cdn.cypress.io/desktop/12.13.0/linux-arm64/cypress.zip"
},
"win32-x64": {
"url": "https://cdn.cypress.io/desktop/12.13.0/win32-x64/cypress.zip"
}
}
} |
Have you been able to test installing and using the Windows version of Cypress in your non-admin account? |
@MikeMcC399 as mentioned above,
We have not yet set up a new mirror to point to CDN (it may take a few days/weeks for the team to address this) to verify this works through a mirror. I think we found the problem, though, which is not a fundamental issue in the Cypress zip or download, but in the way mirrors are set up. I would, however, suggest that we update or create better documentation around how to set up a mirror and what options there are (mirroring the entire download site - how would that work with the params, vs mirroring CDN only, requiring installers to use path template, vs custom file path setup). The current docs talk about usage on the project side, but not the mirror setup itself. |
Good suggestion!
My suggestion would be for you to open a new issue on https://github.com/cypress-io/cypress-documentation for this. Maybe Cypress.io could also supply or recommend some utility software to assist in consistently setting up and operating a mirror copy of https://download.cypress.io? |
@MikeMcC399 Yes, I can do that. Note: I wouldn't be the best 'user' of this since I'm not the person that actually sets up the mirror. I just think it'd be a good idea on the Cypress side to have better documentation in that area Edit: |
I'm going to go ahead and close this issue. If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix. |
Current behavior:
Unable to install cypress on Windows 10.
Desired behavior:
Computers on my company cannot run cmd as administrator to resolve symlink problems.
Is it possible to provide a way to install Cypress without global cache directory ?
Test code to reproduce
Versions
Node JS: 12.13.0
Cypress: 5.1.0
Operating system: Windows 10 (10.0.18363)
The text was updated successfully, but these errors were encountered: