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

"Could not find Che's application server." when trying to start it #335

Closed
SamHasler opened this issue Feb 15, 2016 · 8 comments
Closed

Comments

@SamHasler
Copy link

Description of problem: che run "Could not find Che's application server"
Che version: Nightly downloaded at 15 February 2016 11:15 UTC
Che install directory: C:\Apps\dev\eclipse-che-4.0.0-RC4-SNAPSHOT
Docker version: Docker version 1.9.1, build a34a1d5
Java version:
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
Environment details (AWS, VirtualBox, physical, etc.): local machine
How reproducible: every time
Steps to Reproduce:

  1. start git bash
  2. cd /C/Apps/dev/eclipse-che-4.0.0-RC4-SNAPSHOT/bin
  3. ./che.sh -d run
    Actual Results:

./che.sh -d run
USE_DOCKER: false
CHE_DOCKER_TAG: latest
CHE_PORT: 8080
CHE_IP: ""
CHE_DOCKER_MACHINE: default
LAUNCH_REGISTRY: false
SKIP_PRINT_CLIENT: false
SKIP_DOCKER_UID: false
SKIP_JAVA_VERSION: false
STOP_CONTAINER:
USE_HELP: false
CHE_SERVER_ACTION: run
USE_DEBUG: true

On Windows, Che projects can only reside in %userprofile% due
to limitations of Docker. On this computer, %userprofile% is
C:\Users\haslers

Docker machine named default already exists...
Setting environment variables for machine default...
Docker is configured to use vbox docker-machine named default with IP 192.168.59.100...

######## HOW TO CONNECT YOUR CHE CLIENT

After Che server has booted, you can connect your clients by:

  1. Open browser to http://localhost:8080, or:
  2. Open native chromium app.

!!!
!!! Could not find Che's application server.
!!!

Looks like something went wrong. Possible issues:

  1. (Win | Mac) VirtualBox not installed ==> Rerun Docker Toolbox installation
  2. (Win | Mac) Docker Machine not installed ==> Rerun Docker Toolbox installation
  3. (Win | Mac) Docker is not reachable ==> Docker VM failed to start
  4. (Win | Mac) Docker ok, but docker ps fails ==> Docker environment variables not set properly
  5. (Linux) Docker is not reachable ==> Install: wget -qO- https://get.docker.com/ | sh
  6. (Linux) Permissions not properly set ==> Che must run as UID 1000 with user in docker group
  7. Could not find the Che app server ==> Did /tomcat get moved away from CHE_HOME?
  8. Wrong version of Java found ==> Che requires Java 1.8
  9. Did you use the right parameter syntax? ==> See usage

We have seen issues with VirtualBox on Windows where your VM gets corrupted when your computer is
suspended while the VM is still running. This will appear as SSH or ethernet connection issues. This is
rare, but if encountered, current known solution is to uninstall VirtualBox and Docker Toolbox, and then
reinstall.

Che Environment Variables:
(REQUIRED) JAVA_HOME ==> Location of Java runtime
(REQUIRED: WIN|MAC) DOCKER_TOOLBOX_INSTALL_PATH ==> Location of Docker Toolbox
(REQUIRED: WIN|MAC) VBOX_MSI_INSTALL_PATH ==> Location of VirtualBox
(OPTIONAL) CHE_HOME ==> Directory where Che is installed
(OPTIONAL) CHE_LOCAL_CONF_DIR ==> Directory with custom Che .properties files
(OPTIONAL) CHE_LOGS_DIR ==> Directory for Che output logs
(OPTIONAL) CHE_DOCKER_MACHINE_NAME ==> (Win | Mac) Name of VM created by docker-machine
(OPTIONAL) CHE_CONTAINER_NAME ==> Name to apply to Docker container if using -i option
(OPTIONAL) DOCKER_MACHINE_HOST ==> (Linux) Docker host IP - set if browser clients remote

Usage:
che [OPTIONS] [run | start | stop]
-i, --image Launches Che within a Docker container using latest image
-i:tag, --image:tag Launches Che within a Docker container using specific image tag
-c:name, --container:name Sets the container name if -i provided; default=che
-p:port, --port:port Port that Che server will use for HTTP requests; default=8080
-r:ip, --remote:ip If Che clients are not localhost, set to IP address of Che server
-g, --registry Launch Docker registry as a container (used for ws snapshots)
-m:name, --machine:name For Win & Mac, sets the docker-machine VM name; default=default
-s:client, --skip:client Do not print browser client connection information
-s:java, --skip:java Do not enforce Java version checks
-s:uid, --skip:uid Do not enforce UID=1000 for Docker
-t, --stop-container If stopping Che, will also stop Che container if Che ran with -i
-h, --help Show this help
-d, --debug Use debug mode (prints command line options + app server debug)
run Starts Che application server in current console
start Starts Che application server in new console
stop Stops Che application server

The -r flag sets the DOCKER_MACHINE_HOST system environment variable. Set this to the IP address of the node
that is running your Docker daemon. Only necessary to set this if on Linux and your browser clients are not
localhost, ie they are remote. This property automatically set for Che on Windows and Mac.

Expected Results:

It would start the CHE application server instead of trying to find it

@ghost
Copy link

ghost commented Feb 15, 2016

Please, give it a try with che.bat. Running sh script from bath this way isn't how Che is supposed to be launched. Che.bat does some job on Windows paths

@SamHasler
Copy link
Author

I looked at che.bat and saw it was a wrapper around che.sh, so assumed it would work from che.sh. I missed the windows long directory to dos 8.3 format fix that sets CHE_WINDOWS_SHORT_DIR. Perhaps che.sh could test if it's running on windows (what's the best way to test that?) and then set CHE_WINDOWS_SHORT_DIR?

I have Che running with che.bat so feel free to close this if you wish.

Edit. and thank you for the explanation.

@TylerJewell
Copy link

The Che.sh does know that it is running on Windows. However there is no utility in bash that lets the conversion to short directory names. We can only do that in batch unfortunately.

@SamHasler
Copy link
Author

git-for-windows includes cygpath. So if cygpath is available che.sh could do cygpath -u $(cygpath -w --short-name "$(pwd)")

@SamHasler
Copy link
Author

or you can do:

CHE_WINDOWS_SHORT_DIR=`(cmd //C 'FOR %i in (%CD%) do @echo %~Si')`

@TylerJewell
Copy link

That is tops!! We will open an issue and test both of those configurations. I guess sometimes we just need a different pair of eyes. We want to convert JAVA_HOME to this format as well, as we are suspicious that it is causing problems on older versions of windows, too.

@TylerJewell
Copy link

Had to modify the command just a bit. This is what we landed with. This will grab the right directory regardless of which current directory you launch the script from.

export CHE_HOME=`(cmd //C 'FOR %i in (%~dp0\..\..) do @echo %~Si')`

@TylerJewell
Copy link

@SamHasler Here is the pull request for this improvement.
#347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants