MySQL won't start after cloning




I’m trying the new feature of Cloning function.

But MySQL keeps failing and doesn’t start at all after cloning.
I’ve tried to mysql-ctl stop before clone, but it didn’t work.



Same here, after I cloned a workspace MySQL no longer works.


Me too.
MySQL won’t start after cloning.


What sort of errors does it give you?


amward:~/workspace $ mysql-ctl start

  • Starting MySQL database server mysqld


I think MySQL is now working after cloning.

Thanks a lot!


I am getting the same type of errors, after cloning database cannot find elements.

even though listing from the rails console show db fully present


Has anyone solved this problem??? I have recently cloned a workspace and mysql fails to restart.
I have tried to reinstall but to no avail


The problem is still there.
Well if the problem has not been solved after more than a year. Then maybe cloud 9 is not the right tool… :frowning:


I have talked to cloud9 support and we have concluded that the cloning leaves the mysql permissions messed up.

Resetting them in /var/lib/mysql/mysql to mysql:mysql with chown solves the problem


Thanks for the reply.
Still can’t start mysql. I think you a missing -R in chown. But even this will not start mysql on a cloned server.

ERROR 2002 (HY000)


You are correct about the -R. You may also want to check the permissions
on /var/lib/mysql/

Kirk Dawson
5220 Riverside Drive
Fairmont Hot Springs, B.C.
V0B 1L1


Kirk, I’m not that comfortable with command line, but I tried this:

sudo chown -R mysql:mysql /var/lib/mysql/mysql

But still no luck. Is that the correct command?


We’re looking into this as we speak; could you post the commands you’re using to start MySQL on these machines? Additionally, could you post the output of sudo ls -al /var/lib/mysql? If you’re seeing any issues pop up in the logs at /var/log/mysql/error.log, please pass that along as well.

If you don’t feel comfortable posting this information, feel free to send over a PM. Any information helps!

Let me know if you have any questions!


This is an issue for me too. I’ve tried resetting permissions but perhaps I did it wrong. Am cloning an environment that we’ve cloned a couple dozen times but now having issues for the first time. Will post the requested info asap.

Command to manually start mysql resulted in [fail]:

sudo service mysql start

Output of sudo ls -al /var/lib/mysql

total 25072
drwx------ 11 couchdb ssl-cert 4096 Aug 17 16:27 .
drwxr-xr-x 111 root root 4096 May 16 16:29 …
drwx------ 2 couchdb ssl-cert 4096 Jul 27 19:29 c9
-rw-r–r-- 1 root root 0 Aug 3 15:03 debian-5.5.flag
-rw-rw---- 1 couchdb ssl-cert 5242880 Aug 17 15:33 ib_logfile0
-rw-rw---- 1 couchdb ssl-cert 5242880 Aug 17 15:33 ib_logfile1
-rw-rw---- 1 couchdb ssl-cert 35651584 Aug 17 15:33 ibdata1
drwx------ 2 mysql mysql 4096 Aug 17 16:27 mysql
-rw------- 1 root root 6 Aug 3 15:11 mysql_upgrade_info
drwx------ 2 couchdb ssl-cert 4096 Mar 10 23:28 performance_schema
drwx------ 2 couchdb ssl-cert 4096 Apr 12 16:56 phpmyadmin

Heres the last of the error log file - I’m having trouble getting the whole thing to display but could look into it more if it’d be helpful


I’m also seeing this error.
Here’s the last ~1500 lines of /var/log/mysql/error.log

here’s a stat of /var/lib/mysql

File: ‘/var/lib/mysql’
Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 100067h/1048679d        Inode: 55669       Links: 11
Access: (0700/drwx------)  Uid: (  102/   mysql)   Gid: (    0/    root)
Access: 2017-08-17 11:44:07.953910791 +0000
Modify: 2017-08-17 11:44:07.853907866 +0000
Change: 2017-08-17 11:44:07.853907866 +0000
Birth: -

and here’s ls -la of /var/lib/mysql

drwx------  11 mysql root      4096 Aug 17 11:44 .
drwxr-xr-x 107 root  root      4096 Jun 13 17:44 ..
-rw-rw----   1 mysql root        56 Jun 13 17:44 auto.cnf
drwx------   2 mysql mysql     4096 Jun 29  2016 c9
-rw-r--r--   1 mysql root         0 May  2  2016 debian-5.5.flag
-rw-rw----   1 mysql mysql 50331648 Aug 17 11:44 ib_logfile0
-rw-rw----   1 mysql mysql 50331648 Jun 13 17:44 ib_logfile1
-rw-rw----   1 mysql mysql 85983232 Aug 17 11:44 ibdata1
drwx------   2 mysql root      4096 Jun 28 19:57 mysql
-rw-------   1 mysql root         6 Jun 28 19:57 mysql_upgrade_info
drwx------   2 mysql mysql     4096 Jun 28 19:57 performance_schema
drwx------   2 mysql mysql     4096 Jun 13 17:44 phpmyadmin

I start mysql as a part of my runner but I’ve also tried stopping and starting it manually with

sudo service mysql stop && sudo service mysql start

where I get this output

* Stopping MySQL database server mysqld
* Starting MySQL database server mysqld
No directory, logging in with HOME=/!

@dubzaor if you want to output the logfile to text, use this:

sudo tail -1500 /var/log/mysql/error.log > ~/workspace/mysql_error.log    

that will output the last 1500 lines of the error log to a file in your workspace that you can then upload


Has anyone heard anything more from support on this? The last contact we had from them was Thursday night.

This still seems to be an ongoing issue this morning and it’s really holding us back now as our developers can’t start any new projects, and we’re not sure if it’s worth the hassle of temporarily moving to another solution or if this is likely to be fixed soon enough to wait.

If anyone’s managed to solve it themselves or has heard an ETA / any more info from support please let us know!


Nothing here - I started looking at the idea of uninstalling and reinstalling MySQL or MariaDB but actually Maria wouldn’t start up either. I’m don’t have a great deal of knowledge when it comes to diagnosing issues with server-side stuff. What seems weird to me is it doesn’t seem to log any issues anywhere when starting the service.

I’m going to clone the broken workspace a few times and try and play around with it. What’s weird is it only happened on certain workspaces for me that were created during a certain timeframe (I couldn’t give exact dates annoyingly). If I clone older or newer workspaces, those work fine… touch wood.


We’re still looking into it on our side, just finding it tough to replicate on our end. We’ll let you know if we can figure anything out over here.


@bryceito You’re welcome to use one of my workspaces which has the issue. DM me and I’ll let you know the workspace name.