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 mount volume to workspace - CHE-WORKSPACE-VOLUME #3738

Closed
oldirtybasti opened this issue Jan 15, 2017 · 21 comments
Closed

Unable to mount volume to workspace - CHE-WORKSPACE-VOLUME #3738

oldirtybasti opened this issue Jan 15, 2017 · 21 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@oldirtybasti
Copy link

More a question than an issue. I tried different ways to mount a volume to my workspaces, but all failed (with 5.0 and the nightly builds).

I run the following command:

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -e CHE-WORKSPACE-VOLUME=/Users:/Users -e CHE_PORT=10083 -e CHE_DATA=/path/to/data eclipse/che-launcher:nightly start

But with all variations I used, the Users folder never gets mounted into the workspaces. What do I do wrong or is this a bug?

@ghost ghost added the kind/question Questions that haven't been identified as being feature requests or bugs. label Jan 15, 2017
@ghost
Copy link

ghost commented Jan 15, 2017

If you want a local dir to be mounted to all workspaces that Che server starts, you need to add volume bindings to the below property in che.env file:

CHE_WORKSPACE_VOLUME=

Although env variable should have worked as well. I can see that host path is /Users. Shouldn't it be your win path smth like /c/Users/User/directory?

Also, the syntax you have used is outdated. Can you try the following?

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -v /c/Users/User/che:/data -e CHE-WORKSPACE-VOLUME=/Users:/Users -e CHE_PORT=10083 eclipse/che-cli:nightly start

Replace /c/Users/User/che with a real Win path where you want to store Che data and conf. Use format with Unix like slashes.

@oldirtybasti
Copy link
Author

oldirtybasti commented Jan 15, 2017

it does not work yet, unfortunately.

I ran the following commands:

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -v /Users/odb/myfiles/Projekte/Install/EclipseChe/data:/data -e CHE-WORKSPACE-VOLUME=/Users:/Users -e CHE_PORT=10083 eclipse/che-cli:nightly start

the che-cli initialises some files in the data folder on the host. I then edited the che.env and uncommented the change the line with the workspace volume to (I am on Linux):
CHE_WORKSPACE_VOLUME=/Users:/Users:ro,Z;

Afterwards I started Che using the following command:
docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -e CHE_PORT=10083 -e CHE_DATA=/Users/odb/myfiles/Projekte/Install/EclipseChe/data eclipse/che-launcher:nightly start
P.S: If I volume mount the data folder via -v then Che does not find the workspace data location, if I use the CHE-DATA=... Che at least works, but the CHE-WORKSPACE_VOLUME does not get mounted.

Could you walk me through it? I really appreciate your kind help. I was a little bit puzzled that the cli creates files that the launcher does not create by itself. I thought the launcher was the container the user can run so that everything gets bootstrapped and runs fine.

@TylerJewell
Copy link

@oldirtybasti - Eugene was implying a different CLI.

Last wek we released Che 5 - and with that we have deprecated (removed) support for eclipse/che-launcher. It had a syntax that was very temperamental.

There is a new - much simpler syntax now that you can see with docker run eclipse/che. It is documented here: https://www.eclipse.org/che/docs/setup/getting-started/index.html.

# Create a Che intsallation
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock /Users/odb/myfiles/Projectke/Install/EclipseChe/data:/data eclipse/che init

# This creates an installation into the folder you mounted to :/data
# There is a che.env file here - you can edit
# CHE_WORKSAPCE_VOLUME is in here - just uncomment any value in here and restart Che

# You then start Che with:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock /Users/odb/myfiles/Projectke/Install/EclipseChe/data:/data -e CHE_PORT=10083 eclipse/che start

@oldirtybasti
Copy link
Author

oldirtybasti commented Jan 16, 2017

if I set everything up as you have written and run the last line
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /Users/odb/myfiles/Projekte/Install/EclipseChe/data:/data -e CHE_PORT=10083 eclipse/che start
then everything gets downloaded and after I receive the last line:
INFO: (che start): Starting containers...
nothing happens - docker ps will not show any started containers. Same if I use the nightly tag.

@TylerJewell
Copy link

What is at the end of the cli.log file?

@oldirtybasti
Copy link
Author

Wait, I could repair it myself. The name Che was still in use (container not removed). After I removed it, I could start eclipse che. I will report back, after testing the Volume workspace mount

@oldirtybasti
Copy link
Author

If I use the :latest image, then the volume will not get mounted. If I use :nightly the container will not start (keeps starting all the time but never ends).

@TylerJewell
Copy link

Again, please post the tail of the cli.log for engineers to help investigate.

@oldirtybasti
Copy link
Author

oldirtybasti commented Jan 16, 2017

the cli.log and the che.env
che.env.txt
cli.log.txt

attached.

