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

fix: #800 #846

Closed
wants to merge 1 commit into from
Closed

fix: #800 #846

wants to merge 1 commit into from

Conversation

yihong0618
Copy link

fix: bug docker-compose can not up in some env like mac or wsl

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation
  • This PR is using a label (bug, feature etc.)
  • My code is has necessary documentation (if appropriate)
  • I have added any relevant tests
  • This section (⚠️   Pre Checklist) will be removed when submitting PR

@klesh
Copy link
Contributor

klesh commented Nov 23, 2021

@yihong0618 Thanks for your contribution.
Issue #800 was classified as a isolated incident, if you ran into same situation, please describe your situation on issue comment.
We have to understand why it's happening, and how common it's among our users, before we can approve any PR regarding the issue.

@yihong0618
Copy link
Author

@klesh yes I had run into the same issue. And my env is win10 wsl
Because the docker network problem mysql could not connect using docker-compose
e.g.
image

@yihong0618
Copy link
Author

And I search the isssues and try to rename the DB_URL the problem solved

@klesh
Copy link
Contributor

klesh commented Nov 23, 2021

@yihong0618 I see, can u post the origin configuration which can reproduce the problem?

@yihong0618
Copy link
Author

yihong0618 commented Nov 23, 2021

I just follow the doc
https://github.com/merico-dev/lake/blob/main/.env.example

git clone https://github.com/merico-dev/lake.git devlake
cd devlake
cp .env.example .env
docker-compose up # without -d

@klesh
Copy link
Contributor

klesh commented Nov 23, 2021

I wonder why mysql was resolved to 127.0.0.1?
Can u do a ping mysql both on your host machine and config-ui container and post the output here?

@yihong0618
Copy link
Author

yihong0618 commented Nov 23, 2021

I wonder why mysql was resolved to 127.0.0.1?

Can u do a ping mysql both on your host machine and config-ui container and post the output here?

will so it later.

https://stackoverflow.com/questions/52504318/unable-to-connect-to-mysql-server-with-go-and-docker-dial-tcp-127-0-0-13306

@klesh yes you are right, I can ping mysql in my host machine.
image

@e2corporation
Copy link
Contributor

@yihong0618 If the issue you are describing is similar to #800, you should not have to add an environment block to docker-compose.yml

In your .env file the DB_URL is set there, the TCP connection string uses a hostname reference of mysql. So you just need to define the container_name property in your local docker-compose.yml that matches the name in the connection string, ie container_name=mysql. If you opted to use lakeMYSQL like suggested on ticket #800, you have to make the change in both places as well.

Also ensure you don't have another MySQL service running on your host machine on port 3306.

@yihong0618
Copy link
Author

@yihong0618 If the issue you are describing is similar to #800, you should not have to add an environment block to docker-compose.yml

In your .env file the DB_URL is set there, the TCP connection string uses a hostname reference of mysql. So you just need to define the container_name property in your local docker-compose.yml that matches the name in the connection string, ie container_name=mysql. If you opted to use lakeMYSQL like suggested on ticket #800, you have to make the change in both places as well.

Also ensure you don't have another MySQL service running on your host machine on port 3306.

Agreed but IMO users who use docker-compose want to quick start the repo,and take a look.
So I change only the compose file. About .env I think the may not only use for compose-yml

@e2corporation
Copy link
Contributor

@yihong0618 Thanks again for the PR proposal, our team will need to do more QA/testing with a Windows / win10 environment + wsl to determine the best default configuration that works out of the box for all environments. For now we'll have to decline this PR as it doesn't fully address the underlying issue which is that the DB_URL connection string will vary if you are starting lake as a User vs Developer.

Also please note that our READMEs on the project mention that there is a different value for the MySQL hostname whether you are running lake as a user vs developer. (mysql:3306 vs 127.0.0.1:3306)

For your local environment feel free to continue using your workaround mentioned on this ticket until our team has had a chance to review issues regarding windows environments in general.

@joncodo @klesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants