Closed sakonn closed 4 years ago
hello, I have also run into the same problem as you :)
actually it is not about connection or anything else and the main problem is that gotrue does not migrate database when you run it as an API
it uses cobra to manage running database migrations therefor after your compose is running you can manually migrate the database by using
./gotrue migrate
docker run --rm gotrue gotrue migrate
this worked for me :)
Actually this needs to be in the documentation it could be impossible to figure out for someone who does not use GO :)
Thanks @Hamzali and @sakonn , I've added a note in https://github.com/netlify/gotrue/pull/246
- Do you want to request a feature or report a bug? Report a bug
- What is the current behavior? I am not able to connect to db from the docker container.
- If the current behavior is a bug, please provide the steps to reproduce. I have cloned the repository and started it by following docker compose file:
When I start container I can connect to the url:
http://localhost:8081/settings
without complications. This is my db configuration:When I try to make request to the database verify/signup.... I get the error
level=error msg="500: Database error finding user" component=api error="error finding user: mysql select one: Error 1045: Access denied for user ''gotrue'@'192.168.176.6' (using password: NO)" method=POST path=/signup
Confusing point on this is that phpmyadmin is able to comunicate with databse properly and also when I run gotrue without container (and database in the container) it works fine.
- What is the expected behavior? Being able to connect to database from docker container.
- Please mention your Go version, and operating system version. GO:
go version go1.13.8 linux/amd64
OS:Distributor ID: LinuxMint Description: Linux Mint 19.3 Tricia Release: 19.3 Codename: tricia
Docker:Docker version 19.03.6, build 369ce74a3c
Docker-compose:docker-compose version 1.25.3, build d4d1b42b