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

how can I get the same workspace which I was working on when I restart Che server. #779

Closed
kushalmokashi opened this issue Mar 22, 2016 · 19 comments
Labels
status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.

Comments

@kushalmokashi
Copy link

this is not an issue. this is a question.
I am trying to understand the working of che. This may look like a dumb question.
I am using system with windows OS. I have installed the che server in this local system with the help of the installer. So the che server , browser and VM(which contains the docker container) are in the same machine.
Now when I start the che server and run this URL "http://localhost:8080/dashboard/" in the browser, I am able to see the dashboard. And also I am able to create the workspace and projects.

But when I restart the che server and run this URL "http://localhost:8080/dashboard/" again,
at this time how can I get/access the workspace and projects which I have created earlier.??

The documents which you have provided are very good. But I feel I am somehow failing to understand this.

Thanks for the help.

@TylerJewell
Copy link

@kushalmokashi You are not really asking a dumb question. We get this question a couple different times. It's not obvious because the workflow that Che uses today doesn't make this obvious or intuitive.

Today, there are a few ways to restart a workspace.

  1. You can restart it in the dashboard.
  2. You can restart the workspace directly in the ide. There is syntax in the docs for going to /ide/ to load it directly.
  3. You can restart the workspace through a RESTful API.

Now there are two ways to restart a workspace - with or without its previous state. Currently, the default operation is to restart the workspace without its previous state. State here is everything that is not your projects. The projects are stored in long term storage, and re-mounted into your workspace each time you start it. But the other state are things like databases, maven repositories, or other file modifications. Today, if you stop the workspace in the default configuration, all of this state is lost.

However, you can start a Docker registry, and then instead of stopping the workspace, you can snapshot it. This creates a copy of the internal state and places that image into the registry. Then, in order to open the workspace with this snapshot, you have to create a new workspace off of the snapshot image. You can read the configuration docs on how to set this up.

We know that this is really bad user workflow. Because it is just not expected. Snapshots were experimental for a long period of time, so we had this as an alternative experience. Snapshots are now no longer experimental, so we are working on making the default workflow one where snapshots are automatically created when a workspace is stopped, and the latest snapshot is automatically loaded when you restart.

Snapshotting a workspace the first time is time and resource consuming. Starting a snapshot is very fast. So we have to handle things in such a way where we prevent the server from shutting off if we are in the middle of a snapshot exercise on a workspace where the user has long disappeared.

@kushalmokashi
Copy link
Author

@TylerJewell Thanks for the quick reply. I will try to start a docker registry. and use Snapshot. But as of now immediately I have the following concern.I have a little confusion here.

The steps followed by me are as follows -

  1. I started the che server from the "C:\Users\user\AppData\Local\Programs\Eclipse Che\eclipse- che-4.0.0-RC13" location.
  2. Access the dashboard in the browser through the URL "http://localhost:8080/dashboard/".
  3. I will create a workspace namely ''wksp-1wxn"
  4. Then I will create the project "console-java-simple " using the ready to use stack.
  5. I will be able to see the proect in the IDE and also I am able to run this.
  6. I will close the browser and shutdown the server.
    The workspace and the projects are in my local system at this path "C:\Users\user\AppData\Local\Eclipse Che\vfs"
    This will be synched with the docker machine in real time. (correct me if my understanding is wrong)
    As far as I have understood, everytime when we start the che server a new instance of the created with the new runtime and environment.
    Now I will repeat the steps from 1 to 2.
    At this stage I am not able to see any workspace or project which I have created earlier.
    Why? Is it possible to access those workspace or project created earlier with help other than the creating docker registry.?

@TylerJewell
Copy link

Any existing workspaces and projects should appear in the dashboard if you stop Che and restart it. If they are not appearing then there may be a bigger issue.

Are there any errors in the logs? Can you screen shot the dashboard home page? If you have a dashboard that doesn't detect these items, then engineers need to know specifics.

@kushalmokashi
Copy link
Author

@TylerJewell Sorry for the delayed response.

I have created a workspace and project last night.
Now when I started my che server again and opened the IDE in the browser I am not able to see any workspace or projects.
All the details , screen shots and the logs are provided below :
My environment details :
che version: eclipse-che-4.0.0-RC13
java version : 1.8.0_66
VirtualBox, Windows 7 64-bit.
The che properties file is attached here (changed the file extension to .txt for the convenience of uploading here )
cheproperties.txt

The log files are attached here :
catalina-0log.txt
localhost-access-0log.txt

the screen shots of the IDE are attached and they are named as per the functionality :
create_workspace
dashboard
projects
vfs
workspace

Please let me know if you need any further information or any logs.

@TylerJewell TylerJewell added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Mar 23, 2016
@TylerJewell
Copy link

@ashumilova @benoitf Wow - never seen this. Can you investigate? Also - notice that on Firefox, the fonts are not displaying properly.

@kushalmokashi Does this problem happen on Chrome?

@benoitf
Copy link
Contributor

benoitf commented Mar 23, 2016

@kushalmokashi could you paste result of http://localhost:8080/api/workspace

@kushalmokashi
Copy link
Author

@TylerJewell Yes in Chrome also it is the same behavior.
@benoitf I assume the meaning of the result is what is displayed in the browser when I run this "http://localhost:8080/api/workspace"URL. The result is as below:

[{"id":"workspace84rhbqpbcwn7ohd2","owner":"che","status":"RUNNING","config":{"name":"wksp-vsnq","attributes":{"stackId":"java-default"},"environments":[{"name":"wksp-vsnq","machineConfigs":[{"name":"ws-machine","type":"docker","source":{"location":"http://localhost:8080/ide/api/recipe/recipetynanmbe1iaow28l/script","type":"recipe"},"dev":true,"limits":{"ram":1000},"links":[{"method":"GET","parameters":[{"name":"channel","defaultValue":"workspace84rhbqpbcwn7ohd2:wksp-vsnq:ws-machine","required":true,"valid":[]}],"rel":"get machine logs channel","href":"ws://localhost:8080/ide/api/ws/workspace84rhbqpbcwn7ohd2"},{"method":"GET","parameters":[{"name":"channel","defaultValue":"machine:status:workspace84rhbqpbcwn7ohd2:ws-machine","required":true,"valid":[]}],"rel":"get machine status channel","href":"ws://localhost:8080/ide/api/ws/workspace84rhbqpbcwn7ohd2"}]}]}],"commands":[{"name":"console-java-simple: build","type":"mvn","attributes":{"previewUrl":""},"commandLine":"mvn -f /projects/console-java-simple clean install"},{"name":"console-java-simple: run","type":"mvn","attributes":{"previewUrl":""},"commandLine":"mvn -f /projects/console-java-simple clean install && java -jar /projects/console-java-simple/target/*.jar"}],"projects":[{"name":"console-java-simple","type":"maven","path":"/console-java-simple","attributes":{"maven.artifactId":["console-java-simple"],"maven.packaging":["jar"],"containsJavaFiles":["true"],"maven.resource.folder":[],"maven.parent.version":[""],"maven.test.source.folder":["src/test/java"],"maven.version":["1.0-SNAPSHOT"],"maven.parent.groupId":[""],"languageVersion":["1.8.0_45"],"maven.parent.artifactId":[""],"language":["java"],"maven.source.folder":["src/main/java"],"maven.groupId":["org.eclipse.che.examples"]},"description":"A hello world Java application.","source":{"location":"https://github.com/che-samples/console-java-simple.git","type":"git","parameters":{}},"links":[],"modules":[],"problems":[],"mixins":["git"]}],"defaultEnv":"wksp-vsnq","links":[]},"temporary":false,"links":[{"method":"POST","parameters":[],"rel":"start workspace","href":"http://localhost:8080/ide/api/workspace/workspace84rhbqpbcwn7ohd2/runtime","produces":"application/json"},{"method":"DELETE","parameters":[],"rel":"remove workspace","href":"http://localhost:8080/ide/api/workspace/workspace84rhbqpbcwn7ohd2/config","produces":"application/json"},{"method":"GET","parameters":[],"rel":"get all user workspaces","href":"http://localhost:8080/ide/api/workspace","produces":"application/json"},{"method":"GET","parameters":[],"rel":"get workspace's snapshot","href":"http://localhost:8080/ide/api/workspace/workspace84rhbqpbcwn7ohd2/snapshot","produces":"application/json"},{"method":"GET","parameters":[],"rel":"ide url","href":"http://localhost:8080/ide/wksp-vsnq","produces":"text/html"},{"method":"GET","parameters":[{"name":"channel","defaultValue":"workspace:workspace84rhbqpbcwn7ohd2","required":true,"valid":[]}],"rel":"get workspace events channel","href":"ws://localhost:8080/ide/api/ws/workspace84rhbqpbcwn7ohd2"},{"method":"GET","parameters":[],"rel":"self link","href":"http://localhost:8080/ide/api/workspace/workspace84rhbqpbcwn7ohd2","produces":"application/json"},{"method":"GET","parameters":[],"rel":"get runtime workspace","href":"http://localhost:8080/ide/api/workspace/workspace84rhbqpbcwn7ohd2/runtime","produces":"application/json"},{"method":"DELETE","parameters":[],"rel":"stop workspace","href":"http://localhost:8080/ide/api/workspace/workspace84rhbqpbcwn7ohd2/runtime"}]}]

@benoitf
Copy link
Contributor

benoitf commented Mar 23, 2016

@kushalmokashi could you also display the javascript console of your browser ?
https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console
and then open workspace page in Che dashboard

@kushalmokashi
Copy link
Author

@benoitf The screen shot is the web console when I opened workspace page in Che dashboard.
web_console
Here you can see one workspace, but that is created recently. After that i have not restarted the che server thats the reason why it is visible now.

Note: the result which I shared in the last comment is of the Chrome.

@ghost
Copy link

ghost commented Mar 23, 2016

OK, what you could do is stop Che. Go to /tomcat//temp/local-storage and check if workspaces.json exists and if it has references to your workspace. This is where Che is looking for workspace descriptors by default.

@kushalmokashi
Copy link
Author

@eivantsov I stopped the server and checked at the mentioned location and workspace.json exists.
Now I am able to see the workspaces and projects when i restart the che server.
I guess I had messed up with some configuration or settings.
I will check it tomorrow again. If there is any discrepancy I will update here.
As of now it is working.
Thanks all for your quick & timely help.

@ghost
Copy link

ghost commented Mar 23, 2016

Odds are that Che server looked for workspace storage in the wrong location. Anyway, good to now it worked for you.

I'm closing the issue, but feel free to reopen if this particular problem persists.

@ghost ghost closed this as completed Mar 24, 2016
@Hin-Fan
Copy link

Hin-Fan commented Jul 11, 2016

I started Che as a docker container (docker for windows) and all workspaces disappear from the dashboard whenever che restarts. I checked http://10.0.75.2:8080/api/workspace and it replies [] right after restart.
I tried sudo find / -name 'workspace*.json' inside the che container and found no matching file.

Please assist.

@kushalmokashi
Copy link
Author

@Hin-Fan : Can you tell me how did you restart che? I mean what command did you use?

@Hin-Fan
Copy link

Hin-Fan commented Jul 11, 2016

@kushalmokashi docker restart che from powershell

@TylerJewell
Copy link

I am going to run an exhaustive set of tests on Windows 10 tomorrow with the docker container for Windows and also cross link multiple issues that seem to have similar problems.

@TylerJewell
Copy link

TylerJewell commented Jul 12, 2016

Hi @kushalmokashi @Hin-Fan - I confirm the issue. Please track progress in issue #1711.

@Hin-Fan
Copy link

Hin-Fan commented Jul 12, 2016

Thank you very much Tyler.

@TylerJewell
Copy link

@kushalmokashi A fix is coming in 4.5 early next week. Tested this morning and it worked good.
#1733 (comment)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.
Projects
None yet
Development

No branches or pull requests

4 participants