Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#60093 - [code] VS Code won't start

Attached to Project: Community Packages
Opened by Matt (matth) - Monday, 17 September 2018, 15:47 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 18 September 2018, 00:06 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description: First off, thanks for getting this into [community] from the AUR!

When trying to start VS code (code 1.27.2-1) it gets a permission issue about saving data. It appears to be trying to save data to /usr/data/user-data

I went installed older versions to see when the issue was introduced and code 1.27.1-5 launches successfully.


Additional info:
* package version(s):

code 1.27.2-1

electron 2.0.9-1

* config and/or log files etc.
I moved all config files in $HOME that I had from previous versions and still get the error.

Output of running it with verbose.

```
code --verbose
(electron:22821): Gtk-WARNING **: 11:39:54.320: Theme parsing error: cinnamon-applications.css:18:15: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'
(electron:22821): Gtk-WARNING **: 11:39:54.331: Theme parsing error: gtk.css:2123:4: Junk at end of value for border-left-color
(electron:22857): Gtk-WARNING **: 11:39:54.858: Theme parsing error: cinnamon-applications.css:18:15: The 'icon-shadow' property has been renamed to '-gtk-icon-shadow'
(electron:22857): Gtk-WARNING **: 11:39:54.865: Theme parsing error: gtk.css:2123:4: Junk at end of value for border-left-color
[main 11:39:55 AM] { Error: EACCES: permission denied, open '/usr/data/user-data/storage.json'
at Object.fs.openSync (original-fs.js:646:18)
at Object.fs.readFileSync (original-fs.js:551:33)
at e.loadSync (/usr/lib/code/out/vs/code/electron-main/main.js:286:881)
at e.ensureLoaded (/usr/lib/code/out/vs/code/electron-main/main.js:286:340)
at e.getItem (/usr/lib/code/out/vs/code/electron-main/main.js:286:392)
at e.getItem (/usr/lib/code/out/vs/code/electron-main/main.js:287:314)
at e.handleRestarted (/usr/lib/code/out/vs/code/electron-main/main.js:303:454)
at e (/usr/lib/code/out/vs/code/electron-main/main.js:303:351)
at t.create (/usr/lib/code/out/vs/code/electron-main/main.js:51:770)
at e._createInstance (/usr/lib/code/out/vs/code/electron-main/main.js:214:325)
at e._createAndCacheServiceInstance (/usr/lib/code/out/vs/code/electron-main/main.js:215:291)
at e._getOrCreateServiceInstance (/usr/lib/code/out/vs/code/electron-main/main.js:214:462)
at Object.get (/usr/lib/code/out/vs/code/electron-main/main.js:213:153)
at X (/usr/lib/code/out/vs/code/electron-main/main.js:546:623)
at e.invokeFunction (/usr/lib/code/out/vs/code/electron-main/main.js:213:279)
at /usr/lib/code/out/vs/code/electron-main/main.js:547:776
at n.Class.derive._creator.done (/usr/lib/code/out/vs/code/electron-main/main.js:91:486)
at Object.g [as _notify] (/usr/lib/code/out/vs/code/electron-main/main.js:86:548)
at Object.enter (/usr/lib/code/out/vs/code/electron-main/main.js:89:592)
at n.Class.derive._oncancel._run (/usr/lib/code/out/vs/code/electron-main/main.js:90:932)
at n.Class.derive._oncancel._error (/usr/lib/code/out/vs/code/electron-main/main.js:90:449)
at u (/usr/lib/code/out/vs/code/electron-main/main.js:93:962)
at /usr/lib/code/out/vs/code/electron-main/main.js:94:70
at Object.g [as _notify] (/usr/lib/code/out/vs/code/electron-main/main.js:86:375)
at Object.enter (/usr/lib/code/out/vs/code/electron-main/main.js:89:592)
at n.Class.derive._creator._run (/usr/lib/code/out/vs/code/electron-main/main.js:90:932)
at n.Class.derive._creator._chainedError (/usr/lib/code/out/vs/code/electron-main/main.js:90:291)
at n (/usr/lib/code/out/vs/code/electron-main/main.js:88:115)
at n.Class.define.cancel.then (/usr/lib/code/out/vs/code/electron-main/main.js:91:736)
at Object.enter (/usr/lib/code/out/vs/code/electron-main/main.js:88:184)
at n.Class.derive._creator._run (/usr/lib/code/out/vs/code/electron-main/main.js:90:932)
at n.Class.derive._creator._setCompleteValue (/usr/lib/code/out/vs/code/electron-main/main.js:90:626)
at Object.g [as _notify] (/usr/lib/code/out/vs/code/electron-main/main.js:86:357)
at Object.enter (/usr/lib/code/out/vs/code/electron-main/main.js:89:592)
at n.Class.derive._creator._run (/usr/lib/code/out/vs/code/electron-main/main.js:90:932)
at n.Class.derive._creator._chainedError (/usr/lib/code/out/vs/code/electron-main/main.js:90:291)
at n (/usr/lib/code/out/vs/code/electron-main/main.js:88:115)
at n.Class.define.cancel.then (/usr/lib/code/out/vs/code/electron-main/main.js:91:736)
at Object.enter (/usr/lib/code/out/vs/code/electron-main/main.js:88:184)
at n.Class.derive._creator._run (/usr/lib/code/out/vs/code/electron-main/main.js:90:932)
at n.Class.derive._creator._setCompleteValue (/usr/lib/code/out/vs/code/electron-main/main.js:90:626)
at Object.g [as _notify] (/usr/lib/code/out/vs/code/electron-main/main.js:86:357)
at Object.enter (/usr/lib/code/out/vs/code/electron-main/main.js:89:592)
at n.Class.derive._oncancel._run (/usr/lib/code/out/vs/code/electron-main/main.js:90:932)
at n.Class.derive._oncancel._error (/usr/lib/code/out/vs/code/electron-main/main.js:90:449)
at /usr/lib/code/out/vs/code/electron-main/main.js:122:387
at FSReqWrap.oncomplete (original-fs.js:152:21)
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/usr/data/user-data/storage.json' }
[main 11:39:55 AM] Startup error: Error: EACCES: permission denied, mkdir '/usr/data/user-data/User',Error: EACCES: permission denied, mkdir '/usr/data/extensions',Error: EACCES: permission denied, mkdir '/usr/data/user-data/CachedData/f46c4c469d6e6d8c46f268d1553c5dc4b475840f',Error: EACCES: permission denied, mkdir '/usr/data/user-data/logs/20180917T113955'
[main 11:39:55 AM] Lifecycle#kill()
[22857:0917/113955.316425:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
```


