Closed ne0h closed 7 years ago
Maximillian - I am investigating. In the mean time, you can bypass the CLI and [launch the server] (https://eclipse-che.readme.io/docs/usage-docker-server) with this Docker syntax. And you can override the ports more directly with that.
Confirmed the issue with che-launcher. There is an adaptaptation regression that is causing some sort of variable passing error.
@ne0h - found the issue and got a fix in. This will show up in our nightly's shortly.
https://github.com/eclipse/che-dockerfiles/pull/50#pullrequestreview-10216972
@ne0h - CI systems updated and this issue should no longer be active.
@TylerJewell - Thanks a lot for your work!
Are sure that the bug is fixed? I am getting the same error even with CHE_VERSION=nightly
.
I tried docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -e CHE_PORT=9080 -e CHE_VERSION=nightly eclipse/che:nightly start
and CHE_PORT=9080 CHE_VERSION=nightly che start
.
lsof -i :9080
shows that there is "something" running on 9080
:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 10626 root 4u IPv6 10978498 0t0 TCP *:9080 (LISTEN)
But there is still nothing to access on http://localhost:9080
. Same on Archlinux and Ubuntu.
Yes the issue is fixed. It is fixed in a utility so please set CHE_UTILITY_VERSION to nightly first.
So it works for you?
I am still getting the same error with CHE_PORT=9080 CHE_UTILITY_VERSION=nightly che start
.
No difference if passing the environment variables directly or using export
.
Yes, it is working for me. Chances are your old images are cached. This happens a lot when using the "nightly" images. You should start by doing docker rmi -f $(docker images -q)
to remove all of the images on your system and then try again.
Ah your absolutely right - works like a charm now. Thanks a lot for your patience and fast responses!
Hello, trying to change the default port and reaching this thread.
I run this:
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v ~/data/che:/data -e CHE_HOST=${HOST} -e CHE_PORT=${PORT} -e CHE_UTILITY_VERSION=nightly -e CHE_VERSION=nightly eclipse/che:nightly start
(The environment variables for port and host are correctly set.)
And I get:
INFO: (che cli): Pulling image alpine:3.4 INFO: (che cli): Pulling image eclipse/che-ip:nightly INFO: (che cli): Loading cli... ERROR: ERROR: Your CLI version 'eclipse/che:nightly' does not match your installed version '5.0.0'. ERROR: ERROR: The 'nightly' CLI is only compatible with 'nightly' installed versions. ERROR: You may not 'che upgrade' from 'nightly' to a numbered (tagged) version. ERROR: ERROR: Run the CLI as 'eclipse/che:<version>' to install a tagged version.
And yes, I removed first all docker images.
So, what am I missing?
Thanks.
It looks like the files that you have in ~/data/che
were originally installed with the 5.0.0 version of Che. It means that you ran docker run eclipse/che
.
The nightly
version is not compatible with non-nightly versions. So if you try to use eclipse/che:nightly
as the version, we check the installation folder and if it is also not a nightly then we fail. We do this because the nightly is essnetially like a development channel, and it changes frequently with no guarantee of underlying data integrity.
You either need to run the nightly in a new folder, or to destroy the installation you have first before running again.
# Destroy an installation
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock
-v ~/data/che:/data eclipse/che:nightly destroy
# Create new installation and start with a port
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock
-v ~/data/che:/data -e CHE_HOST=${HOST} -e CHE_PORT=${PORT}
eclipse/che:nightly start
Note the CHE_VERSION and CHE_UTILITY_VERSION no longer apply with this new CLI. You can just run "docker run eclipse/che" to get help. We have greatly simplified the CLI.
I still have this problem, looking through the cli log, the server isn't started directly but through docker-compose using a generated yml file. This yml still uses the wrong port (8080): https://github.com/eclipse/che/blob/master/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb
The YML is set to the CHE_HOST port. It maps the external port of the container to the internal port, 8080. We do not yet have logic that simplifies changing the intenral port of the Tomcat in the container, but why should that matter? The container's exposed port is changed.
I just tested this with nightly on windows 10 and it was ok.
Well tomcat seems to always listen on the CHE_PORT
for me so mapping to the internal port 8080 isn't working
part of docker logs che
:
2017-01-12 16:47:30,146[main] [INFO ] [o.a.c.s.VersionLoggerListener 115] - Command line argument: -Dport.http=8181
https://github.com/eclipse/che/blob/master/dockerfiles/che/entrypoint.sh#L155
Humm - can you share Che version you ran for this, too - was it nightly? Thx.
It was nightly, yes. And eclipse/che
, not eclipse/che-cli
if this matters
Ok - thanks for the report - will do a proper investigation this weekend.
Thanks TylerJewell
Well, I have uncovered the root cause.
When you run the CLI with -e CHE_PORT=<num>
, we purposely do not include CHE_PORT into the che.env
. As a result, CHE_PORT
should not be passed from the CLI into the eclipse/che-server
container as an environment variable (we pass the entire che.env
file into the new container when it is started). We then make assumptions that CHE_PORT
is not passed into the new container, and therefore it should be hard-coded to 8080 inside of the che-server
container and then your custom port exposed.
However, when starting Che with the latest tagged release and inspecting the container, CHE_PORT
with the custom value is passed in. This, of course, breaks the template, which is just mapping the external custom port to the hard-coded internal port.
This is happening because we are actually passing in two separate che.env
files. There is the user's configured che.env
but there seems to be a secondary /instance/config/che.env
file that we generate internally that is also passed in. This secondary che.env
is set from this template https://github.com/eclipse/che/blob/master/dockerfiles/init/modules/che/templates/che.env.erb
and it has CHE_PORT
included within it. So while I assumed CHE_PORT
was never passed in, looks like @benoitf updated the configuration to make sure it's always passed in.
So the solution is to either revert CHE_PORT
out of the secondary puppet template. Or to update the docker-compose
template to do an internal mapping of the CHE_PORT
.
I also note that in https://github.com/eclipse/che/blob/master/dockerfiles/init/modules/che/templates/che.env.erb
that CHE_PORT
is added twice. There is a function at the top that loopse through all in-memory variables with CHE_*
set and then a hard-coded list of additional CHE_*
variables. So if CHE_PORT
is in memory, then it will always be added to this file, even if we remove the hard-coded variant.
So seems simplest fix will be to update the template to make the internal Che server respect the port parameter.
https://github.com/eclipse/che/pull/3734
To make this work temporarily until this makes it into the nightly stream:
git clone http://github.com/eclipse/che
git checkout CHE-3179
cd dockerfiles/init; bash build.sh
cd dockerfiles/cli; bash build.sh
This should generate a new eclipse/che:nightly
image that has this correction. You can then use a custom port.
Hi, I do not manage to get che running with a non-default port (9080). I tried on Arch Linux and Ubuntu 14.04 LTS. 8080 works but changing the port via
export CHE_PORT=9080
does not work. Error message in the terminal where I start docker:Docker log is attached here: https://gist.github.com/ne0h/7e07dd868bdb2a8fc42130471be261b0
Reproduction Steps:
export CHE_PORT=9080
che start
Expected behavior:
Everything is fine.
Observed behavior:
Che "does not come up".
Che version: 5.0.0-latest
OS and version:Ubuntu 14.04 LTS, Arch Linux
Docker version: 1.12.3, build 6b644ec Che install: Docker container
Additional information:
Thanks in advance! Max