Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS - DevLake ERROR: >>> Mysql failed to connect #800

Closed
2 tasks
e2corporation opened this issue Nov 16, 2021 · 4 comments
Closed
2 tasks

macOS - DevLake ERROR: >>> Mysql failed to connect #800

e2corporation opened this issue Nov 16, 2021 · 4 comments
Labels
devops Something about CI/CD (devops) type/feature-request This issue is a proposal for something new

Comments

@e2corporation
Copy link
Contributor

Lake / Docker / Mac OS + MySQL

Users / Developers in a Mac OS Environment are unable to start Lake with docker-compose up due to a bad MySQL TCP Connection string. To resolve this issue for Mac OS and potentially other environments, please see the steps below.

SOLUTION STEPS

  • Update MySQL Docker Configuration in docker-compose.yml SET container_name
    • Define a CONTAINER NAME For the MySQL Instance eg. container_name: lakeMYSQL
  • Update Dev Lake's DB_URL Connection String to use Container Name and NOT localhost
    • DB_URL=merico:merico@tcp(lakeMYSQL:3306)/lake?charset=utf8mb4&parseTime=True

Screen Shot 2021-11-16 at 10 47 11 AM

To Reproduce

Steps to reproduce the behavior:

  1. Go to DevLake project folder (lake) running main branch
  2. Run docker-compose up to start services
  3. Notice the Go Init Model fails to connect /app/models/init.go:31
  4. DevLake Issues Panic Error and exits with Code 2

Expected behavior

DevLake should startup successfully and connect to the MySQL Service instance when running docker-compose up instead of throwing panic errors.

Screenshots

BEFORE
Screen Shot 2021-11-16 at 10 20 49 AM

AFTER PROPOSED SOLUTION
Screen Shot 2021-11-16 at 10 32 47 AM

Additional context

Please see a similar issue below on StackOverflow for addtional context with regard to Go and Docker.
https://stackoverflow.com/questions/52504318/unable-to-connect-to-mysql-server-with-go-and-docker-dial-tcp-127-0-0-13306

@e2corporation e2corporation added type/bug This issue is a bug priority/medium This issue is medium important devops Something about CI/CD (devops) labels Nov 16, 2021
@e2corporation
Copy link
Contributor Author

macOS Catalina 10.15.7 (19H2)
Docker version 20.10.8, build 3967b7d
go version go1.16.5 darwin/amd64

@e2corporation e2corporation removed the priority/medium This issue is medium important label Nov 16, 2021
@e2corporation
Copy link
Contributor Author

This may be specific to my env, will close if it is an isolated incident or due to bad docker cache.

@e2corporation e2corporation added type/feature-request This issue is a proposal for something new testing and removed type/bug This issue is a bug labels Nov 16, 2021
@kevin-kline
Copy link
Contributor

This may be specific to my env, will close if it is an isolated incident or due to bad docker cache.

To add to this discussion, I verified the "User Setup" flow on my machine (as described in our main README). I'm on an M1 Mac, and I do not run into this error. Maybe we can close this one on that basis.

@klesh klesh mentioned this issue Nov 23, 2021
5 tasks
@klesh
Copy link
Contributor

klesh commented Nov 23, 2021

@e2corporation Would you like to try pinging mysql on your host machine?

@klesh klesh closed this as completed Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Something about CI/CD (devops) type/feature-request This issue is a proposal for something new
Projects
None yet
Development

No branches or pull requests

3 participants