Skip to content

[codespaces] vscode extension crashes if specified log output location doesn't work #676

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
martinlippert opened this issue Aug 19, 2021 · 2 comments
Assignees
Labels
for: vscode something that is specific for VSCode status: needs-investigation type: bug

Comments

@martinlippert
Copy link
Member

I am running a Codespaces workspace from my local VSCode install and the Spring Boot extension crashes with this:

Redirecting log output to: /Users/mlippert/Desktop/vscode-logs.txt
Exception in thread "main" java.io.FileNotFoundException: /Users/mlippert/Desktop/vscode-logs.txt (No such file or directory)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at org.springframework.ide.vscode.commons.util.LogRedirect.logFileStream(LogRedirect.java:38)
	at org.springframework.ide.vscode.commons.util.LogRedirect.bootRedirectToFile(LogRedirect.java:24)
	at org.springframework.ide.vscode.boot.app.BootLanguageServerBootApp.main(BootLanguageServerBootApp.java:103)
[Info  - 10:27:27 AM] Connection to server got closed. Server will restart.

The reason seems to be that my local preferences contain this setting:

"spring-boot.ls.logfile": "/Users/mlippert/Desktop/vscode-logs.txt"

But this path is obviously not valid inside of a Codespaces workspace. So instead of crashing the extension we need to check if this path exists and if not, send back an error message without crashing the whole extension.

@martinlippert martinlippert added this to the 4.12.0.RELEASE milestone Aug 19, 2021
@martinlippert
Copy link
Member Author

This can easily be reproduced without Codespaces if you specify a non-existing path in the settings.

@BoykoAlex
Copy link
Contributor

Fixed with 5e6b3f1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: vscode something that is specific for VSCode status: needs-investigation type: bug
Projects
None yet
Development

No branches or pull requests

2 participants