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

Unable to start Code on Ubuntu #862

Closed
ace007 opened this issue Dec 1, 2015 · 27 comments
Closed

Unable to start Code on Ubuntu #862

ace007 opened this issue Dec 1, 2015 · 27 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@ace007
Copy link

ace007 commented Dec 1, 2015

I am running Ubuntu 15.04, without a GUI. My home directory is an NFS share mounted via automount, my account is via NIS.
After installing Gnome I have been able to get the Code executable to run by double clicking on the program from a file explorer. But not from a shell, either on the console or a remote ssh.
If I run the Code program from my normal ssh login it runs waits a while and then exits, with no error message or anything.
If I run it with the sudo Code command it runs up and works fine, apart from the whole running as root issue :(.
I suspect it's a file permission thing but am unable to track down what it could be.

Regards

John

@bpasero
Copy link
Member

bpasero commented Dec 1, 2015

Would be nice if you could track further ;)

@bpasero bpasero added this to the Backlog milestone Dec 1, 2015
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities info-needed Issue requires more information from poster labels Dec 1, 2015
@ace007
Copy link
Author

ace007 commented Dec 1, 2015

The program exits without any information.
Is there a log file or any command line options that would make it easier to find out what is wrong ?

@bpasero
Copy link
Member

bpasero commented Dec 1, 2015

Maybe "code --verbose" reveals more?

@ace007
Copy link
Author

ace007 commented Dec 1, 2015

That gave me this error
Startup error: TypeError: Bad argument
Still not helpful
Seems to work fine when run via sudo Code

@bpasero
Copy link
Member

bpasero commented Dec 1, 2015

Hmmm, I wonder if this has something to do with the window properties we set. Are you able to build and run VS Code out of source code here on GitHub?

@bpasero bpasero modified the milestones: Dec 2015, Backlog Dec 1, 2015
@ace007
Copy link
Author

ace007 commented Dec 1, 2015

This is heading down a rabbit hole I would rather not go down at the moment, I am really busy and was hoping this tool would speed things up.
I have the software running on my windows machine so I can use it there for now.
The Ubuntu machine I am using is a vm on my windows machine (using Hyper-V) and it is NOT a full desktop install, it's version 15.04. I have had to install gnome (apt-get install gnome) just to get the software to run. You install notes are vague on what the dependencies are, it's possible that there is something not quite right about my environment. It was built to run docker containers and not for more complex software building.
I will see what I can do if I get some free time.

@bpasero
Copy link
Member

bpasero commented Dec 1, 2015

Yeah no worries, take your time. The instructions are here: https://github.com/Microsoft/vscode/wiki/How-to-Contribute

It could be that something is missing as requirement but it could also be that we do something wrong when setting the window dimensions for VS Code. I got suspicious when I saw the error message from the --verbose call.

@ace007
Copy link
Author

ace007 commented Dec 1, 2015

It is being X displayed back from the Ubuntu vm to Cygwin running on my windows machine

@bpasero
Copy link
Member

bpasero commented Dec 1, 2015

Got it, it could also well just be not supported by the Electron framework we use for rendering the UI. Does the Atom editor open?

@ace007
Copy link
Author

ace007 commented Dec 1, 2015

don't forget it does work when run by "sudo Code" from the same shell as the one that doesn't work

@bpasero
Copy link
Member

bpasero commented Dec 1, 2015

Hm good point... 🍰

@ace007
Copy link
Author

ace007 commented Dec 1, 2015

