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

A request has failed from JSON Language Features #86140

Closed
Tyriar opened this issue Dec 3, 2019 · 24 comments
Closed

A request has failed from JSON Language Features #86140

Tyriar opened this issue Dec 3, 2019 · 24 comments
Assignees
Labels
upstream-issue-fixed The underlying upstream issue has been fixed

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 3, 2019

As of today whenever I open a new window I get this message:

Screen Shot 2019-12-03 at 10 55 16 AM

Screen Shot 2019-12-03 at 10 55 21 AM

The console is complaining about the lack of a corrupted.info file?

Screen Shot 2019-12-03 at 10 54 45 AM

It appears related to the en-gb language pack that I have installed? https://marketplace.visualstudio.com/items?itemName=MS-CEINTL.vscode-language-pack-en-GB

Version: 1.41.0-insider
Commit: 9785578
Date: 2019-12-03T05:35:54.992Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0

@dbaeumer
Copy link
Member

dbaeumer commented Dec 4, 2019

IMO the console complaining about the lack of a corrupted.info file is not the cause of the JSON language server to fail. In case this fails it will continue showing default English strings.

I create a new issue in the vscode-nls repository which actually prints that message. It is: microsoft/vscode-nls#27

Assigning to @aeschli for the JSON language server problem.

@dbaeumer dbaeumer assigned aeschli and unassigned dbaeumer Dec 4, 2019
@dbaeumer
Copy link
Member

dbaeumer commented Dec 4, 2019

@Tyriar can you please comment on microsoft/vscode-nls#27 so that I undertstand what could cause this.

@aeschli
Copy link
Contributor

aeschli commented Dec 4, 2019

@Tyriar Can you enable "json.trace.server": "verbose" and check the JSON Language Server output?

@Tyriar
Copy link
Member Author

Tyriar commented Dec 4, 2019

Both the message and console errors are not happening anymore this morning, the clp directory has a different hash in the folder name now?

@dbaeumer
Copy link
Member

dbaeumer commented Dec 5, 2019

Yes, since it is a new VS Code version. Does the path that failed still exists. I only clean them after a couple of weeks. If it doesn't it would explain the exception but I would still not understand why it wasn't there in the first place.

@aeschli
Copy link
Contributor

aeschli commented Dec 16, 2019

Closing. Please reopen if you see it again.

@aeschli aeschli closed this as completed Dec 16, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 30, 2020
@Tyriar
Copy link
Member Author

Tyriar commented Mar 4, 2020

I keep hitting this, it may be related to corrupted.info? Here's a snippet from the enormous log file after enabling verbose:

[Trace - 11:32:28 am] Received notification 'window/logMessage'.
Params: {
    "type": 1,
    "message": {
        "errno": -4058,
        "code": "ENOENT",
        "syscall": "open",
        "path": "C:\\Users\\Daniel\\AppData\\Roaming\\Code - Insiders\\clp\\918cf835f834df511eef0fd61f736424.en-gb\\corrupted.info"
    }
}


[Error - 11:32:28 am] [object Object]

@Tyriar Tyriar reopened this Mar 4, 2020
@microsoft microsoft unlocked this conversation Mar 4, 2020
@aeschli
Copy link
Contributor

aeschli commented Mar 5, 2020

When the language server client sees the notification window/logMessage, it opens the error notification dialog as seen above. So it must be the ENOENT from corrupted.info that causes that and that must be vscode-nls (not quite sure how that ends up becoming a logMessage)

Let's fix that first and if there is still a request failure (I doubt it) I'm happy to look at it.

@aeschli aeschli assigned dbaeumer and unassigned aeschli Mar 5, 2020
@dbaeumer
Copy link
Member

dbaeumer commented Mar 9, 2020

The vscode-nls tries to mark the caches language pack as corrupted but can't: it is here https://github.com/Microsoft/vscode-nls/blob/master/src/main.ts#L185

@aeschli are you handling console.error special in our language server ?

@Tyriar can you always reproduce this with that language pack?

@aeschli
Copy link
Contributor

aeschli commented Mar 9, 2020

The JSON LS does the following:
console.error = connection.console.error.bind(connection.console);

@dbaeumer
Copy link
Member

That explains it. But it wouldn't be necessary for errors when running in ipc transport since stderr and stdout are capture correctly on the client side.

@dbaeumer
Copy link
Member

@Tyriar I tried to reproduce this using teh en.gb LP but can't. Any additional steps ?

I would like to understand why this is happening before I add some protection code.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Mar 10, 2020
@7iomka
Copy link

7iomka commented Mar 17, 2020

the same issue when I open any json file

@Tyriar
Copy link
Member Author

Tyriar commented Mar 17, 2020

@dbaeumer there's no special steps, just opening settings.json for the first time after a reload.

@dbaeumer
Copy link
Member

@Tyriar actually not for me :-(

capture

Anything you could think of that would make this reproducable.

@7iomka which locale are you using and on which OS are you seeing this?

@dbaeumer
Copy link
Member

I puplished 4.1.2 of vscode-nls that adds some protection code against this to ensure that the diurectory still exists when trying to write the corrupted file.

@dbaeumer
Copy link
Member

Upstream microsoft/vscode-nls#27

@dbaeumer dbaeumer added upstream-issue-fixed The underlying upstream issue has been fixed and removed info-needed Issue requires more information from poster labels Mar 17, 2020
@7iomka
Copy link

7iomka commented Mar 17, 2020

@7iomka which locale are you using and on which OS are you seeing this?

image
Russian locale
Mac OS Catalina (latest)
Error happened if one of file with json syntax is opened on first run, or after first open json file after reload editor.
image

How to fix this issue with my current editor version?

@dbaeumer
Copy link
Member

@7iomka does

capture

this directory exist on your system (e.g. the directory containing the corrupted.info)

@dbaeumer
Copy link
Member

To get rid of the error you could close VSCode and delete the clp directory.

@dbaeumer
Copy link
Member

@aeschli why are you doing this: #86140 (comment)

If you use Node IPC as a transport console error and console out will be handled on the client and put into the client console.

You could easily print console.error from other libraries as well

@aeschli
Copy link
Contributor

aeschli commented Mar 18, 2020

@dbaeumer But what if stdout is used as transport? The JSON language server is published as npm module and there's currently no limitation on the transport.

@dbaeumer
Copy link
Member

I will had some code to the library that doesn't show a message box in case the error comes in via a conosle.*

@dbaeumer
Copy link
Member

Published client @ 6.1.2.

@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream-issue-fixed The underlying upstream issue has been fixed
Projects
None yet
Development

No branches or pull requests

4 participants