Skip to content

mysql plugin: process-compose does not correctly report mysqld status #2518

Closed
@jefft

Description

@jefft

What happened?

The 'mysql' plugin contains a service, such that devbox services up launches mysqld. Unfortunately if mysqld fails for some reason, this isn't reported. The status is always 'Launched', the Age keeps increasing, and exit code is unset:

Image

Steps to reproduce

First, get set up:

cd /tmp
devbox create mysqltest --template mysql
devbox shell    # This will initialize but not start the db

Now to trigger a failure. Let's claim MySQL's port 3306 (if you run MySQL locally it's probably already listening there - that's fine too).
In a second terminal:

nc -l -p 3306   # This will 'hang' listening on 3306. 

Now back in the devbox shell:

devbox services up

The 'mysql' process will stay 'Launched'. Only if you look in 'mysql_logs' will you see evidence that the process actually died.

Image

Command

No response

devbox.json

From the mysql example:

{
  "packages": [
    "mysql80@latest"
  ],
  "shell": {
    "init_hook": [],
    "scripts": {
      "connect_db": [
        "mysql -u devbox_user -p -D devbox_lamp"
      ],
      "test_db_setup": [
        "mkdir -p /tmp/devbox/mariadb/run",
        "export MYSQL_UNIX_PORT=/tmp/devbox/mariadb/run/mysql.sock",
        "devbox services up -b",
        "sleep 5",
        "mysql -u root < setup_db.sql",
        "devbox services stop"
      ]
    }
  }
}

Devbox version

0.14.0

Nix version

nix (Nix) 2.18.5

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions