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

Error: process.chdir() is not allowed in extension sandbox #1427

Closed
leateng opened this issue Dec 26, 2019 · 6 comments
Closed

Error: process.chdir() is not allowed in extension sandbox #1427

leateng opened this issue Dec 26, 2019 · 6 comments

Comments

@leateng
Copy link

leateng commented Dec 26, 2019

Result from CocInfo

versions

vim version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 12 2019 13:30:17)
node version: v13.5.0
coc.nvim version: 0.0.74-cd348f4905
term: undefined
platform: win32

Messages

"D:\code\CRM_NEW\app\controllers\alert\alerts_controller.rb" [unix] 369L, 12650C
[coc.nvim] Failed to start Solargraph: Error: process.chdir() is not allowed in extension sandbox
[coc.nvim] Solargraph failed to initialize.

Output channel: solargraph

[Error - 11:31:24 AM] Starting client failed:
Error: process.chdir() is not allowed in extension sandbox
at process.chdir (C:\Users\Teng.vim\plugged\coc.nvim\build\index.js:49042:15)
at resolveCommandAttempt (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:1201:17)
at resolveCommand (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:1214:12)
at detectShebang (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:1032:19)
at parseNonShell (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:1052:25)
at parse (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:1136:49)
at spawn (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:977:20)
at spawnWithBash (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:905:16)
at Object.solargraphCommand (C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:920:16)
at C:\Users\Teng\AppData\Local\coc\extensions\node_modules\coc-solargraph\lib\index.js:35891:37

Describe the bug

coc-solargraph starting failed on windows.

@leateng leateng changed the title Error: process.chdir() is not allowed in extension sandbox Error: process.chdir() is not allowed in extension sandbox [bug] Dec 26, 2019
@leateng leateng changed the title Error: process.chdir() is not allowed in extension sandbox [bug] Error: process.chdir() is not allowed in extension sandbox [BUG] Dec 26, 2019
@leateng leateng changed the title Error: process.chdir() is not allowed in extension sandbox [BUG] Error: process.chdir() is not allowed in extension sandbox bug Dec 26, 2019
@leateng leateng changed the title Error: process.chdir() is not allowed in extension sandbox bug [bug] Error: process.chdir() is not allowed in extension sandbox Dec 26, 2019
@leateng leateng changed the title [bug] Error: process.chdir() is not allowed in extension sandbox [help] Error: process.chdir() is not allowed in extension sandbox Dec 26, 2019
@leateng leateng changed the title [help] Error: process.chdir() is not allowed in extension sandbox Error: process.chdir() is not allowed in extension sandbox Dec 26, 2019
@fannheyward
Copy link
Member

It's not coc or coc-solargraph error, but caused by cross-spawn on Window.

coc-solargraph uses solargraph-utils to run solargraph, where solargraph-utils uses cross-spawn.

NullVoxPopuli/coc-ember#2
sindresorhus/execa#357
moxystudio/node-cross-spawn#124
moxystudio/node-cross-spawn#127 fixed.

solargraph-utils needs to upgrade cross-spawn dependency, then coc-solargraph.

@leateng
Copy link
Author

leateng commented Dec 26, 2019

@fannheyward thank you. I will try.

@Frydac
Copy link

Frydac commented Feb 12, 2020

I'm sorry for my ignorance but I don't understand what to do here. I have the same issue with coc-solargraph.
using

## versions

vim version: VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:36:07)
node version: v10.14.2
coc.nvim version: 0.0.74-98a709ec3f
term: xterm-256color
platform: win32

and coc-solargraph v1.1.5 installed with :CocInstall coc-solargraph

As what I think to understand from
NullVoxPopuli/coc-ember#2
I try to run yarn in ~\AppData\Local\coc\extensions\node_modules\coc-solargraph
which seems to fail with following output:

warning ..\..\package.json: No license field
info No lockfile found.
[1/5] Validating package.json...
warning coc-solargraph@1.1.5: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
⠁ (node:10300) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning solargraph-utils > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning turndown > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning turndown > jsdom > left-pad@1.3.0: use String.prototype.padStart()
[3/5] Fetching packages...
info fsevents@1.2.11: The platform "win32" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
$ npx npm-run-all clean build
npx: installed 58 in 2.96s
yarn run v1.7.0
warning ..\..\package.json: No license field
$ rimraf lib
Done in 0.23s.
yarn run v1.7.0
warning ..\..\package.json: No license field
$ webpack

Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: ac4f523740660a74e585
Version: webpack 4.41.6
Time: 42ms
Built at: 02/12/2020 10:44:21 AM

ERROR in Entry module not found: Error: Can't resolve './src/index.ts' in 'C:\Users\emilev\AppData\Local\coc\extensions\node_modules\coc-solargraph'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

After this, when I open a ruby file in gvim, it seems that coc doesn't try to start solargraph (using :CocInfo)

@chemzqm
Copy link
Member

chemzqm commented Feb 14, 2020

Update coc-solargraph should be fine now.

@Frydac
Copy link

Frydac commented Mar 16, 2020

Hi,

Thanks for the follow up.
Sorry it took me a while to get back to this, I try to avoid windows when I can.

I reinstalled coc-solargraph (now version 1.1.6, can see via :CocList extensions), and I still have the same issues:

  • CocInstall coc-solargraph, then open .rb file, coc-solargraph fails with CocInfo:
[Error  - 1:13:59 PM] Starting client failed: 
Error: process.chdir() is not allowed in extension sandbox
...
  • Trying to manually run yarn: similar output to my previous post:
C:\Users\Emile\AppData\Local\coc\extensions\node_modules\coc-solargraph>yarn
yarn install v1.22.0
warning ..\..\package.json: No license field
info No lockfile found.
[1/5] Validating package.json...
warning coc-solargraph@1.1.6: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
warning solargraph-utils > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning turndown > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning turndown > jsdom > left-pad@1.3.0: use String.prototype.padStart()
[3/5] Fetching packages...
info fsevents@1.2.11: The platform "win32" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @chemzqm/tslint-config@1.0.18" has incorrect peer dependency "tslint@^5.8.0".
warning "@chemzqm/tslint-config > tslint-react@3.6.0" has incorrect peer dependency "tslint@^5.1.0".
[5/5] Building fresh packages...

success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.22.4", while you're on "1.22.0".
info To upgrade, download the latest installer at "https://yarnpkg.com/latest.msi".
$ npx npm-run-all clean build
npx: installed 58 in 3.606s
yarn run v1.22.0
warning ..\..\package.json: No license field
warning coc-solargraph@1.1.6: The engine "coc" appears to be invalid.
$ rimraf lib
Done in 0.14s.
yarn run v1.22.0
warning ..\..\package.json: No license field
warning coc-solargraph@1.1.6: The engine "coc" appears to be invalid.
$ webpack

Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 4cba845db6c87d92c98c
Version: webpack 4.42.0
Time: 27ms
Built at: 03/16/2020 1:26:13 PM

ERROR in Entry module not found: Error: Can't resolve './src/index.ts' in 'C:\Users\Emile\AppData\Local\coc\extensions\node_modules\coc-solargraph'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 2.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@chemzqm
Copy link
Member

chemzqm commented Mar 17, 2020

@Frydac there's no dependencies of coc-solargraph, use yarn install --production --ignore-scripts for extension from npm.

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

No branches or pull requests

4 participants