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

Circular symlink detected error #22052

Open
yCaetano7 opened this issue Jun 2, 2022 · 15 comments
Open

Circular symlink detected error #22052

yCaetano7 opened this issue Jun 2, 2022 · 15 comments
Labels
E2E Issue related to end-to-end testing existing workaround OS: windows type: bug v10.0.0 🐛 Issue present since 10.0.0

Comments

@yCaetano7
Copy link

yCaetano7 commented Jun 2, 2022

Current behavior

Greetings, i'm having a problem with Cypress since i updated it to version 10.0.0, where Cypress doesn't work properly.
Excuse my lack of knowledge, but i really need to use Cypress for work.

I've always used "./node_modules/.bin/cypress open" to open Cypress via Windows PowerShell for my tests, and as of right now, it still works, but the moment i click on "E2E Testing", an error message shows up in Windows PowerShell and Cypress closes.

This is Cypress opening just fine:
image

And this is what shows up after i click on "E2E Testing":
image

The error seems to be caused by a "circular symlink", but i'm not sure if that's the problem nor what that means. I'm not really knowledgeable with these things, but i can't seems to find anything or anyone talking about this! I did try to get help in the official Discord server, but no one seem to know what this means.
I would really like to understand what a circular symlink means, and why is this happening.

Thanks in advance, for anyone who may understand and help me with this issue.

Desired behavior

Cypress should be opening just fine, but for some reason, it closes and an error shows up in PowerShell.

Test code to reproduce

I don't know what to put here since the error is outside of the actual coding within Cypress, so all i have to say is that i use this line of command to open Cypress with Windows PowerShell:

./node_modules/.bin/cypress open

Cypress Version

10.0.1

Other

Just to make sure, i'm using Windows 10 Pro.

@jennifer-shehane jennifer-shehane added OS: windows v10.0.0 🐛 Issue present since 10.0.0 labels Jun 2, 2022
@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jun 2, 2022
@yCaetano7
Copy link
Author

Edit: I added a desired behavior, because i forgot to type something there.

@mschile
Copy link
Contributor

mschile commented Jun 3, 2022

@yCaetano7, thanks for logging this issue. I was able to reproduce your issue by running cypress open from the root user directory (in your case C:\Users\User). We'll have to do more investigation as to what is exactly causing the failure but in the meantime, if you move your project to a subfolder (i.e. C:\Users\User\<ProjectName>) and install and run the cypress open command from there, you can avoid the error.

@yCaetano7
Copy link
Author

yCaetano7 commented Jun 3, 2022

@yCaetano7, thanks for logging this issue. I was able to reproduce your issue by running cypress open from the root user directory (in your case C:\Users\User). We'll have to do more investigation as to what is exactly causing the failure but in the meantime, if you move your project to a subfolder (i.e. C:\Users\User\<ProjectName>) and install and run the cypress open command from there, you can avoid the error.

Thanks for the response, but i need some explanation. What do you mean by <ProjectName> ? Is it the cypress file in my .bin folder or is it the cypress folder in this exact path: C:\Users\User\cypress ?
Thanks in advance.

@mschile
Copy link
Contributor

mschile commented Jun 3, 2022

The <ProjectName> is just a placeholder. The name of the folder can be whatever you want. Typically, users have their test files checked into source control somewhere such as GitHub or GitLab. In that case, you would just clone that repository into a folder and not at the top-level user directory. Otherwise, you can create a new folder and just put all the Cypress related files from your user directory into that new folder.

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jun 3, 2022
@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: awaiting response Potential fix was proposed; awaiting response stage: routed to e2e-core labels Jun 3, 2022
@mjhenkes mjhenkes added stage: awaiting response Potential fix was proposed; awaiting response E2E-core and removed stage: fire watch labels Jun 3, 2022
@mjhenkes mjhenkes assigned mschile and unassigned mschile Jun 3, 2022
@mschile mschile changed the title Cypress does not work anymore since 10.0.0 update Circular symlink detected error Jun 3, 2022
@yCaetano7
Copy link
Author

The <ProjectName> is just a placeholder. The name of the folder can be whatever you want. Typically, users have their test files checked into source control somewhere such as GitHub or GitLab. In that case, you would just clone that repository into a folder and not at the top-level user directory. Otherwise, you can create a new folder and just put all the Cypress related files from your user directory into that new folder.

Oh, i see. Me and a colleague of mine managed to fix this. Thanks for the replies!

@mschile mschile removed their assignment Jun 5, 2022
@cypress-bot cypress-bot bot added stage: backlog and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jun 6, 2022
@ShadowLNC
Copy link

This seems to only affect linux (and presumably windows) users - we run predominantly on macos and most of our devs have not been affected.

We have a symlink in a folder not part of our spec pattern, e.g.

- repo
| - cypress (test folder)
| - docs
  | - symlink is in here

@mschile mschile added triage and removed triage labels Aug 18, 2022
@chandrakumar1988
Copy link

image
I have changed the folder structure and then launched the Cypress its working .
image

@nagash77 nagash77 added E2E Issue related to end-to-end testing and removed E2E-core labels Nov 8, 2022
@UserName1339
Copy link

Can confirm; making an new folder in C:/USERNAME/cypress fixes the issue... I had it too... So the folders; fixtures, support and a newly created folder (already init Cypress before, using Windows 11)

@kartal-huseyin
Copy link

Same here and resolved. Thx.

@Ibinola
Copy link

Ibinola commented Feb 3, 2023

Thanks this worked for me as well.

@alyssa-dannielle
Copy link

also same, thanks! v12.13.0 on Windows 10 Pro

@pfrank91
Copy link

having similar issue and try with the above still not working, this is the first time install after config and click continue.

image

@ghost
Copy link

ghost commented Sep 10, 2023

Had the Same Issue. Fixing it with switching out of the %USER% Folder fixed it (v13.1.0).
For those who don´t know what that means. Running Cypress from the %USER% Folder infected this Problem. e.g C:\Users\YOUR_USER_NAME.
Just create a Folder on your Desktop like e.g \testCypress or where ever you want, remove this Problem and then start Cypress again.

@mathib
Copy link

mathib commented Nov 27, 2023

I had the same issue with Cypress 13.6.0 on Windows 10

I use NVM-windows to manage my nodejs versions and this solution relies on symlinks for globally installed npm packages. I could solve it by installing Cypress in a specific folder (npm i cypress instead of npm i cypress -g)

@AndBroCorp
Copy link

AndBroCorp commented Apr 17, 2024

Experiencing this problem cypress is installed via yarn globally in appdata\local.

PowerShell 7.4.1
PS C:\Users\Madni\cypress> yarn cypress open
yarn run v1.22.19
warning package.json: No license field
$ C:\Users\Madni\node_modules\.bin\cypress open

DevTools listening on ws://127.0.0.1:63131/devtools/browser/b9987347-6da5-4569-83c2-50fc8f378916
Circular symlink detected: "C:\Users\Madni\AppData\Local\Programdata" points to "C:\Users\Madni\AppData\Local"
Error: Circular symlink detected: "C:\Users\Madni\AppData\Local\Programdata" points to "C:\Users\Madni\AppData\Local"
    at E._getEntryType (<embedded>:3932:7466)
    at async E._read (<embedded>:3932:6206)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This issue occur each time i run yarn open on a new project.
Project folder name does not masher.

Refereed symlink folder

This directory is super odd and just reference its parent directory C:\Users\Madni\AppData\Local\Programdata
For the system getting this error it return permission denied and will navigate to it self indefinitely.
Admin privileges don't change the permission denied.

PS C:\Users\Madni\AppData\Local> ls programdata
Get-ChildItem: Access to the path 'C:\Users\Madni\AppData\Local\Programdata' is denied.
PS C:\Users\Madni\AppData\Local> cd programdata
PS C:\Users\Madni\AppData\Local\Programdata> ls
Get-ChildItem: Access to the path 'C:\Users\Madni\AppData\Local\Programdata' is denied.
PS C:\Users\Madni\AppData\Local\Programdata> cd programdata
PS C:\Users\Madni\AppData\Local\Programdata\Programdata> cd temp
PS C:\Users\Madni\AppData\Local\Programdata\Programdata\temp>

On my home PC it does not exist:

Set-Location: Cannot find path 'C:\Users\andre\AppData\Local\Programdata' because it does not exist.

Don't know what this directory is and why it is needed and why it refer to its parent directory.

Resolve the issue (Workaround)

Removing the symlink Programdata solve the issue.

Unsure what this actually brakes down the line.
But you can recreate it if that is the case.

PS > cd
PS > cd appdata/local/
PS > New-Item -ItemType "Junction" -Value "$PWD" -Path "Programdata"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing existing workaround OS: windows type: bug v10.0.0 🐛 Issue present since 10.0.0
Projects
None yet
Development

No branches or pull requests