Also it will run if I log onto the console of the vm (when it's running gnome) and double click on the program from the folder/explorer view. However it wouldn't run from an xterm shell in the same logon enviroment

@bpasero bpasero modified the milestones: Backlog, Dec 2015 Dec 2, 2015
@bpasero
Copy link
Member

bpasero commented Dec 22, 2015

Does this still happen with latest?

@ace007
Copy link
Author

ace007 commented Dec 22, 2015

Just downloaded an run the latest zip file
ls -la /usr2/VSCode-linux-x64/Code
-rwxr-xr-x 1 59217872 Dec 17 16:23 /usr2/VSCode-linux-x64/Code

I get the following error

/usr2/VSCode-linux-x64/Code
TypeError: Bad argument
at TypeError (native)
at ChildProcess.spawn (internal/child_process.js:274:26)
at Object.exports.spawn (child_process.js:351:9)
at /usr2/VSCode-linux-x64/resources/app/out/vs/workbench/electron-main/main.js:6:25084
at new __dirname.undefined.t.Class.derive._oncancel (/usr2/VSCode-linux-x64/resources/app/out/vs/workbench/electron-main/main.js:5:2734)
at Object.i as getUserEnvironment
at Object. (/usr2/VSCode-linux-x64/resources/app/out/vs/workbench/electron-main/main.js:9:3090)
at e._invokeFactory (/usr2/VSCode-linux-x64/resources/app/out/vs/loader.js:4:13773)
at e._complete (/usr2/VSCode-linux-x64/resources/app/out/vs/loader.js:4:14012)
at e.resolveDependency (/usr2/VSCode-linux-x64/resources/app/out/vs/loader.js:4:15066)

@bpasero
Copy link
Member

bpasero commented Dec 22, 2015

That sounds like an issue in getting the user environment. @joaomoreno fyi

@bpasero bpasero added the important Issue identified as high-priority label Dec 22, 2015
@bpasero bpasero assigned joaomoreno and unassigned bpasero Dec 22, 2015
@bpasero bpasero modified the milestones: Jan 2016, Backlog Dec 22, 2015
@bpasero bpasero removed the help wanted Issues identified as good community contribution opportunities label Dec 22, 2015
@bpasero bpasero removed the info-needed Issue requires more information from poster label Dec 22, 2015
@ace007
Copy link
Author

ace007 commented Dec 22, 2015

Is there any extra debug information I can get/provide ?
It works fine when I use sudo to run it

@joaomoreno
Copy link
Member

What do you get with echo $SHELL?

@ace007
Copy link
Author

ace007 commented Jan 4, 2016

That's the problem
I am using ksh but SHELL=/bin/sh
If I set SHELL=/bin/ksh it all works fine.

I am trying to find out why xterm is setting SHELL to the wrong value

@ace007
Copy link
Author

ace007 commented Jan 4, 2016

It turns out that the xterm on the machine (3.19.0-15-generic #15-Ubuntu) is not setting SHELL to my actual shell (/bin/ksh) but defaulting to /bin/sh.
I have fixed this in a script and I now get an xterm with the correct SHELL variable ($SHELL=/bin/ksh)
This now allows Code to run correctly :D

@ace007 ace007 closed this as completed Jan 4, 2016
@joaomoreno
Copy link
Member

What do you get with /bin/sh --version?

@ace007
Copy link
Author

ace007 commented Jan 4, 2016

/bin/sh --version
/bin/sh: 0: Illegal option --
/bin/ksh --version
version sh (AT&T Research) 93u+ 2012-08-01

@joaomoreno
Copy link
Member

Maybe /bin/sh -v?

@ace007
Copy link
Author

ace007 commented Jan 4, 2016

No that gives the same error
I tried this
strings /bin/sh | grep -i ver
preverrout
verbose
%s: not completely converted
.gnu.version
.gnu.version_r
and this
strings /bin/sh | grep -i [0-9].[0-9]
/lib64/ld-linux-x86-64.so.2
GLIBC_2.3
GLIBC_2.11
GLIBC_2.3.4
GLIBC_2.14
GLIBC_2.4
GLIBC_2.2.5
5_5!
t2D9
*0123456789

Best I can get is this
ls -la /bin/sh
lrwxrwxrwx 1 root root 4 Nov 6 15:21 /bin/sh -> dash
ls -la /bin/dash
-rwxr-xr-x 1 root root 121272 Feb 19 2014 /bin/dash

@joaomoreno
Copy link
Member

OK that helps: you seem to be running dash. Leaving it closed as I don't think many people will hit this.

@bpasero bpasero assigned jrieken and unassigned joaomoreno Jan 29, 2016
@jrieken jrieken added the verified Verification succeeded label Jan 29, 2016
@hashhar
Copy link
Contributor

hashhar commented Feb 21, 2016

@ace007 Seems like I ran into the same issue #3131 . I had some troubleshooting ideas but couldn't find somebody who had faced this before.

Could you try running

echo $SHELL
sudo chsh
# Set it to /bin/sh
sudo reboot

Try running Code again.
AND,

echo $SHELL
sudo chsh
# Set it to /bin/bash
sudo reboot

Try running Code again.

I want to isolate if the reason is /bin/sh or /bin/bash.

@ace007
Copy link
Author

ace007 commented Feb 22, 2016

Hi,
I am running Code (version 0.10.5) via a ssh spawned xterm with /bin/ksh.
My problem was that xterm (on my version of ubunto) was not setting SHELL to the correct value.
It was defaulting to /bin/sh, which was a sym link to /bin/dash.
I modified my profile script and forced SHELL to be my login shell and all was fine.
I suspect that the problem is with /bin/sh (which is actually /bin/dash)

@hashhar
Copy link
Contributor

hashhar commented Feb 22, 2016

I have the exact opposite. My login shell is bash, but it works with SHELL set to any other shell but bash.
I also wrote a script that changed my SHELL when calling code.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants