che icon indicating copy to clipboard operation
che copied to clipboard

Unable to create workspaces

Open robhardt opened this issue 10 years ago • 45 comments

free-standing local installation, OSX El Capitan, eclipse-che-4.0.0-RC1-SNAPSHOT, java 1.8.0_65-b17

  1. ./bin/che.sh
  2. pont browser to localhost:8080
  3. new workspace, using recipe, ready-to-go-stack, java, 1G, click 'create'
  4. creates successfully.
  5. 'run in IDE'
  6. it gets to step 3, and get the error message: [STDERR] unzip: cannot find or open /mnt/che/ws-agent.zip, /mnt/che/ws-agent.zip.zip or /mnt/che/ws-agent.zip.ZIP. (see screenshot).
  7. eventually get a 'workspace agent not responding' error.

Thanks for the help!

screen shot 2016-01-29 at 1 28 21 am

robhardt avatar Jan 29 '16 07:01 robhardt

Please specify your VM OS, VM OS version, docker version. If VM OS is RHEL, CentOS, Fedora check if SeLinux is enabled (output of sestatus tool).

garagatyi avatar Jan 29 '16 08:01 garagatyi

Can you please run ls in /eclipse-che-4.0.0-RC1-SNAPSHOT/lib

There should be ws-agent.zip and terminal there.

ghost avatar Jan 29 '16 09:01 ghost

whaaa, I ran into this too.

This is off of the codenvy/che:latest docker image

Here is the output of /mnt/che inside the (failed) workspace.. note that both 'files' are there, but they are directories!?

user@0f652b786c7c:/opt$ ls -lah /mnt/che/
total 16K
drwxr-xr-x 4 root root 4.0K Jan 29 21:38 .
drwxr-xr-x 3 root root 4.0K Jan 29 21:38 ..
drwxr-xr-x 2 root root 4.0K Jan 29 21:38 terminal
drwxr-xr-x 2 root root 4.0K Jan 29 21:38 ws-agent.zip

and on che, the agent and terminal seem to be in the correct spot:

user@4be54c874268:~/che/lib$ ls -lahR /home/user/che/lib/
/home/user/che/lib/:
total 77M
drwxrwxr-x  4 user user 4.0K Jan 29 21:30 .
drwxr-xr-x 18 user user 4.0K Jan 29 21:30 ..
drwxrwxr-x  2 user user 4.0K Jan 29 21:30 terminal
-rw-rw-r--  1 user user  77M Jan 29 19:34 ws-agent.zip

/home/user/che/lib/terminal:
total 7.3M
drwxrwxr-x 2 user user 4.0K Jan 29 21:30 .
drwxrwxr-x 4 user user 4.0K Jan 29 21:30 ..
-rw-rw-r-- 1 user user 2.5K Jan 25 20:37 index.html
-rw-rw-r-- 1 user user 148K Jan 25 20:37 term.js
-rwxrwxr-x 1 user user 7.1M Jan 25 20:37 terminal

randywallace avatar Jan 29 '16 21:01 randywallace

I do have the same issue on MacOS X 10.11.3 with eclipse-che-4.0.0-beta-13-1. I tried to create a simple workspace with Ubuntu.

amiga23 avatar Feb 04 '16 20:02 amiga23

@eivantsov This one is for you. If we can do a live diagnostic session, this may help.

TylerJewell avatar Feb 05 '16 00:02 TylerJewell

@robhardt @amiga23 what is your Docker Machine version? Can you run docker-machine update and try it again?

Also, did you use an installer or download binaries/build from source? And where are Che binaries located? Which directory? In Users/ or outside Users?

You may also wan to ssh into a VM, and check if /lib got mounted from MacOS into the VM.

A good number of our engineers use Eclipse Che on MacOS daily.

@randywallace I cannot reproduce it on Linux. What is your OS and can you repeatedly reproduce the issue?

ghost avatar Feb 06 '16 07:02 ghost