Steps to reproduce:
Install code and try to run it with `code` or `code --vebose`
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Tuesday, 18 September 2018, 00:06 GMT
Reason for closing:  Upstream
Additional comments about closing:  The program logic for detecting portable setups is weird, but it shouldn't really affect users unless they create nonstandard paths on their own.

It's upstream's job to make this misfeature more robust.
Comment by Eli Schwartz (eschwartz) - Monday, 17 September 2018, 19:22 GMT
Works for me.

This string only appears in the code once: https://github.com/Microsoft/vscode/blob/e4ede32d8e2131ba3299a07052ec68c7619b99fe/src/main.js#L157

Do you have $VSCODE_PORTABLE set...
Comment by Matt (matth) - Monday, 17 September 2018, 20:29 GMT
Thanks for the tip on VSCODE_PORTABLE. I didn't have that set but that did help me track down what was wrong

The change here is we are now running through /usr/lib/code/out/cli.js

In that file it runs this code: https://github.com/Microsoft/vscode/blob/1e98303d911d755e25c2704cf79bc6acae19c504/src/bootstrap.js#L175-L200

When run from the package; appRoot is /usr/lib/code/ and platform is linux so it sets the VSCODE_PORTABLE env variable to /usr/data

It then checks if /usr/data exists on the system, and if it does it sets isPortable to true and tries to use that as the data path.

In my case /usr/data did exist, so I just moved that directory so now it works fine.
Comment by Eli Schwartz (eschwartz) - Tuesday, 18 September 2018, 00:04 GMT
Right, so it automatically defaults VSCODE_PORTABLE to path.dirname(path.dirname(path.dirname(appRoot))) and *then* checks if "$VSCODE_PORTABLE/data" exists, in order to automatically enable portable mode???

This is quite silly IMHO, on the other hand it's rather odd to have a /usr/data directory.

I don't think there's anything to fix here, really. But I'd consider submitting an upstream bug report asking Microsoft to use some less fragile detection logic. At least, when not building their own prebuilt packages? their assumption about the installation directory is... not working. It's probably meant to find something like e.g. "VSCodePortable/App/VSCode/vscode" and "VSCodePortable/Data/" (that would be the portableapps.com specification) but if so it should check that the tree layout in question is actually their portableapps layout or whatever. In fact, for that use case, "VSCodePortable/VSCode.exe" would be a special launcher responsible for setting variables explicitly. -_-

This implicit mess is just asking for trouble.

Loading...