lmakarov / dde

[DEPRECATED] Docker and Docker Compose based environment for Drupal
MIT License
128 stars 37 forks source link

Site instance "goes away" #161

Closed kyleskrinak closed 8 years ago

kyleskrinak commented 8 years ago

Site instance will "go away" after an indeterminate period of time, roughly in the 2 - 10 minute range.

If I try, say, dsh drush cc all I'll be met with

dsh: Unable to connect to the Docker daemon via 'tcp://192.168.10.10:2375'
Drude VM may not be running. It can be started with 'dsh up'

If I do dsh up I see:

dsh: Starting vagrant vm...
Using nfs2 synced folder option
Bringing machine 'boot2docker' up with 'virtualbox' provider...
==> boot2docker: Checking if box 'blinkreaction/boot2docker' is up to date...
==> boot2docker: VirtualBox VM is already running.
==> boot2docker: [vagrant-hostsupdater] Checking for host entries
Starting services...
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

Perhaps incorrectly, I'll run

vagrant halt && dsh up

To return my docker instances to a running state. However, the site remains unstable and I'll have to repeat this process.

Looking at the logs,

web reports:

web_1  | [Tue Aug 23 18:00:29 2016] [info] Server built: Aug 18 2015 09:49:50
web_1  | [Tue Aug 23 18:01:21 2016] [info] removed PID file /var/run/apache2.pid (pid=1)
web_1  | [Tue Aug 23 18:01:21 2016] [notice] caught SIGTERM, shutting down
web_1  | [Tue Aug 23 18:01:21 2016] [alert] FastCGI: read() from pipe failed (0)
web_1  | [Tue Aug 23 18:01:21 2016] [alert] FastCGI: the PM is shutting down, Apache seems to have disappeared - bye

db:

db_1   | 160823 18:00:28 [Note] mysqld (mysqld 5.5.46-log) starting as process 1 ...
db_1   | cp: cannot stat '/opt/my.cnf.d/*.cnf': No such file or directory

cli:

cli_1  | 2016-08-23 18:00:33,743 INFO success: php5-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
cli_1  | 2016-08-23 18:01:20,484 WARN received SIGTERM indicating exit request
cli_1  | 2016-08-23 18:01:20,484 DEBG killing php5-fpm (pid 26) with signal SIGTERM
cli_1  | 2016-08-23 18:01:20,504 INFO waiting for sshd, php5-fpm to die
cli_1  | 2016-08-23 18:01:20,532 INFO stopped: php5-fpm (exit status 0)
cli_1  | 2016-08-23 18:01:20,533 DEBG received SIGCLD indicating a child quit
cli_1  | 2016-08-23 18:01:20,533 DEBG killing sshd (pid 25) with signal SIGTERM
cli_1  | 2016-08-23 18:01:20,551 DEBG fd 9 closed, stopped monitoring <POutputDispatcher at 140010024134128 for <Subprocess at 140010024424440 with name sshd in state STOPPING> (stderr)>
cli_1  | 2016-08-23 18:01:20,551 DEBG fd 7 closed, stopped monitoring <POutputDispatcher at 140010024132904 for <Subprocess at 140010024424440 with name sshd in state STOPPING> (stdout)>
cli_1  | 2016-08-23 18:01:20,551 INFO stopped: sshd (exit status 0)
cli_1  | 2016-08-23 18:01:20,552 DEBG received SIGCLD indicating a child quit

version info

dsh version: 1.20.3 Boot2Docker-cli version: v1.8.0

lmakarov commented 8 years ago

@kyleskrinak that's a weird one and won't be easy to debug.

When did this start?

I would kill the VM and start fresh. This would be the easiest and fastest approach.

kyleskrinak commented 8 years ago

I've deleted boot2docker and used dsh install boot2docker to add it back. I'm at 30 minutes in, no problems so far. If this fixes it, boy, that was easy. I'll close this if I remain uninterrupted after an hour.

Update: my instances continue to "go away," despite the new VM.

kyleskrinak commented 8 years ago

I've switched to Acquia Dev Desktop — and I'm experiencing a similar problem. The MySQL instance stops, though the stack is far more stable than my drude dev environment. Much of this is concurrent with recent VirtualBox and Vagrant upgrades. This might be an issue with my system?

lmakarov commented 8 years ago

@kyleskrinak when you say the MySQL instance stops, do you see something like "MySQL server has gone away" error or something else?

kyleskrinak commented 8 years ago

No:

PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (61) in lock_may_be_available() (line 167 of /Users/kds38/Documents/devdesktop/phyoriginal/includes/lock.inc).

Whether it's Drude or, now, Acquia Dev Desktop, the MySQL server crashes.

I fired up the drude instance again and let the site run. I open a dsh bash db so I can tail -f /var/log/mysql.err output. However, the db instance goes away, and I see this:

Version: '5.5.46-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) read tcp 192.168.10.1:57159->192.168.10.10:2375: read: operation timed out

That's when I have to vagrant halt && dsh up

lmakarov commented 8 years ago

I think you are seeing two distinct issues with Drude and Acquia Dev Desktop, as the latter one does not use any VMs/Docker.

Try removing all network adapters in VirtualBox - https://github.com/blinkreaction/boot2docker-vagrant/blob/develop/docs/troubleshooting.md#various-networking-issues

One note - use dsh logs db to see DB logs. Logs are streamed into stdout in containers where docker picks them up. Also, you can use dsh reload to reload restart the VM and containers instead of vagrant halt && dsh up.

kyleskrinak commented 8 years ago

Thanks @lmakarov the network adapter removal fixed the problem.