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

Run on docker for windows #1695

Closed
mariotoffia opened this issue Jul 8, 2016 · 10 comments
Closed

Run on docker for windows #1695

mariotoffia opened this issue Jul 8, 2016 · 10 comments

Comments

@mariotoffia
Copy link

Hi, I've modified che.sh so it do not use docker-machine on windows. I'm using docker for windows and thus only "pure" client docker access is needed.

When I create a workspace and hit start: It will throw an exception since it cannot find the certificates (see stack trace).

Is it possible to get it to run under docker for windows?

Cheers,
Mario

Reproduction Steps:

  1. Modify che.sh to not use docker-machine
  2. Run by bin/che.sh
  3. Create workspace + "Start"

Expected behavior:

Create a new instance of a docker container containing the project (in my case plain Java project).

Observed behavior:

Complaints about missing certificate for docker https daemon communication ("Certificates are required for https connection.") and throws a stack trace in catalina.out.

Che version: 4.4.0
OS and version: Windows 10
Docker version: Docker for windows RC3 (1.12.0-rc3-beta18) - API Version 1.24
Che install: server (zip)

Additional information:

Stacktrace:
2016-07-08 19:37:17,722[kspaceManager-0] [ERROR] [o.e.c.a.w.s.WorkspaceManager 567] - Certificates are required for https connection.
java.lang.IllegalArgumentException: Certificates are required for https connection.
at org.eclipse.che.plugin.docker.client.connection.TcpConnection.(TcpConnection.java:41) ~[che-plugin-docker-client-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.client.connection.DockerConnectionFactory.openConnection(DockerConnectionFactory.java:52) ~[che-plugin-docker-client-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.client.DockerConnector.pull(DockerConnector.java:1504) ~[che-plugin-docker-client-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.client.DockerConnector.pull(DockerConnector.java:1484) ~[che-plugin-docker-client-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.machine.local.interceptor.EnableOfflineDockerMachineBuildInterceptor.pullImage(EnableOfflineDockerMachineBuildInterceptor.java:73) ~[che-plugin-docker-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.machine.local.interceptor.EnableOfflineDockerMachineBuildInterceptor.invoke(EnableOfflineDockerMachineBuildInterceptor.java:58) ~[che-plugin-docker-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.machine.DockerInstanceProvider.createInstance(DockerInstanceProvider.java:315) ~[che-plugin-docker-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.machine.server.MachineManager.createInstance(MachineManager.java:376) ~[che-core-api-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.machine.server.MachineManager.createMachine(MachineManager.java:337) ~[che-core-api-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.machine.server.MachineManager.createMachineSync(MachineManager.java:165) ~[che-core-api-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.workspace.server.WorkspaceRuntimes.startMachine(WorkspaceRuntimes.java:582) ~[che-core-api-workspace-4.4.0.jar:4.4.0]

@TylerJewell
Copy link

@mariotoffia - when you are on Docker for Windows, there is some additional configuration required. We have an explanation of what is needed on this page dedicated to Docker for Windows:
https://eclipse-che.readme.io/docs/usage-docker-for-windows-beta

@mariotoffia
Copy link
Author

Hi and thanks for prompt answer! Yes - me bad - just read the server topic and thought that docker for windows was just about running che in a docker container

Cheers,
Mario

@mariotoffia
Copy link
Author

@TylerJewell Seems like it still needs the export DOCKER_TOOLBOX_INSTALL_PATH=${PROGRAMFILES}\Docker\Docker\resources\bin in order to work - but then it does (maybe update docs? :)

Cheers,
Mario

@TylerJewell
Copy link

It shouldn't, by nature. But your path does need the docker client included which should happen when docker for Windows is installed.

@mariotoffia
Copy link
Author

@TylerJewell Sorry for bothering you again, but I come to that it will pull the "codenvy/ubuntu_jdk8" image (and ubuntu) it labels the image when im trying to access the project "eclipse-che/workspaceor3rbog4y65fnop0_machine58ct8xu7hmwyr25e_che_default" but it throws exception and cannot start the image (seems like it uses docker machine? - that can't be correct or?).

Cheers,
Mario

This is my exception:
2016-07-09 22:36:59,929[kspaceManager-0] [ERROR] [o.e.c.a.w.s.WorkspaceManager 567] - com.google.gson.JsonIOException: java.net.SocketException: Connection reset
org.eclipse.che.api.machine.server.exception.MachineException: com.google.gson.JsonIOException: java.net.SocketException: Connection reset
at org.eclipse.che.api.machine.server.MachineManager.createInstance(MachineManager.java:413) ~[che-core-api-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.machine.server.MachineManager.createMachine(MachineManager.java:337) ~[che-core-api-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.machine.server.MachineManager.createMachineSync(MachineManager.java:165) ~[che-core-api-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.workspace.server.WorkspaceRuntimes.startMachine(WorkspaceRuntimes.java:582) ~[che-core-api-workspace-4.4.0.jar:4.4.0]
at org.eclipse.che.api.workspace.server.WorkspaceRuntimes.startQueue(WorkspaceRuntimes.java:458) ~[che-core-api-workspace-4.4.0.jar:4.4.0]
Caused by: org.eclipse.che.api.machine.server.exception.MachineException: com.google.gson.JsonIOException: java.net.SocketException: Connection reset
at org.eclipse.che.plugin.docker.machine.DockerInstanceProvider.buildImage(DockerInstanceProvider.java:416) ~[che-plugin-docker-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.machine.local.interceptor.EnableOfflineDockerMachineBuildInterceptor.invoke(EnableOfflineDockerMachineBuildInterceptor.java:64) ~[che-plugin-docker-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.plugin.docker.machine.DockerInstanceProvider.createInstance(DockerInstanceProvider.java:315) ~[che-plugin-docker-machine-4.4.0.jar:4.4.0]
at org.eclipse.che.api.machine.server.MachineManager.createInstance(MachineManager.java:376) ~[che-core-api-machine-4.4.0.jar:4.4.0]
... 10 common frames omitted
Caused by: java.io.IOException: com.google.gson.JsonIOException: java.net.SocketException: Connection reset

@TylerJewell
Copy link

Can you paste the full syntax of your run command and then the url you used to access the system?

@mariotoffia
Copy link
Author

@TylerJewell Absolutely.
Here's where I've extracted the zip file: /c/progs/bin/eclipse/che-4.4.0/bin
(I've shared from root in C drive (i.e. C:) so I can mount anywhere on my C drive)

Added two lines of export for DOCKER_HOST / TOOLBOX after 'trap exit SIGHUP SIGINT SIGTERM' line in che.sh:
"export DOCKER_HOST=tcp://10.0.75.2:2375
export DOCKER_TOOLBOX_INSTALL_PATH=${PROGRAMFILES}\Docker\Docker\resources\bin"

Run: ./che.sh run
IE Edge: http://localhost:8080 (dashboard)
Click on my testws in (recent workspaces): http://localhost:8080/dashboard/#/ide/testws

..and the socket reset error occurs.

Shall I increase logging verbosity?

Cheers,
Mario :)

@TylerJewell
Copy link

Please, do not modify the che.sh script. You are causing unintended consequences. Make sure you do everything outside of the script and follow the sequence on the docs very carefully. Do you get the same issue when you create a new workspace, or just when you choose a recent workspace?

@mariotoffia
Copy link
Author

Yes, I get the same - It seems to work one of 10-20 or so. I have set of steps where I mostly fails but sometimes it succeeds.

  1. Clean unzip of che-4.4.0 into c:\progs\bin\eclipse\che-4.4.0
  2. cd c:\progs\bin\eclipse\che-4.4.0
  3. set DOCKER_HOST=tcp://10.0.75.2:2375
  4. che run

Output:
"!!!
!!! Could not find Docker client. Expected at Windows: %DOCKER_TOOLBOX_INSTALL_PATH%\docker.exe, Mac: /usr/local/bin/docker, Linux: /usr/bin/docker.
!!!"

  1. set DOCKER_TOOLBOX_INSTALL_PATH=%PROGRAMFILES%\Docker\Docker\resources\bin
  2. che run
  3. create workspace: Java Stack - OK
  4. Select testws (in All Workspaces(1) page) -> Open in IDE

Output:
"org.eclipse.che.api.machine.server.exception.MachineException: com.google.gson.JsonIOException: java.net.SocketException: Connection reset"

  1. Waited a while
  2. Clicked Open in IDE and the workspace booted OK
  3. Stopped / starte che again
  4. Did the same steps as 7 - 8 several times

Output:
"org.eclipse.che.api.machine.server.exception.MachineException: com.google.gson.JsonIOException: java.net.SocketException: Connection reset"

  1. Never got it to boot again
  2. Stopped / started che again
  3. Clicked on recent -> testws - same failure
  4. Clicked on workspaces(1) -> Start in IDE and it successfully booted

Ha've no specific pattern that I've spotted - It seems to do the docker build (tagging the image) and then fail but two of around 15 - 20 times did work.

Cheers,
Mario

@TylerJewell
Copy link

@mariotoffia - what happens if you just run the follwoing. Note the two places where you should choose a local directory and replace our stuff:

docker run --rm=true --net=host --name=che
 -v /home/user/che/lib:/home/user/che/lib-copy
 -v /c/<pick-a-dir>/workspaces:/home/user/che/workspaces
 -v /c/<pick-a-dir>/storage:/home/user/che/storage
 -e "DOCKER_HOST=tcp://10.0.75.2:2375"
 codenvy/che:nightly --remote:10.0.75.2

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