@eivantsov This is specifically an issue in how the API in the workspace master is launching the volume bind into the workspace slave so the slave has access to those files. If the files are not bind-able (i.e. they do not exist), docker will create those missing files as empty folders (which kinda makes sense, docker will try to create directories if they do not exist to satisfy the bind, on both the host and container, and /path/path/file.zip/ is a valid path). Ideally, before the WS Master launches a container, it should make sure all the assets exist prior to launching the container and throw an exception. Now why those files do not exist is a mystery as I no longer have a copy of that particular image in my local docker server. I've screwed with things quite a bit since posting in this issue, and have not since been able to replicate this particular problem. As such, I suspect strongly that somehow some angry image ended up in the docker hub that was missing the workspace client dependency files after an incomplete maven build, but was fixed at some point by a new pushed image to the hub when someone identified that the image was bad.

https://github.com/codenvy/che-plugins/blob/c2d9d840a8db5f8603b38472f939f5d3c4f27f26/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/ext/provider/ExtServerVolumeProvider.java#L40

and

https://github.com/codenvy/che/blob/f4ffd10a1471f3c64b04f3dcdfb9ec672eed372f/assembly-ide-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties#L81

indicate that the workspace client startup would be something like docker run -v /path/to/ws-agent.zip:/path/to/ws-agent.zip:ro image command which is fine, as long as that file exists. This problem will occur every time, without a failed client container startup, if that file does not in fact exist.

Some of the observations I make over here would also help alleviate this: #244 .. insofar that those assets should not me bound to a container (forcing the slaves to run on the same host as the master, unless you're using a multi-host volume driver, but this brings abundant complexity) but instead hosting them on an API Endpoint at the workspace master.

Regarding the issue that @robhardt was experiencing, running che locally on OS X outside docker-machine, I would recommend confirming that the machine.server.ext.archive and machine.server.terminal.archive configs are set correctly, and that there are assets in there for the workspace client to use. I know from experience that running the documented build instructions via maven will generate those assets correctly.

randywallace avatar Feb 06 '16 09:02 randywallace

Yes, docker will create those on the host and mount empty directories. And yes, the command line is correct. Let's see how far we can advance in investigating these failures on MacOS.

My only suspicion is that these resources never ended up in a VM, thus when a workspace container started, they never ended up there as well, and consequently unzip exec exited with an error.

Another possible reason, is that che-home variable wasn't set correctly, thus an absolute path to ws-agent turned out to be non-existent.

@amiga23 @robhardt if possible, can you perform the following?

  1. SSH into a VM
  2. Launch Che as usual, try to create a workspace
  3. Just after a container starts, in a VM, run

get workspace container ID docker ps

get information on bindings and mounts docker inspect --format '{{ .Mounts}}' $containerID docker inspect --format '{{.HostConfig.Binds}}' $containerID

Also, as already said, try to SSH into a VM and make sure that Che directory with /lib is there (find out permissions as well)

ghost avatar Feb 06 '16 09:02 ghost

@eivantsov - I think I found the issue. In my case, I was running che from an external drive. docker-machine's boot2docker vm doesn't mount external volumes, in fact, it appears only to mount the 'Users' directory from the host machine.

At some point in the process the 'ws-agent.zip' and 'terminal' got created as directories as per @randywallace 's observation. It would appear that somewhere in the creation of the workspace image, it is assumed that ws-agent.zip exists and that its location in the docker-machine vm mirrors its location on the host machine. I think this would normally be true - if the file existed under '/Users,' but not if it is under '/Volumes' or in another non-standard location. When it wasn't found, ws-agent.zip got created as an empty directory.

BTW, I was actually working in a symlinked dir under /Users, but it must get unpacked to its canonical location at some point.

I used the script below to mount my external volume on my docker-machine instance and now I can create a workspace! Thanks to @cristobal for the script.

https://gist.github.com/cristobal/fcb0987871d7e1f7449e

I'd be curious if this solves the problem for @randywallace and @amiga23

robhardt avatar Feb 21 '16 00:02 robhardt

Yes, installing Che on a Mac outside user home, will cause this error since it is only a user's home directory that gets mounted into a VM. While we do forcefully copy ws-agent.zip and terminal into %userprofile%\AppData\Eclipse Che on Windows, we do not do that on a Mac.

Yes, I think this will solve similar issues where people installed Che on /opt or other directories outside user home.

Since it is solved for you now, I am closing the issue.

Docs will be updated with a word of caution on where Che should not be installed on a Mac.

ghost avatar Feb 21 '16 06:02 ghost

Any update on docs, am still facing the same issue & am noob. where should I install che?

