Vscode 1.31.0 failure to open (potentially 19.04 issue)


#1

Hi there,

The latest snap came out for vscode, but I cannot seem to launch it at all (via menus, terminal, run command, snap run command, etc.).

I can run the code command with flags to get the version, help, etc.

code -v
1.31.0
7c66f58312b48ed8ca4e387ebd9ffe9605332caa
x64

But if I run code . - no instance launches. Same with the menu, etc.

I was reading the man page for the snap command hoping to get some additional output as currently snap run vscode returns nothing at all. I have also re-installed the snap, rebooted, etc. as well.

Note that I am testing on 19.04.

cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.04
DISTRIB_CODENAME=disco
DISTRIB_DESCRIPTION="Ubuntu Disco Dingo (development branch)"

Any suggestions? Anyone else having similar issues

Thank you.


#2

Interesting, I am using the code-insiders snap on Disco Dingo and working just fine.

For vscode it might be good to involve @daniel or @wimpress


#3

Yeah, I tested on another machine and it worked. :frowning: I’m just trying to find a way to get more info).

Off to look through logs and debug commands.


#4

I am just appending some debugging output for more info.

$ snap run --gdb vscode

GNU gdb (Ubuntu 8.2.1-0ubuntu1) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/snapd/snap-confine...(no debugging symbols found)...done.
Starting program: /usr/lib/snapd/snap-confine --classic snap.vscode.vscode /usr/lib/snapd/snap-exec --command=gdb vscode
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 8501 is executing new program: /usr/lib/snapd/snap-exec
[New LWP 8506]
[New LWP 8507]
[New LWP 8508]
[New LWP 8509]
[LWP 8509 exited]
[LWP 8508 exited]
[LWP 8507 exited]
[LWP 8506 exited]
process 8501 is executing new program: /usr/lib/snapd/snap-gdb-shim


Welcome to `snap run --gdb`.
You are right before your application is execed():
- set any options you may need
- use 'cont' to start



Thread 1 "snap-gdb-shim" received signal SIGTRAP, Trace/breakpoint trap.
__GI_raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
Catchpoint 1 (exec)
Continuing.
process 8501 is executing new program: /usr/bin/dash

--Type <RET> for more, q to quit, c to continue without paging--
Thread 1 "command-vscode." hit Catchpoint 1 (exec'd /usr/bin/dash), 0x00007faee8c94090 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) cont
Continuing.
process 8501 is executing new program: /usr/bin/dash

Thread 1 "electron-launch" hit Catchpoint 1 (exec'd /usr/bin/dash), 0x00007f9a146d4090 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) cont
Continuing.
[Detaching after fork from child process 8515]
process 8501 is executing new program: /usr/bin/env

Thread 1 "code" hit Catchpoint 1 (exec'd /usr/bin/env), 0x00007fdf3a4cc090 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) cont
Continuing.
process 8501 is executing new program: /usr/bin/bash

Thread 1 "bash" hit Catchpoint 1 (exec'd /usr/bin/bash), 0x00007fee4dad4090 in ?? () from /lib64/ld-linux-x86-64.so.2
(gdb) cont
Continuing.
[Detaching after fork from child process 8517]
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
[Inferior 1 (process 8501) exited with code 01]
(gdb) cont
The program is not being run.
(gdb) cont
The program is not being run.
(gdb) cont
The program is not being run.

This seems odd to me:


You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
[Inferior 1 (process 8501) exited with code 01]

====

EDIT

  • if I run the app with sudo code --user-data-dir ~/tmp/vscode/ ., it will launch.
  • reset permissions on my home dir; still no launch
  • This is a test machine, considering nuking it. (stumped and wasting time. Would like to see if I can reproduce.)

EDIT2

  • Created a new user (same install), the issue disappeared.
  • Deleted original user.
  • Then had the realization that it was likely extensions. (Wish I had tested)
  • use settings sync, so wondering if my issue will return.
  • Pretty obvious this is an issue on my specific machine/setup, so I think this thread should be considered closed/solved (per se) since there is nothing wrong with the snap.

EDIT3 (15:48 PST) - Came back on a FRESH install of 19.04. Just this snap. Nuked ~/snap/vscode, ~/.config/Code and ~/.vscode. Still the same behavior. Swap users, things come back for a time. :cry: sniff

EDIT4 - Purged all folders as described above. Uninstalled snap. Rebooted. Install snap. Now the snap launches again. :confounded:


#5

OK, I am calling this out on it’s own.

This was a rough one.

So when it was working, and i was syncing down my cfg (settings sync), I caught this flying by:

"/snap/vscode/77/usr/share/code/bin/code" --install-extension GitHub.vscode-pull-request-github
Error: Command failed: "/snap/vscode/77/usr/share/code/bin/code" --install-extension GitHub.vscode-pull-request-github

/snap/vscode/77/usr/share/code/resources/app/out/vs/code/node/cli.js:6
for(var n=[],r=0,i=t.length;r<i;r++)n[r]=e[t[r]];return n};define(e[7],t([1,0]),function(e,t){"use strict";function n(e){return e instanceof Error&&e.name===i&&e.message===i}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(function(){if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e},0)}}return e.prototype.addListener=function(e){var t=this;return this.listeners.push(e),function(){t._removeListener(e)}},e.prototype.emit=function(e){this.listeners.forEach(function(t){t(e)})},e.prototype._removeListener=function(e){this.listeners.splice(this.listeners.indexOf(e),1)},e.prototype.setUnexpectedErrorHandler=function(e){this.unexpectedErrorHandler=e},e.prototype.getUnexpectedErrorHandler=function(){return this.unexpectedErrorHandler},e.prototype.onUnexpectedError=function(e){this.unexpectedErrorHandler(e),this.emit(e)},e.prototype.onUne
Failed to watch /home/dustin/.config/Code/User for changes (Error: ENOSPC: no space left on device, watch '/home/dustin/.config/Code/User')

Now as you can see, my disk is NOT full:

$ df -h
Filesystem                           Size  Used Avail Use% Mounted on
<snip>
/dev/mapper/ubuntu--budgie--vg-root  232G   13G  208G   6% /
<snip>

Turns out the fix is:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

(which will persist on reboot).

OW!

Just putting this in here in case anyone else comes across this.