Skip to content

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

Closed

Description

@martinlippert

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.

Activity

  1. added this to the 4.12.0.RELEASE milestone on Aug 19, 2021
  2. martinlippert commented on Aug 19, 2021

    @martinlippert
    MemberAuthor

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

  3. BoykoAlex commented on Aug 25, 2021

    @BoykoAlex
    Contributor

    Fixed with 5e6b3f1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: vscodestatus: needs-investigationtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions