Skip to content

Migrator: couldn't start a new transaction: could not create new transaction: dial tcp [::1]:3306: connect: connection refused #1980

@DorianCoding

Description

@DorianCoding

Checklist

  • I could not find a solution in the existing issues or docs.
  • I agree to follow this project's Code of Conduct.

Describe the bug

Hello I'm following the README: https://github.com/teamhanko/hanko/blob/main/backend/README.md#running-the-backend and on this command:
docker run --mount type=bind,source=<PATH-TO-CONFIG-FILE>,target=/config/config.yaml -p 8000:8000 -it ghcr.io/teamhanko/hanko:latest migrate up
I got :

Status: Downloaded newer image for ghcr.io/teamhanko/hanko:latest
2024/11/23 11:10:21 migrate up
2024/11/23 11:10:21 Using config file: ./config/config.yaml
[POP] 2024/11/23 11:10:21 info - 0.0009 seconds
2024/11/23 11:10:21 Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: dial tcp [::1]:3306: connect: connection refused

I tried with my external database, with a docker mysql database, nothing is working. I have also tried to use the url config:

database:
  url: "mariadb://hanko:MYPASS@localhost:3306/connections"
  user: hanko
  password: MYPASS
  host: localhost # change this if the DB is not running on >
  port: "3306"
  database: connections
  dialect: mariadb  # depending on your choice of DB: postgr>

But I have:

the URL 'mariadb://hanko:MYPASS@localhost:3306/connections' is not supported by MySQL driver: default addr for network 'localhost:3306' unknown

Reproducing the bug

  1. Create the config.yaml like stated above
  2. Create a mysql container with docker or podman (I tried both)
  3. Use the following command above

Logs

No response

Configuration

No response

Hanko Version

sha256:accccb4946e25017133d428b1bb8a2cc17c6f76ea3928862c1617c7b0f809d98

OS Hanko Backend

Linux

OS Version Hanko Backend

Debian GNU/Linux trixie/sid x86_64

OS

Linux

OS Version

Debian GNU/Linux trixie/sid x86_64

Browser Version

No response

Environment

None

Additional Context

I've also disabled the firewall, check the tcpdump. I don't see any attempt to connect anywhere... Connecting with mysql bash works like a charm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions