Extension get silently broken
julienrbrt opened this issue ยท 17 comments
Environment
- VSCode & OS Version:
Version: 1.33.1
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:20:22.771Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-48-generic
Steps to Reproduce
- Update Dart Code to 2.26.1
Behavior
The extension do not seems to work (Dart-Code/Dart-Code#1674).
No feedback from VS Code except in the console:
ERR Unable to load and parse grammar for scope source.dart from file:///home/julien/.vscode/extensions/dart-code.dart-code-2.26.1/syntaxes/dart.json SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parseJSONGrammar (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:1583)
at parseRawGrammar (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:1574)
at t.<anonymous> (textMateService.ts:252)
at Generator.next (<anonymous>)
at r (errors.ts:184)
at process._tickCallback (internal/process/next_tick.js:68)
ERR No grammar provided for <source.dart: Error: No grammar provided for <source.dart
at Registry.<anonymous> (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3583:39)
at step (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3511:23)
at Object.next (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3492:53)
at fulfilled (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3483:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
ERR Cannot read property 'comments' of undefined: TypeError: Cannot read property 'comments' of undefined
at f._extractValidCommentRule (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4002:202)
at f._handleConfig (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4005:546)
at _fileService.resolveContent.then.s (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4002:119)
at process._tickCallback (internal/process/next_tick.js:68:7)
A file of the extension was empty (even after uninstalling / reinstalling).
Removing ~/.vscode/extensions/dart-code.dart-code-2.26.1
and updating eventually resolved the problem.
Note
Does this issue occur when all extensions are disabled?: No. It is an extension related problem.
/cc @DanTup
I'm the author of the extension and recommended @julienrbrt raises this here. The issue was first reported in the Dart-Code repo, but was not reproducible by me or colleagues.
It turned out that at least one of the extensions files on disk were empty (the JSON syntax file). Uninstalling and reinstalling the extension did not fix because it didn't remove from disk. Manually deleting the extension from .vscode
then reinstalling did fix it.
It seems like something must have gone wrong during the extraction of the extension. It seems like VS Code might be able to tell if it fails to extract an extension and remove it from the disk (or the list of installed extensions, or whatever) to avoid confusion (and reports against the extension) like this.
@DanTup If something goes wrong while extracting, then we do not mark the extension as installed. Is it possible to get the logs from the user while installing the extension?
@julienrbrt is the user - if you can provide instructions (and the logs don't get deleted), maybe they can be provided. In this case I think the extension must've still been "installed" as it was showing the activation errors in the console.
You can go to logs directory by using the command Open Logs Folder
which will open the current session's logs folder. You can go one level up to see logs of all sessions. We store logs for last 10 sessions. If user has installed the extension recently then there are more chances that Shared Process.log
file in one of these sessions would have captured it. Hopefully we can get the log of installation.
@julienrbrt It could also happen that extension gets installed by an extension from outside for example extension that synchronises extensions (https://marketplace.visualstudio.com/items?itemName=nonoroazoro.syncing)
May I know if you have any such extensions installed that will synchronises extensions?
VS Code indeed showed the extension as installed. Maybe the relevant logs have been deleted; the earliest log I could get are from 14:43:56, around 15 minutes before I posted the issue on Dart Code repository.
There is dozens of
[2019-05-01 14:52:04.250] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:04.304] [sharedprocess] [info] Scanned system extensions: 72
in Shared Process.log
that I have omitted.
Shared Process.log
[2019-05-01 14:52:04.304] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:04.314] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:04.333] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:16.994] [sharedprocess] [info] Installing extension: dart-code.dart-code
[2019-05-01 14:52:17.024] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:17.191] [sharedprocess] [info] Downloaded extension: dart-code.dart-code /tmp/2bd302c6-a4d4-41be-b1be-d9dcfde2e9de
[2019-05-01 14:52:17.528] [sharedprocess] [info] Extracted extension to /home/julien/.vscode/extensions/.dart-code.dart-code-2.26.0: dart-code.dart-code
[2019-05-01 14:52:17.528] [sharedprocess] [info] Renamed to /home/julien/.vscode/extensions/dart-code.dart-code-2.26.0
[2019-05-01 14:52:17.529] [sharedprocess] [info] Installation completed. dart-code.dart-code
[2019-05-01 14:52:17.566] [sharedprocess] [info] Extensions installed successfully: dart-code.dart-code
[2019-05-01 14:52:20.082] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:20.094] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:20.135] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:20.168] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:20.187] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:20.197] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:20.234] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:20.244] [sharedprocess] [info] Scanned system extensions: 72
[2019-05-01 14:52:20.254] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:21.771] [sharedprocess] [info] Installing extension: dart-code.dart-code
[2019-05-01 14:52:21.889] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:22.242] [sharedprocess] [info] Downloaded extension: dart-code.dart-code /tmp/46ac1eb8-2bf7-429f-a529-8b4bf6ac08d6
[2019-05-01 14:52:22.293] [sharedprocess] [info] Removed the extension from uninstalled list: dart-code.dart-code
[2019-05-01 14:52:22.342] [sharedprocess] [info] Scanned user extensions: 15
[2019-05-01 14:52:22.354] [sharedprocess] [info] Extensions installed successfully: dart-code.dart-code
[2019-05-01 14:52:22.641] [sharedprocess] [info] Scanned user extensions: 15
It goes on like that multiple times, as I think it is because I was reverting to 2.26.0 as this one was working (but I had forgotten to disable auto update so it was all the time updating to 2.26.1 again).
I found some other possible useful information in renderer3.log
and renderer4.log
renderer3.log
[2019-05-01 14:44:21.105] [renderer3] [error] Unable to load and parse grammar for scope source.dart from file:///home/julien/.vscode/extensions/dart-code.dart-code-2.26.1/syntaxes/dart.json {}
[2019-05-01 14:44:21.106] [renderer3] [error] No grammar provided for <source.dart: Error: No grammar provided for <source.dart
at Registry.<anonymous> (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3583:39)
at step (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3511:23)
at Object.next (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3492:53)
at fulfilled (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3483:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
[2019-05-01 14:44:21.121] [renderer3] [error] Cannot read property 'comments' of undefined: TypeError: Cannot read property 'comments' of undefined
at f._extractValidCommentRule (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4002:202)
at f._handleConfig (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4005:546)
at _fileService.resolveContent.then.s (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4002:119)
at process._tickCallback (internal/process/next_tick.js:68:7)
renderer4.log
[2019-05-01 14:50:31.229] [renderer4] [error] No grammar provided for <source.dart: Error: No grammar provided for <source.dart
at Registry.<anonymous> (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3583:39)
at step (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3511:23)
at Object.next (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3492:53)
at fulfilled (/usr/share/code/resources/app/node_modules.asar/vscode-textmate/release/main.js:3483:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
[2019-05-01 14:50:31.277] [renderer4] [error] Cannot read property 'comments' of undefined: TypeError: Cannot read property 'comments' of undefined
at f._extractValidCommentRule (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4002:202)
at f._handleConfig (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4005:546)
at _fileService.resolveContent.then.s (file:///usr/share/code/resources/app/out/vs/workbench/workbench.main.js:4002:119)
at process._tickCallback (internal/process/next_tick.js:68:7)
(Where this is repeating several times)
May I know if you have any such extensions installed that will synchronises extensions?
@sandy081 No. This is the exhaustive list of extensions I am using:
Thanks for the logs but unfortunately they did not capture the corrupted case installing the dart-code 2.6.1 extension. Could be in old logs. Do you start seeing this as soon as you updated to 2.6.1 version ?
BTW
but I had forgotten to disable auto update so it was all the time updating to 2.26.1 again
You do not need to stop auto update. This is a bug currently that it is not ignoring auto updating an extension version that is installed specifically.
Thanks for the logs but unfortunately they did not capture the corrupted case installing the dart-code 2.6.1 extension. Could be in old logs. Do you start seeing this as soon as you updated to 2.6.1 version ?
Unfortunately this was the oldest I could get. And yes, this happened only after the update. The extension was then simply not working (giving the errors previously pasted).
I see. Was the update done through auto updates or manually?
@sandy081 The update was done via auto update. I only downgraded manually.
Cannot explain what went wrong without the proper logs. @julienrbrt Can you please keep an eye on it and report back if you see it again with the logs that capturing the corrupted update/install?
@sandy081 thanks for the info anyway. If I see any other reports, I'll link them here to try and get the logs sooner. Thanks!
On my computer this appears as a symptom of other problem. Some reason the VSCode has deleted itself, but it's still running. Next time I try to restart vscode it does not start and it gives a asar missing error. But it it appears to me as if extensions does not work, because that is a first symptom.
Only thing that helps is reinstalling vscode, and I've been doing that for months.
@Ciantic Does not related to this issue. Please file a separate issue with any steps to repro. Thanks.
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!