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

Timeout for custome stack #493

Closed
FenilShah opened this issue Aug 1, 2016 · 9 comments
Closed

Timeout for custome stack #493

FenilShah opened this issue Aug 1, 2016 · 9 comments

Comments

@FenilShah
Copy link

* If you are a Codenvy customer or have a trial license please file your issues with Support through email. GitHub issues do not have a response SLA.*

Getting time out issue when I am using my own custom stack.

Reproduction Steps:

  1. Creating new project
  2. Selecting custom stack
  3. Writing my own code as below

`# Here we've used jdk7_tomcat7 base image, however, you can use another one, which is the most appropriate for you: https://github.com/codenvy/dockerfiles
FROM codenvy/jdk7_tomcat7

ENV DEBIAN_FRONTEND noninteractive

RUN sudo apt-get update

Install MYSQL

RUN sudo -E bash -c "apt-get -y --no-install-recommends install mysql-server" &&
sudo sed -i.bak 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf &&
sudo service mysql restart &&
sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON . TO 'root'@'%'; FLUSH PRIVILEGES;"

EXPOSE 3306

Create MySQL user and database, and start it

RUN sudo service mysql restart &&
CODENVY_MYSQL_PASSWORD=password &&
CODENVY_MYSQL_DB=test &&
CODENVY_MYSQL_USER=test &&
echo "MySQL password: $CODENVY_MYSQL_PASSWORD" >> /home/user/.mysqlrc &&
echo "MySQL user : $CODENVY_MYSQL_USER" >> /home/user/.mysqlrc &&
echo "MySQL Database:$CODENVY_MYSQL_DB" >> /home/user/.mysqlrc &&
sudo mysql -uroot -e "CREATE USER '$CODENVY_MYSQL_USER'@'%' IDENTIFIED BY '"$CODENVY_MYSQL_PASSWORD"'" &&
sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON . TO '$CODENVY_MYSQL_USER'@'%' IDENTIFIED BY '"$CODENVY_MYSQL_PASSWORD"'; FLUSH PRIVILEGES;" &&
sudo mysql -uroot -e "CREATE DATABASE $CODENVY_MYSQL_DB;"

Start MySQL server and launch Tomcat with CMD command

CMD sudo service mysql start > /dev/null && /home/user/tomcat7/bin/catalina.sh run 2>&1`

Expected behavior:

It is not starting workspace, and I don't know where I can set this "machine_ws_agent_max_start_time_ms" variable.

Observed behavior:

Getting following message "Error when starting workspace
Unable to start workspace. Error when trying to start the workspace: Timeout reached. Codenvy is unable to verify that your workspace's agent has successfully booted. Either the workspace is unreachable, the agent had an error during startup, or your workspace is starting slowly. Admins can configure machine_ws_agent_max_start_time_ms to increase the timeout."

See the attached screenshot also.codenvy

Codenvy version: 4
OS and version: [Enter OS name and version here]

Additional information:

Problem only started happening recently, didn't happen in an older version of Codenvy: [Yes / No] Don't know

Problem can be reliably reproduced: [Yes / No - it's random] Yes

@ddementieva
Copy link

codenvy/jdk7_tomcat7 image is built for Codenvy Classic version. There is a certified Java image for Codenvy beta, such as https://hub.docker.com/r/codenvy/ubuntu_jdk8/, which you can use as a base for your custom stack.

@FenilShah
Copy link
Author

I did replace with ubuntu_jdk8 and It's working great, thank you so much..

One more suggestion I need is everytime I launch workspace, it reinstalls mysql and I lose the database previously I had used. Can you please suggest me what could I do for that?

@ddementieva
Copy link

Have you tried to snapshot a workspace?

Switch to the Operations Perspective > Machine > Create Snapshot, stop workspace when snapshot is created and start it again recovering from the snapshot. Check if your database is there.

@ghost ghost added the kind/question label Aug 2, 2016
@FenilShah
Copy link
Author

I am using web version. Can you please suggest me where is Perspective here in attached screen shot?

image 4

@ddementieva
Copy link

@FenilShah You can find Switch to the Operations Perspective button in the upper right corner of the toolbar.
opbutton

The Operations Perspective will look something like
opview

@FenilShah
Copy link
Author

@ddementieva Thanks for the quick response.

I am able to do that. That's seems great, it is creating image from last snapshot. But here I do have some concerns:

  1. Every time I start workspace, it asks 'Do you want to recover the workspace from snapshot?".
  2. Everytime if I change anything in database I need to create a snapshot before leaving the workspace. If I forgot to create snapshot, I will loose my data and it is time consuming even. :(
  3. Also it is getting timeout after 10 mins, again if I forget to create snapshot. I will loose my data.

This feature is great. But I don't think this is useful to persist database. Can you please correct me if I am wrong? Or any other option?

@ddementieva
Copy link

@FenilShah auto snapshotting is disabled on beta.codenvy.com...so making snapshots manually is the only option at this moment.

@TylerJewell
Copy link
Contributor

@FenilShah - since beta.* is free - we limit workspaces to 3GB RAM and do not provide auto-snapshotting. You can get auto-snapshotting with Eclipse Che and Codenvy Enterprise, where you install it and run it yourself. Also, the 10 minute idle timeout is a way to keep our infrastructure costs contained as most people start workspaces and just let them run.

@FenilShah
Copy link
Author

@ddementieva @TylerJewell Ok. I am very excited to work with this. Thank you so much for your quick support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants