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

"Error: Failed opening file "C\C++.log" for writing" occurs when createOutputChannel("C/C++") is used #73441

Closed
sean-mcmanus opened this issue May 7, 2019 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug output Output channel system issues verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented May 7, 2019

  • VSCode Version: 1.33.1
  • OS Version: Windows (Linux/Mac too)

Steps to Reproduce:

  1. Use our C/C++ extension with a workspace with a .cpp file to activate it and set the C_Cpp.loggingLevel to "Debug" or run the "C/C++: Log Diagnostics" command, which calls code "vscode.window.createOutputChannel("C/C++") or "C/C++ Diagnostics"...or use any extension that does something equivalent.

Bug: VS Code gives some error like the following, which causes users of our extension to be confused/concerned (users send us the error in their bug reports). Changing our code to use "C++" instead fixes the issue, but that is unideal. This a somewhat recent regression over the past few months, but up till now we've just ignored it.

[Extension Host] Error: Failed opening file c:\Users\user\AppData\Roaming\Code\logs\20190506T193340\exthost11\output_logging_20190507T164807\6-C\C++ Diagnostics.log for writing: No such file or directory
at Object.createRotatingLogger (f:\Program Files\Microsoft VS Code 1.26\resources\app\node_modules.asar\spdlog\index.js:34:9)
at Object.t.createRotatingLogger (f:\Program Files\Microsoft VS Code 1.26\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:290:530)
at new r (f:\Program Files\Microsoft VS Code 1.26\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:629:222)
at f:\Program Files\Microsoft VS Code 1.26\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:631:639
at Generator.next ()
at s (f:\Program Files\Microsoft VS Code 1.26\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:11:9) (at f:\Program Files\Microsoft VS Code 1.26\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:631:716)

Does this issue occur when all extensions are disabled?: Yes

@sean-mcmanus sean-mcmanus changed the title "Error: Failed opening file "C\C++.log" for writing occurs Error: Failed opening file "C\C++.log" for writing occurs when createOutputChannel("C/C++") is used May 7, 2019
@sean-mcmanus sean-mcmanus changed the title Error: Failed opening file "C\C++.log" for writing occurs when createOutputChannel("C/C++") is used "Error: Failed opening file "C\C++.log" for writing" occurs when createOutputChannel("C/C++") is used May 7, 2019
@isidorn
Copy link
Contributor

isidorn commented May 8, 2019

Looks like a spdy log exception, forwarding to @sandy081

@isidorn isidorn assigned sandy081 and unassigned isidorn May 8, 2019
@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug output Output channel system issues labels May 8, 2019
@sandy081 sandy081 added this to the May 2019 milestone May 8, 2019
@sandy081
Copy link
Member

sandy081 commented May 8, 2019

It's failing because of not escaping the name. But it is not blocking in creating or using the channel as we fallback to another approach.

@sandy081 sandy081 added the windows VS Code on Windows issues label May 24, 2019
@sandy081
Copy link
Member

To verify, create a sample extension that creates an output channel with name that has characters not supported in windows file names. Eg: vscode.window.createOutputChannel('C/C++');

Make sure no errors are seen in the console.

@RMacfarlane RMacfarlane added the verified Verification succeeded label May 30, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 8, 2019
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 output Output channel system issues verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

4 participants