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

Remote terminals don't resolve variables when restored on startup #81231

Open
andyj513 opened this issue Sep 20, 2019 · 12 comments
Open

Remote terminals don't resolve variables when restored on startup #81231

andyj513 opened this issue Sep 20, 2019 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities remote Remote system operations issues terminal Integrated terminal issues
Milestone

Comments

@andyj513
Copy link

Issue Type: Bug

I changed my Terminal->Integrated: Cwd setting to "$(workspaceFolder)". Now, when Code starts up, the Terminal does not open, and I get a notification: "The terminal shell CWD "/home/gpudb/gpudb-dev-7.0/gpudb-core/gaiadb-cluster/${workspaceFolder}" does not exist". This happens every time I launch Code.

However, once Code has loaded, I can then do Ctrl-` to open a Terminal window, and it works as expected (also every time). Note that this is doing Remote development (so the Terminal is opening a session on my remote machine).

I suspect the issue is that Code is trying to start the Terminal before $workspaceFolder is set, but it is set later, when I manually open the Terminal. It is a fairly easy work-around, but am reporting it in case this is not the expected behavior.

VS Code version: Code 1.38.1 (b37e54c, 2019-09-11T13:35:15.005Z)
OS version: Windows_NT x64 10.0.18362
Remote OS version: Linux x64 4.15.0-62-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2592)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.76GB (7.51GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote SSH: andy-linux
OS Linux x64 4.15.0-62-generic
CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 900)
Memory (System) 62.86GB (6.62GB free)
VM 0%
Extensions (20)
Extension Author (truncated) Version
vscode-cudacpp kri 0.1.1
remote-containers ms- 0.74.0
remote-ssh ms- 0.46.1
remote-ssh-edit ms- 0.46.1
remote-ssh-explorer ms- 0.46.1
remote-wsl ms- 0.39.5
vscode-remote-extensionpack ms- 0.17.0
vs-keybindings ms- 0.2.0
code-gnu-global aus 0.2.2
githistory don 0.4.6
mssql ms- 1.6.0
cpptools ms- 0.25.1
java red 0.49.0
vscodeintellicode Vis 1.1.9
vscode-java-debug vsc 0.21.0
vscode-java-dependency vsc 0.5.1
vscode-java-pack vsc 0.8.0
vscode-java-test vsc 0.19.0
vscode-maven vsc 0.19.0
gitblame wad 3.0.1
@Tyriar
Copy link
Member

Tyriar commented Sep 25, 2019

Nice find, looks like we're trying to resolve variables before the service that does it is able to do so.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues labels Sep 25, 2019
@lifez
Copy link
Contributor

lifez commented Oct 15, 2019

@Tyriar I would like to take this. Could you please guide me?

@Tyriar
Copy link
Member

Tyriar commented Oct 16, 2019

@lifez this one will need you to do a bit of debugging/investigation here:

if (configurationResolverService) {
try {
customCwd = configurationResolverService.resolve(lastActiveWorkspace, customCwd);
} catch (e) {
// There was an issue resolving a variable, log the error in the console and
// fallback to the default.
if (logService) {
logService.error('Could not resolve terminal.integrated.cwd', e);
}
customCwd = undefined;
}
}

I think that if statement is not entered on launch because configurationResolverService is undefined.

@lifez
Copy link
Contributor

lifez commented Oct 16, 2019

@Tyriar Thank you!! I would like to take this one

@lifez
Copy link
Contributor

lifez commented Oct 18, 2019

@Tyriar I cannot start the code. Could you please help me please?

➜  scripts git:(fix-terminal-startup) ./code.sh
yarn run v1.17.0
$ node build/lib/electron
✨  Done in 1.19s.
[07:16:02] Syncronizing built-in extensions...
[07:16:02] You can manage built-in extensions with the --builtin flag
[07:16:02] [marketplace] [email protected] ✔︎
[07:16:02] [marketplace] [email protected] ✔︎
[07:16:02] [marketplace] [email protected] ✔︎
Error: The module '/Users/phawin/mine/vscode/node_modules/spdlog/build/Release/spdlog.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:138:31)
    at process.func [as dlopen] (electron/js2c/asar.js:138:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
    at Object.func (electron/js2c/asar.js:138:31)
    at Object.func [as .node] (electron/js2c/asar.js:138:31)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at bindings (/Users/phawin/mine/vscode/node_modules/spdlog/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/Users/phawin/mine/vscode/node_modules/spdlog/index.js:3:35)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at NodeScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:747:39)
    at OnlyOnceScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:585:32)
    at loadNextPath (/Users/phawin/mine/vscode/out/vs/loader.js:1523:41)
    at Object.errorback (/Users/phawin/mine/vscode/out/vs/loader.js:1531:25)
    at OnlyOnceScriptLoader.triggerErrorback (/Users/phawin/mine/vscode/out/vs/loader.js:598:36)
    at /Users/phawin/mine/vscode/out/vs/loader.js:585:151
    at ReadFileContext.callback (/Users/phawin/mine/vscode/out/vs/loader.js:764:25)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:246:13) {
  phase: 'loading',
  moduleId: 'spdlog',
  neededBy: [ '===anonymous2===' ]
}
[main 2019-10-18T00:16:03.374Z] update#ctor - updates are disabled as there is no update URL
[main 2019-10-18T00:16:03.590Z] [storage state.vscdb] open(): Unable to open DB due to Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
[main 2019-10-18T00:16:03.609Z] [storage state.vscdb] open(): Unable to use backup due to Error: ENOENT: no such file or directory, unlink '/Users/phawin/Library/Application Support/code-oss-dev/User/globalStorage/state.vscdb'
[main 2019-10-18T00:16:03.610Z] [uncaught exception in main]: Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
[main 2019-10-18T00:16:03.610Z] Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:138:31)
    at process.func [as dlopen] (electron/js2c/asar.js:138:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
    at Object.func (electron/js2c/asar.js:138:31)
    at Object.func [as .node] (electron/js2c/asar.js:138:31)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/lib/sqlite3.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at NodeScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:747:39)
    at OnlyOnceScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:585:32)
    at loadNextPath (/Users/phawin/mine/vscode/out/vs/loader.js:1523:41)
    at Object.errorback (/Users/phawin/mine/vscode/out/vs/loader.js:1531:25)
    at OnlyOnceScriptLoader.triggerErrorback (/Users/phawin/mine/vscode/out/vs/loader.js:598:36)
    at /Users/phawin/mine/vscode/out/vs/loader.js:585:151
    at ReadFileContext.callback (/Users/phawin/mine/vscode/out/vs/loader.js:764:25)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:246:13)
[main 2019-10-18T00:16:03.610Z] Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:138:31)
    at process.func [as dlopen] (electron/js2c/asar.js:138:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
    at Object.func (electron/js2c/asar.js:138:31)
    at Object.func [as .node] (electron/js2c/asar.js:138:31)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/lib/sqlite3.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at NodeScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:747:39)
    at OnlyOnceScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:585:32)
    at loadNextPath (/Users/phawin/mine/vscode/out/vs/loader.js:1523:41)
    at Object.errorback (/Users/phawin/mine/vscode/out/vs/loader.js:1531:25)
    at OnlyOnceScriptLoader.triggerErrorback (/Users/phawin/mine/vscode/out/vs/loader.js:598:36)
    at /Users/phawin/mine/vscode/out/vs/loader.js:585:151
    at ReadFileContext.callback (/Users/phawin/mine/vscode/out/vs/loader.js:764:25)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:246:13) {
  phase: 'loading',
  moduleId: 'vscode-sqlite3',
  neededBy: [ '===anonymous3===' ]
}
[main 2019-10-18T00:16:03.711Z] [uncaught exception in main]: Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
[main 2019-10-18T00:16:03.712Z] Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:138:31)
    at process.func [as dlopen] (electron/js2c/asar.js:138:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
    at Object.func (electron/js2c/asar.js:138:31)
    at Object.func [as .node] (electron/js2c/asar.js:138:31)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/lib/sqlite3.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at NodeScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:747:39)
    at OnlyOnceScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:585:32)
    at loadNextPath (/Users/phawin/mine/vscode/out/vs/loader.js:1523:41)
    at Object.errorback (/Users/phawin/mine/vscode/out/vs/loader.js:1531:25)
    at OnlyOnceScriptLoader.triggerErrorback (/Users/phawin/mine/vscode/out/vs/loader.js:598:36)
    at /Users/phawin/mine/vscode/out/vs/loader.js:585:151
    at ReadFileContext.callback (/Users/phawin/mine/vscode/out/vs/loader.js:764:25)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:246:13)
[8392:1018/071606.782439:INFO:CONSOLE(17)] "Error: The module '/Users/phawin/mine/vscode/node_modules/spdlog/build/Release/spdlog.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).", source: file:///Users/phawin/mine/vscode/out/vs/platform/log/node/spdlogService.js (17)
[8392:1018/071606.793418:INFO:CONSOLE(17)] "Error: The module '/Users/phawin/mine/vscode/node_modules/spdlog/build/Release/spdlog.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).", source: file:///Users/phawin/mine/vscode/out/vs/platform/log/node/spdlogService.js (17)
[8392:1018/071606.793480:INFO:CONSOLE(17)] "Error: The module '/Users/phawin/mine/vscode/node_modules/spdlog/build/Release/spdlog.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).", source: file:///Users/phawin/mine/vscode/out/vs/platform/log/node/spdlogService.js (17)
[8392:1018/071606.801727:INFO:CONSOLE(138)] "Uncaught (in promise) Error: Module did not self-register.", source: electron/js2c/asar.js (138)
[8392:1018/071606.811598:INFO:CONSOLE(99)] "Uncaught (in promise) Canceled: Canceled", source: file:///Users/phawin/mine/vscode/out/vs/base/common/errors.js (99)
[main 2019-10-18T00:21:34.614Z] Error: The module '/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/build/Release/sqlite.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:138:31)
    at process.func [as dlopen] (electron/js2c/asar.js:138:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
    at Object.func (electron/js2c/asar.js:138:31)
    at Object.func [as .node] (electron/js2c/asar.js:138:31)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/phawin/mine/vscode/node_modules/vscode-sqlite3/lib/sqlite3.js:1:15)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at NodeScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:747:39)
    at OnlyOnceScriptLoader.load (/Users/phawin/mine/vscode/out/vs/loader.js:585:32)
    at loadNextPath (/Users/phawin/mine/vscode/out/vs/loader.js:1523:41)
    at Object.errorback (/Users/phawin/mine/vscode/out/vs/loader.js:1531:25)
    at OnlyOnceScriptLoader.triggerErrorback (/Users/phawin/mine/vscode/out/vs/loader.js:598:36)
    at /Users/phawin/mine/vscode/out/vs/loader.js:585:151
    at ReadFileContext.callback (/Users/phawin/mine/vscode/out/vs/loader.js:764:25)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:246:13) {
  phase: 'loading',
  moduleId: 'vscode-sqlite3',
  neededBy: [ '===anonymous3===' ]
}

@Tyriar
Copy link
Member

Tyriar commented Oct 18, 2019

@lifez that means the node modules are using a different version of Electron that what's running, we recently changed the version fo Electron from 6->4->6. You should

  • Sync your branch with upstream
  • git clean -xfd (this will blow away all changes, commit or stash first if you need them)
  • yarn

@lifez
Copy link
Contributor

lifez commented Oct 20, 2019

I cannot make this work. I think it because Catalina nodejs/node-gyp#1927

So that I won't work on this issue.

@Tyriar Tyriar added this to the Backlog milestone Oct 26, 2019
@ChrisPapp
Copy link
Contributor

ChrisPapp commented Mar 25, 2020

I cannot reproduce it on Windows 10. Maybe this thread should be closed, if the issue has already been fixed.

@JoyceBabu
Copy link

JoyceBabu commented Apr 22, 2020

I am also getting similar error

Error: The module '\?\D:\Projects\code-server\build\lib\vscode\node_modules\spdlog\build\Release\spdlog.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 75. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing

@Tyriar
Copy link
Member

Tyriar commented Apr 22, 2020

@JoyceBabu try recompiling as in #81231 (comment), we change the Electron version sometimes which means all native node modules will stop working until you do that.

@Tyriar Tyriar closed this as completed Apr 22, 2020
@Tyriar Tyriar reopened this Apr 22, 2020
@andyj513
Copy link
Author

andyj513 commented Jun 16, 2020 via email

@Tyriar
Copy link
Member

Tyriar commented Jun 17, 2020

@andyj513 I suspect this is still happening.

@Tyriar Tyriar changed the title Terminal window doesn't open at startup Remote terminals don't resolve variables when restored on startup Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities remote Remote system operations issues terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

6 participants