VenomVendor avatar Mar 10 '16 00:03 VenomVendor

Are you on a Mac? Anything under '/Users//' should work out of the box.

On Wed, Mar 9, 2016 at 6:20 PM, VenomVendor [email protected] wrote:

Any update on docs, am still facing the same issue & am noob. where should I install che?

— Reply to this email directly or view it on GitHub https://github.com/eclipse/che/issues/240#issuecomment-194585316.

robhardt avatar Mar 10 '16 00:03 robhardt

Moved che inside /Users/<che> it's working now. Unable to create workspace outside Users. Shows wrong error message, if I do so.

VenomVendor avatar Mar 10 '16 01:03 VenomVendor

Get [STDERR] unzip: cannot find or open /mnt/che/ws-agent.zip, /mnt/che/ws-agent.zip.zip or /mnt/che/ws-agent.zip.ZIP.

Running as administrator. vagrant/chef all work fine. docker itself is fine. not che Still being mounted wrongly even from windows 7 pro 64, che4 rc11, jdk1.8-40-b25. docker 1.10.3 vbox 4.3.12 {have DG so cannot update vbox} Was worried about space in AppData/Local/Eclipse Che/. Looks like that's not a problem but can we avoid space here ? They are mounted as folders with no files. Am in GIT Bash

/apps/DockerToolbox:./docker exec 889edcad9ee1 ls -l /mnt/che/ total 0 drwxr-xr-x 2 root root 40 Mar 11 11:40 terminal drwxr-xr-x 2 root root 40 Mar 11 11:40 ws-agent.zip

Just to check space issue I updated the WindowsHostUtils class (just AppData/Local/Che now) and the jar and the war just to see, cleaned work and exploded war folders. restarted che. Saw the new folder AppData/Local/Che being created with the files which are correct. But I get same error and same machine state /home/mobaxterm/apps/DockerToolbox:./docker exec ffff10392e2a ls -l /mnt/che/ total 0 drwxr-xr-x 2 root root 40 Mar 12 06:50 terminal drwxr-xr-x 2 root root 40 Mar 12 06:50 ws-agent.zip

How do I get these to mount properly and create a project ? Add to new issue ?

afalak avatar Mar 12 '16 07:03 afalak

@eivantsov Please open an issue that will have us perform the same logic checks that we do for Windows on the Mac. I believe it is the following:

  1. On windows, we print out a special overview message in che.sh saying where the ws must be.
  2. We forcibly copy the terminal and ws-agent.zip into the right directory.
  3. We should forcibly fail if the workspace directory is not /users. I believe you can have che installed in other directories, but the workspace should be in /users. In the che.properties file this would be the entry that would have to be overridden on macs.
# Directory where your workspaces and projects save.
# This property is currently ignored on windows due to virtual box limitation.
# On windows, always set at %userprofile%\Local\AppData\Eclipse Che\vfs.
che.user.workspaces.storage=${che.home}/workspaces 

TylerJewell avatar Mar 12 '16 17:03 TylerJewell

@afalak Can you provide some more details about your installation:

  1. What directory is Che installed into.
  2. What is the che version you are using as well.

Thanks.

TylerJewell avatar Mar 12 '16 17:03 TylerJewell

Started new issue at 695

afalak avatar Mar 13 '16 01:03 afalak

I can confirm that if using Mac OS X (el capitan) if you unzip to /opt folder e.g. /opt/eclipse-che then you get the 'cannot find /mnt/che/ws-agent.zip'.

Moving the eclipse-che folder to a home folder e.g. /Users//che does get rid of the error and starts the workspace.

This is not ideal but ok for experimenting with Che :)

ayubmalik avatar Mar 15 '16 10:03 ayubmalik

This is a limitation of Virtualbox. Only user home directory gets mounted into the VM.

ddementieva avatar Mar 15 '16 12:03 ddementieva

@ayubmalik You have a few choices here.

  1. Use the --machine-driver:fusion option when starting Che. You will need vmware fusion installed. We will then use Fusion to create the VM and you can have che files in directories other than /Users and it will still mount properly.
  2. You can update the che.properties file to have your worksapce and project's stored in /Users but also have Che installed in another directory. See the Configuration page in the docs for how to configure this.
  3. You can install Che into /Users.

TylerJewell avatar Mar 15 '16 14:03 TylerJewell