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

VSCode not starting unless --no-sandbox provided in certain cases #81056

Closed
sweettyler opened this issue Sep 17, 2019 · 17 comments
Closed

VSCode not starting unless --no-sandbox provided in certain cases #81056

sweettyler opened this issue Sep 17, 2019 · 17 comments
Assignees
Labels
electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@sweettyler
Copy link

downloaded & installed the latest insider version "code-insider-1568700490.tar.gz" and found it crashed at launch with error message:

../code-insiders: /lib64/libdbus-1.so.3: no version information available (required by ../code-insiders)

my system: CentOS Linux release 7.4.1708 (Core)

it worked last Friday with the version "code-insider-1568277818.tar.gz"

  • VSCode Version:
  • OS Version:

Steps to Reproduce:

Does this issue occur when all extensions are disabled?: Yes/No

@vscodebot
Copy link

vscodebot bot commented Sep 17, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@sweettyler
Copy link
Author

No such a problem with the stable version v1.38.1.

after some investigation, it seems the problem has nothing to do with the error message (which was warning and I also have it when I launch the stable version of vscode), it must be caused by something else!

@kieferrm
Copy link
Member

That's the build based off commit bdd1971. The insider build now uses electron 6.0.9 which may cause the problem.

@bpasero
Copy link
Member

bpasero commented Sep 17, 2019

@sweettyler does it work if you start with --no-sandbox?

@bpasero bpasero added electron Issues and items related to Electron electron-6.0.x-update info-needed Issue requires more information from poster upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Sep 17, 2019
@sweettyler
Copy link
Author

Yes, it works with --no-sandbox.

And the messages are:
../code-insiders: /lib64/libdbus-1.so.3: no version information available (required by ../code-insiders)
Option 'sandbox' is unknown. Ignoring.

@bpasero
Copy link
Member

bpasero commented Sep 17, 2019

@sweettyler what kind of setup is this? Does Linux run in a VM? Or Container? Or is this literally a normal installation on disk? Anything special about user permissions?

Related/duplicate: #80975

@sweettyler
Copy link
Author

@bpasero My Linux is managed by "HP Remote Graphics Session Manager", so it is in a VM actually. I don't think there is anything special because both the stable version (v1.38.1) and the insider version of "code-insider-1568277818.tar.gz" work in the same environment.

@sweettyler
Copy link
Author

here are some more message with --verbose:
[298177:0917/131615.366585:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that .../VSCode-linux-x64/chrome-sandbox is owned by root and has mode 4755

@MarlonRodriguez
Copy link

MarlonRodriguez commented Sep 17, 2019

This happens on my windows 10 citrix session as well. Crash with the latest version of code insiders. It also works fine if using --no-sandbox. Interesting enough, once I have one open that way, any other Code window I open without that options still works fine. Close them all and start over, no options, it crashes again.
Errors/warnings:
Option 'sandbox' is unknown. Ignoring.
[main 2019-09-17T22:39:29.663Z] update#setState idle
(electron) 'isAccessibilitySupportEnabled function' is deprecated and will be removed. Please use 'accessibilitySupportEnabled property' instead.
(node:29340) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:29340) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[main 2019-09-17T22:39:59.664Z] update#setState checking for updates
[main 2019-09-17T22:39:59.769Z] update#setState idle
image

@MarlonRodriguez
Copy link

Using "code - insiders.exe" --verbose --performance:
Option 'performance' is unknown. Ignoring.
[main 2019-09-17T23:08:46.999Z] Starting VS Code
[main 2019-09-17T23:08:46.999Z] from: c:\Users\myusername\Documents\VSCode\resources\app
[main 2019-09-17T23:08:47.000Z] args: { _: [], verbose: true, diff: undefined }
[main 2019-09-17T23:08:47.004Z] Resolving machine identifier...
[main 2019-09-17T23:08:47.005Z] Resolved machine identifier: 2968ec11c69619ea1adb7093c88d0ba633bc32e78e563fd122d7c5eba05d8932 (trueMachineId: undefined)
[main 2019-09-17T23:08:47.034Z] update#setState idle
[main 2019-09-17T23:08:47.035Z] [storage state.vscdb] open(c:\Users\myusername\AppData\Roaming\Code - Insiders\User\globalStorage\state.vscdb, retryOnBusy: true)
[main 2019-09-17T23:08:47.037Z] lifecycle (main): phase changed (value: 2)
[main 2019-09-17T23:08:47.039Z] windowsManager#open
(electron) 'isAccessibilitySupportEnabled function' is deprecated and will be removed. Please use 'accessibilitySupportEnabled property' instead.
[main 2019-09-17T23:08:47.123Z] lifecycle (main): phase changed (value: 3)
[main 2019-09-17T23:08:47.547Z] [storage state.vscdb] Trace (event): SELECT * FROM ItemTable
[main 2019-09-17T23:08:47.551Z] [storage state.vscdb] getItems(): 52 rows
[main 2019-09-17T23:08:47.653Z] [storage state.vscdb] updateItems(): insert(Map(2) {telemetry.lastSessionDate => Tue, 17 Sep 2019 23:06:28 GMT, telemetry.currentSessionDate => Tue, 17 Sep 2019 23:08:47 GMT}), delete(Set(0) {})
[main 2019-09-17T23:08:47.654Z] [storage state.vscdb] Trace (event): BEGIN TRANSACTION
[main 2019-09-17T23:08:47.654Z] [storage state.vscdb] Trace (event): INSERT INTO ItemTable VALUES ('telemetry.lastSessionDate','Tue, 17 Sep 2019 23:06:28 GMT'),('telemetry.currentSessionDate','Tue, 17 Sep 2019 23:08:47 GMT')
[main 2019-09-17T23:08:47.657Z] [storage state.vscdb] Trace (event): END TRANSACTION
[main 2019-09-17T23:08:50.131Z] getShellEnvironment: running on Windows, skipping
[main 2019-09-17T23:09:17.035Z] update#checkForUpdates, state = idle
[main 2019-09-17T23:09:17.035Z] update#setState checking for updates
[main 2019-09-17T23:09:17.037Z] RequestService#request https://update.code.visualstudio.com/api/update/win32-x64-archive/insider/bdd1971f2cd9d08a8a90e02740f1850afe03da66
[main 2019-09-17T23:09:17.550Z] [VS Code]: detected unresponsive
[main 2019-09-17T23:09:21.435Z] Lifecycle#window.on('closed') - window ID 1
[main 2019-09-17T23:09:21.435Z] Lifecycle#onWillShutdown.fire()
[main 2019-09-17T23:09:21.443Z] [storage state.vscdb] close()
[main 2019-09-17T23:09:21.445Z] Lifecycle#app.on(window-all-closed)
[main 2019-09-17T23:09:21.446Z] Lifecycle#app.on(before-quit)
[main 2019-09-17T23:09:21.448Z] Lifecycle#onBeforeShutdown.fire()
[main 2019-09-17T23:09:21.452Z] Lifecycle#app.on(will-quit)

@bpasero bpasero removed the info-needed Issue requires more information from poster label Sep 18, 2019
@bpasero bpasero changed the title The latest code-insiders crashed! VSCode not starting unless --no-sandbox provided in certain cases Sep 18, 2019
@bpasero bpasero added the electron-blocker Issues in next update of Electron preventing update label Sep 18, 2019
@bpasero bpasero added this to the September 2019 milestone Sep 18, 2019
@bpasero
Copy link
Member

bpasero commented Sep 18, 2019

@sweettyler @MarlonRodriguez can you CD into the VSCode installation folder and run this command and print the output:

ls -al chrome-sandbox

@bpasero
Copy link
Member

bpasero commented Sep 18, 2019

Also can you please let me know how you installed VSCode to begin with? Did you use a zip archive?

@bpasero bpasero removed the electron-blocker Issues in next update of Electron preventing update label Sep 18, 2019
@vladimiry
Copy link

vladimiry commented Sep 18, 2019

Known workarounds on the user side:

  • Passing --no-sandbox argument.
  • Persistent but system-wide workaround is enabling a User Namespaces: sudo sysctl kernel.unprivileged_userns_clone=1 (it's for example enabled by default on Ubuntu, but not on Arch Linux).
  • Enabling SUID/fallback sandbox by executing chown root chrome-sandbox && chmod 4755 chrome-sandbox (sudo might be needed).

Known solutions on the code side:

  • For AppImage: repackaging the app in order to hardcode the --no-sandbox arg in respective AppRun script.
  • For Snap: recent electron-builder versions already hardcode --no-sandbox arg for you.
  • For other/non-containerized package types: running chown root chrome-sandbox && chmod 4755 chrome-sandbox before preparing the packages. Depending on the repository type there also will be a need to do the same in the reporitory-related scripts, like done here for AUR.
  • Well, using own preloader that will pass the --no-sandbox argument for all the package types.

@bpasero
Copy link
Member

bpasero commented Sep 18, 2019

We are thinking of hardcoding --no-sandbox in all places we launch VSCode.

@bpasero
Copy link
Member

bpasero commented Sep 18, 2019

Landed via #81096

The only remaining issue will be if you run the executable directly, but that is not intended anyway.

@bpasero bpasero closed this as completed Sep 18, 2019
@sweettyler
Copy link
Author

@bpasero "ls -al chrome-sandbox" gives:
-rwx------ 1 tylr tylr 5099032 Sep 11 19:54 chrome-sandbox
BTW, "chmod 4755 chrome-sandbox" doesn't help (don't have root permission so cannot change the owner.

I installed vscode from the downloaded zip package ("code-insider-1568700490.tar.gz")

Sorry for the late reply.

@bpasero
Copy link
Member

bpasero commented Sep 18, 2019

@sweettyler if you run our binary directly from the command line, you will have to manually add "--no-sandbox" for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

6 participants