Skip to content

MariaDBManager.start() unconditionally runs brew services start, breaking init when MariaDB is already running (Docker/remote) #3

@NagariaHussain

Description

@NagariaHussain

Environment

  • macOS, bench-cli @ dea8638
  • MariaDB 10.6 in Docker on 127.0.0.1:3306 (no local unix socket)

Repro

Have MariaDB already running (Docker, remote, brew formula that's already started, etc.) and run bench init.

Result

Step 2 "Install system packages" fails:

Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 .../homebrew.mxcl.mariadb.plist` exited with 5.

brew's mariadb can't bind 3306, which is already in use.

Root cause

bench_cli/managers/mariadb_manager.py:46start() runs brew services start unconditionally; it doesn't consult is_running() first.

Suggested fix

is_running() already exists; gate on it:

def start(self) -> None:
    if self.is_running():
        return
    if is_macos():
        run_command(["brew", "services", "start", self._brew_package()])
    else:
        run_command(["sudo", "systemctl", "start", "mariadb"])

See also: #4 (@'localhost' grant scope), #5 (admin frontend missing from wheel).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions