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

UNC allow list should not fail for resolved mapped network drives or symbolic links #182196

Closed
bpasero opened this issue May 11, 2023 · 15 comments · Fixed by #183716
Closed

UNC allow list should not fail for resolved mapped network drives or symbolic links #182196

bpasero opened this issue May 11, 2023 · 15 comments · Fixed by #183716
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release unc verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented May 11, 2023

Seeing an increase in issues (such as #182185) where a mapped network drive or symbolic link points to a UNC path. If you use node.js methods such as fs.readlink or fs.realpath.native to resolve these paths to their UNC equivalent and use them for further file operations, our UNC allow list might prevent use of these paths until you add them to the allow list.

We should discuss if there are options here to make this easier on the impacted users. The issue often goes unnoticed because we do not prompt the user on startup for these paths to add them to the allow list.

❗Workaround
Given an exception like this one:

Error: Debug Failure. False expression: z:/home/siddharth/workspace/newWebUi/facilgo-web-ui/node_modules/react-table-6/index.d.ts linked to nonexistent file //wsl$/Ubuntu-20.04/home/siddharth/workspace/newWebUi/facilgo-web-ui/node_modules/react-table-6/index.d.ts
    at realPath (c:\Users\smish\.vscode\extensions\ms-vscode.vscode-typescript-next-5.1.20230510\node_modules\typescript\lib\tsserver.js:42142:9)
    at getOriginalAndResolvedFileName (c:\Users\smish\.vscode\extensions\ms-vscode.vscode-typescript-next-5.1.20230510\node_modules\typescript\lib\tsserver.js:41079:28)

Find the resolved file path (here //wsl$/Ubuntu-20.04/home...) and add the hostname of the path (the value between // and the first / after that) to the security.allowedUNCHosts setting (here: wsl$). Then restart VS Code.

See also: https://aka.ms/vscode-windows-unc

@bpasero bpasero added the unc label May 11, 2023
@bpasero bpasero added this to the May 2023 milestone May 11, 2023
This was referenced May 11, 2023
This was referenced May 13, 2023
@vscodenpa vscodenpa added the insiders-released Patch has been released in VS Code Insiders label May 30, 2023
@bpasero bpasero removed the insiders-released Patch has been released in VS Code Insiders label Jun 1, 2023
@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release labels Jun 2, 2023
@sandy081 sandy081 reopened this Jun 2, 2023
@deepak1556
Copy link
Collaborator

/fixedWith 35da3a2

@deepak1556
Copy link
Collaborator

Steps for verification:

  • create a mapped network drive that points to a localhost UNC folder which has a Typescript project
  • open the mapped network drive code-insiders z:\<path-to-typescript-project>
  • verify TypeScript smartness works and shows no errors in the TS server output logs

@roblourens roblourens added the verified Verification succeeded label Jun 2, 2023
@iomedico-beyer
Copy link

iomedico-beyer commented Jun 26, 2023

For some reason I wish to go back to 1.78 until there is a release which includes the fix. However I cannot find the Windows zip (needed to make VSC portable) on the 1.78 download page. Any idea where to find it?

@bpasero
Copy link
Member Author

bpasero commented Jun 26, 2023

The fix for this is in 1.79.x releases.

@amitasil
Copy link

I am still getting this error while using the cucumber.io extension

image

@bpasero
Copy link
Member Author

bpasero commented Jun 29, 2023

@amitasil can you give more details, did you configure the setting accordingly?

@jdragulanescu
Copy link

Same for me, I just updated VSCode from 1.77.* to 1.79.2 and Cucumber extension starts failing
image

@bpasero
Copy link
Member Author

bpasero commented Jun 29, 2023

Are we certain this is related to UNC paths? Whats the extension repository, maybe reach out to them as well?

@jdragulanescu
Copy link

jdragulanescu commented Jun 29, 2023

Are we certain this is related to UNC paths? Whats the extension repository, maybe reach out to them as well?

I am on this issue thread from #182586, that points me to #182274 then to this one.
Repo is cucumber extension

See that someone pointed a cucumber issue here: cucumber/vscode#155

It's a bit confusing honestly.

@bpasero
Copy link
Member Author

bpasero commented Jun 30, 2023

I see no UNC mentioned in any of these issues, so I consider it unrelated.

@francisconunezmatrix
Copy link

@amitasil can you give more details, did you configure the setting accordingly?

@bpasero , you have a example from this configuration ??

@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release unc verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.