There's a NullPointerException at the command line:
...
2017-01-16 14:14:09,635[ted-scheduler-1] [INFO ] [ockerAbandonedResourcesCleaner 123] - List containers registered in the api: []
2017-01-16 14:14:09,653[ted-scheduler-1] [ERROR] [o.e.c.c.s.e.LoggedRunnable 64] - null
java.lang.NullPointerException: null
at org.eclipse.che.plugin.docker.machine.cleaner.DockerAbandonedResourcesCleaner.cleanNetworks(DockerAbandonedResourcesCleaner.java:164) ~[che-plugin-docker-machine-5.1.0-SNAPSHOT.jar:5.1.0-SNAPSHOT]
at org.eclipse.che.plugin.docker.machine.cleaner.DockerAbandonedResourcesCleaner.run(DockerAbandonedResourcesCleaner.java:91) ~[che-plugin-docker-machine-5.1.0-SNAPSHOT.jar:5.1.0-SNAPSHOT]
at org.eclipse.che.commons.schedule.executor.LoggedRunnable.run(LoggedRunnable.java:43) ~[che-core-commons-schedule-5.1.0-SNAPSHOT.jar:5.1.0-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_111]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_111]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_111]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
2017-01-16 14:14:09,966[ost-startStop-1] [INFO ] [o.a.c.startup.HostConfig 975] - Deployment of web application archive /home/user/eclipse-che-5.1.0-SNAPSHOT/tomcat/webapps/wsmaster.war has finished in 13,009 ms
...

@TylerJewell
Copy link

I am sorry @oldirtybasti - I am not able to follow your requests here. You said that Che did not start "(keeps starting all the time but never ends). But the cli.log file that you posted shows a perfect startup.

I am not sure what I am trying to help you debug here. The information provided is not letting me have insights to the problems you are having or try to reproduce it. We'll need you to be more explicit please.

@oldirtybasti
Copy link
Author

Sorry about the confusion. Che starts fine, a workspace can be create (and started), but when I switch to the Recent Workspaces and select the workspace, nothing will be shown.

@TylerJewell
Copy link

What are the workspace output logs and any browser console error messages?

@oldirtybasti
Copy link
Author

It seems to be a problem with the current nightly version of Che. The "Recent Workspaces" view just hangs, independent of whether I use CHE_WORKSPACE_VOLUME in che.env or not. I do not receive any error messages.

I will wait for a newer nightly build and report back if the issue persists.

Thank you for your very patient help!

@TylerJewell
Copy link

Oh, yes - you did say nightly. We are having issues with it. There was a major refactorig of internal networking issues that was done and merged right after 5.0.0 was merged. It has caused some problems.

If you set your version to 5.0.0 and rerun do you have the same issues? ie, "eclipse/che:5.0.0"

@oldirtybasti
Copy link
Author

Version 5.0.0 unfortunately does not even start.

Here is what I ran:

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /Users/odb/myfiles/Projekte/Install/EclipseChe/data:/data eclipse/che:5.0.0 init

then

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v /Users/odb/myfiles/Projekte/Install/EclipseChe/data:/data -e CHE_PORT=10083 eclipse/che:5.0.0 start

I did not even edit che.env. Find the docker log of Che attached (there is a NullPointerException).
log.txt

@TylerJewell
Copy link

@oldirtybasti - I keep wanting to calling you ODB with that name.

I think the issue you have with the NullPointerException is because we are mixing and matching versions all on a single system. We say in the docs that that nightly version is really not intended to mix and match with another version.

So lets get a super clean start. Make sure you delete any of your :/data folders from your disk - wipe them and start clean.

Also remove all of your existing docker images on that machine. docker rmi -f $(docker images -q). This will make sure that none of the shenanigans that we have been doing with swapping versions or images are in the way.

And then restart Che from scratch. Thanks.

@oldirtybasti
Copy link
Author

Calling me ODB is absolutely ok, this great musician did inspire my nick name some 20 years ago. Good to know, that anybody knows him too so long ago ;).

Anyway, I did the total cleaning, but the error is the same. NullPointerException in the o.e.c.c.s.e.LoggedRunnable.

Btw the error does not occur, if I remove -e CHE_PORT=10083. Unfortunately I can not use port 8080 on a regular basis, because some other services use that on my server from time to time. So far, it seems to be a bug with the -e CHE_PORT implementation?

@TylerJewell
Copy link

Oh - shit, there was a port bug fixed over the weekend. So the fix is only in nightly right now for that. That explains it.

So, please do your test with the eclipse/che:5.0.0 version of Che, and do not use CHE_PORT on that version. Let's test with that to see if any other errors remain.

@oldirtybasti
Copy link
Author

The volume mount works now on Port 8080! What a strange journey to arrive there, I think you can close the issue.

Do I have to wait for 5.1 to change the port then? A little question more: What does ro,Z mean in
CHE_WORKSPACE_VOLUME=/Users:/Users:ro,Z;?
Do I have to put something other there if I want to make it writable?

@TylerJewell
Copy link

Sorry about the round about nature of it all. We would have gotten there quicker if we had started with the modern installation approach for 5.

Yes, it will be best for you to wait for 5.1 to get the CHE_PORT fixes. Or you can probably wait another 24 hours, clear out all of your docker images again, and use the nightly. The nightly has had a few bug fixes added into it, but there were some issues with Mac and Windows with the nightly. We consider nightly a dev channel, so it will be unstable from time to time.

5.1 should be released on Tuesday or Wednesday.

The :ro,Z are file system modifiers that apply for selinux. They mean read only and a certain security flag. Not all linux file systems respect those parameters, but those with selinux do. We provide those extra parameters in the example to show users that they work and have been tested.

On most linux operating systems, you should not have to add these modifiers.

@oldirtybasti
Copy link
Author

Thank you very much for all the work you put into my sometimes really stupid questions!

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