-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to restore workspaces when restarting Che? #1561
Comments
Can you try starting and stopping workspace and then shutting down the server? |
@ddementieva I can successfully run and stop workspace if i don't stop or restart che server. |
Can you check if there is anything in the /che/storage directory? |
@ddementieva There is a file |
Can you give it a try with a nightly build https://install.codenvycorp.com/che/eclipse-che-nightly.zip? |
@eivantsov I restore workspaces successfully. Thanks for your advice. |
But how do you then terminate the process? Yes, I think that the server needs to be gracefully stopped for the workspaces to be saved into local storage. |
I have the same issue on Mac while using Docker for Mac. Perhaps the problem is that I'm not sure how to gracefully shutdown the server so the workspaces are restored. In general, it'd be nice if we didn't have to worry about graceful shutdown, as unexpected shutdowns are pretty likely on a workstation, and I'd hate to lose all my workspaces if that were to happen. Note: I'm using the nightly build; I couldn't get the stable build to work with Docker for Mac. Here's what I'm doing: docker-compose.yml:
Shell commands:
There is a preferences.json and workspaces are present in /home/user/che, but it's not picking them up on restart for whatever reason. Am I doing something wrong in the way I'm setting it up or something? |
Your compose configuration looks good so I doubt that the issue is related to the way that you are running or stopping the server. In other words I think this is a bug. @agaragryi, @eivantsov - is this known? I don't see an issue for it in github or jira but thought it may have been discussed elsewhere. |
Thanks for looking into it, @TylerJewell ! |
@mhworth |
I've been running into the same issue as @mhworth with Docker for Mac, just using the instructions in the doc (without using docker-compose). |
@eivantsov Thanks for the direction. That mount is present in my docker-compose.yml file already (see the fourth mount), and I have confirmed that it works by overriding the command with bash and doing an ls on /home/user/che/storage. I see the json files, but Che just doesn't pick them up for some reason. |
@mhworth @malcolmalex I have just checked it and I can see workspaces.json file created after I stop a workspace and stop che. If a container is stopped with |
I have only been using Che for a couple days and I think it is a great project. This issue so far has been my only real hangup. In a Docker I was thinking a modification to receive the signal when a |
@jcpowermac I think we can close this issue as there was a bug that was resolved in 4.5.0. If you were running Che in a Docker container, such as for Docker for Mac / Windows, then there were scenarios where the workspace stuff (project, etc) was not being written into the mount and then available in between runs. See this PR: #1733. Also, you may want to attempt the new Che launcher for docker. It dramatically simplifies many things. |
Everyone - I am going to close this issue due to #1733 - if for some reason this issue reappears, then please reopen for discussion. |
@TylerJewell this is still an issue. Also the documentation or your automated build in Docker hub is incorrect. There is no latest tag on the che-launcher. After I created a workspace I chdir to /home/user/che/
Not until I stopped the workspace did I get a preference.json.
Here I am stopping Che using the launcher.
Still only
Starting Che with launcher...
And now I have no workspaces or projects or my new stack I added. I don't understand why I have to manually stop the Che server for the workspace, stacks and / or project data to persist. Or not persist in this case. Like I said before I really like this project but the data needs to persisted when an operation occurs not when I stop the server. |
@jcpowermac ok lets separate the issues a bit. The However the not saving your workspace + projects is definitely some bad juju. I am wondering if you have to always pass in As for the che-launcher:nightly - that is expected right now. I added a comment in the docs saying that you have to use the nightly tag until 4.6.0 is released. And - for the record - workspaces and projects are immediately persisted when they are created. |
Distro
I have installed Docker from their repos.
Added my stack, created a workspace and imported my project. Then I stopped the workspace
Stopped the container via the launcher.
and launcher info
|
@jcpowermac - thank you for the full analysis. Everything in your execution and run looks perfect. The workpaces and their project files should be in /home/user/che. I don't have a linux box around to test - all of my testing has been either Docker for Mac / Windows, which is usually the broken use case. So it's surprising to see a Linux configuration not saving. This will sound pedantic for asking since you were so thorough in the reporting, but I only see @l0rd, @eivantsov, @fbenoit - we may need some more eyes on this. |
@jcpowermac - I have spent the past 6 hours attempting to debug some of this. I launched the same OS version in Vagrant. I am getting a variety of different errors, for which I suspect firewalld / iptables are causing the problem. After a 7th hour, I was able to overcome that issue :). Ok, I started with:
where 5: I then created a workspace and a project.
All of my files from the project are located in the directory and their are editable by the vagrant user. |
@TylerJewell I will test again today. Did you disable SELinux? Just want to confirm so that we are more or less configured in the same way. |
@jcpowermac - I didn't check. I just took the default centos vagrant image. I presume selinux is not disabled in the default configuration? |
By default its enabled |
@TylerJewell same result. The one constant though is my stack, could that be causing this problem? I will retest with a built in stack to confirm. Step 2 - Add Stack
{"name":"Ansible 2.1","source":{"origin":"jcpowermac/eclipse-che-ansible","type":"image"},"components":[{"version":"2.1","name":"Ansible"},{"version":"2.7.11","name":"Python"},{"version":"8.1.1","name":"pip"}],"tags":["Python 2.7","pip","Ansible","Git"],"id":"stackqwtmzal3q7izbqqz","workspaceConfig":{"environments":[{"name":"default","machineConfigs":[{"limits":{"ram":0},"name":"default","type":"docker","source":{"location":"stub","type":"dockerfile"},"dev":true,"servers":[],"envVariables":{},"links":[]}]}],"defaultEnv":"default","projects":[],"name":"default","commands":[{"commandLine":"cd ${current.project.path} && ansible-playbook -vvv site.yml","name":"run","attributes":{"previewUrl":"http://${server.port.8080}"},"type":"custom"}],"links":[]},"creator":"che","description":"Default Ansible Stack with Ansible 2.1","scope":"advanced","links":[{"href":"http://10.53.252.100:8080/wsmaster/api/stack/stackqwtmzal3q7izbqqz","parameters":[],"rel":"remove stack","method":"DELETE"},{"href":"http://10.53.252.100:8080/wsmaster/api/stack/stackqwtmzal3q7izbqqz","parameters":[],"rel":"get stack by id","method":"GET","produces":"application/json"}]}% Step 3 - Create workspace and project |
@jcpowermac - first, I vote that all support issues should come with ascii animations. That is crazy cool. But in watching your second video, what I saw was that the workspace storage is happening properly. Your project files were saved to disk. You can see them at the beginning where you did the tree and at the end. So, if you restarted the Che server, you should see the workspace that you had already created and be able to start it again. And when it is restarted, the project files will be loaded from disk. FYI, I believe that nightly, for which you are running 4.6.0-RC1-SNAPSHOT, has a known issue around restarting workspaces from snapshotted images. But the key point was that earlier you were concerned that your project files are not being saved in between runs, and it looks like they are. Now, workspace image snapshots - those are saved in a different location - were you wanting to track that down? |
@TylerJewell sorry maybe I didn't make the issue clear. I have tried multiple versions of che:
The issue that I am having is if I ever stop the che server and restart it the workspaces or projects are no longer available via the UI. The workspace directory structure and the projects beneath are always available. My use case for Che was to provide an environment where a typical Windows administrator can write and run Ansible playbooks/roles without messing with installing/configuring Linux. I would provide a template for VMware vSphere that can be imported. |
Ahh, @jcpowermac - my apologies, I did misunderstand the issue. Is it possible that this issue is related to #1902 and #1919? These issues have been discovered on the 4.6 nightlies. I am not sure if anyone has confirmed them on 4.5 / 4.4.1 - so you may be experiencing something else. If those other issues look similar, then this may resolve itself really quickly. If not, then I may want to ask for a diagnostic session on your system. Are there any exceptions or error messages in your browser console (CTRL-SHIFT-I) when starting the workspace? Clearly your issue is a real issue and fundamental to the product, so if this is a bug, it will get a blocker designation. |
@TylerJewell I tested #1902 or #1919 and did not experience that issue. I will re-test today and provide feedback. |
@jcpowermac - we have found a blocker issue with how workspaces are stopped from the launcher. #1949. |
@jcpowermac and others - this has been merged into master. The pull request is here. |
hi,
Steps to reproduce:
bin/che.bat
2.visit
localhost:8080
3.create a new workspace and create a simple java project
4.stop che through closing the command shell where is executing
bin/che.bat
5.execute
bin/che.bat
again6.can't find any workspace and project when visiting
localhost:8080
I find the size of file
.docker/macine/macines/che/disk.vmdk
increase when I create workspace, so I guess some information about workspace have been stored, so how to restore workspace when I restart che?I run che on Wins 7, and the version of Che is 4.3.4(I try to use other version but get same result).
Thanks in advance.
The text was updated successfully, but these errors were encountered: