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

On Mac, Running che command throws error /usr/local/bin/che: line 165: init_global_variables: command not found #2890

Closed
virtualit786 opened this issue Oct 26, 2016 · 12 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@virtualit786
Copy link

virtualit786 commented Oct 26, 2016

Running che command fires the error

/usr/local/bin/che: line 165: init_global_variables: command not found

Reproduction Steps:

  1. Followed step 0. Pre-Reqs https://eclipse-che.readme.io/v5.0/docs/che-getting-started
  2. Followed step 1. Get the Eclipse Che CLI
  3. Followed step 2. Start Che . Stuck after che start command as it produced the error

Expected behavior:
Che should have been started

Observed behavior:

Everytime any che command is fired, it throws error
/usr/local/bin/che: line 165: init_global_variables: command not found

Che version: Cannot obtain che version as even firing che version throws the error.
OS and version: System Version: macOS 10.12 (16A323)
Kernel Version: Darwin 16.0.0
Boot Volume: OSX
Boot Mode: Normal

Docker version:
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.7.1
Git commit: 6f9534c
Built: Thu Sep 8 10:31:18 2016
OS/Arch: darwin/amd64

Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: linux/amd64
Che install: I followed the guide and installed docker first.

Additional information:

  • Problem started happening recently, didn't happen in an older version of Che: I am not sure as its the first time I have installed che.
  • Problem can be reliably reproduced, doesn't happen randomly: Yes. I have tried removing all and reinstall but with same result.
@TylerJewell
Copy link

So the Che script is a self-updating script. It connects to GitHub to download a "cli.sh" which actually has the commands, including the init_ command that is not found. This file is saved to ~/.che/cli. Can you check to see if any file is there? If it's not there, do you have access to github from where you ran the script?

There are ways to work around this limitation, if it is still happening.

@TylerJewell TylerJewell added the kind/question Questions that haven't been identified as being feature requests or bugs. label Oct 26, 2016
@virtualit786
Copy link
Author

@TylerJewell Thanks for looking into it. Yes cli-latest.sh file is at your mentioned location.

@TylerJewell
Copy link

Well that is interesting - that file should be automatically loaded.

If you go into that file cli-latest.sh, what is its date, and is there an init_global_variables function at the top?

@virtualit786
Copy link
Author

virtualit786 commented Oct 26, 2016

File has no contents. Zero bytes.
After setting the ~./bash_profile stuff thats mentioned in the guide, I am doing the followings and getting this error.

  1. curl -sL https://raw.githubusercontent.com/eclipse/che/master/che.sh > /usr/local/bin/che
  2. chmod +x /usr/local/bin/che
  3. che start
    Plus everytime I open terminal, now its asking for root password as well.

@TylerJewell
Copy link

Inside the che.sh - it is downloading the CLI using curl. You can go to the master branch of the che repo, and download the cli.sh and save it as cli-latest.sh in that directory. If you do that it should run. But the issue is that something is preventing us from downloading the file using curl.

@virtualit786
Copy link
Author

Ok so I did what you suggesting and ran the script after and tried this few times and everytime getting error:-

Segmentation fault: 11

@TylerJewell
Copy link

One last test please and if this fails I may need access to your box to test. Can you try sudo before downloading the initial script and when running it?

@virtualit786
Copy link
Author

@TylerJewell You mean to try this

sudo curl -sL https://raw.githubusercontent.com/eclipse/che/master/che.sh > /usr/local/bin/che

@virtualit786
Copy link
Author

I did that and then removed it just to check again. And then as per guide, i fired
curl -sL https://raw.githubusercontent.com/eclipse/che/master/che.sh > /usr/local/bin/che

Now its downloading the script to /usr/local/bin/che and then firing following changes its rights to execute

chmod +x /usr/local/bin/che

And now its started to download.

I am not sure what changed here.

@TylerJewell
Copy link

Yeah, you go it. I wanted to know if you did sudo when you saved the first file if it would solve the problems. It sounds like that is the solution. I have to think about why this happened some more.

@virtualit786
Copy link
Author

Yeah, its strange. If I was using Windows, I would simply blame Microsoft :) Thanks man for the help !

@TylerJewell
Copy link

Enjoy!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

2 participants