jeroenbourgois
I have two repos, and just recently we switched to myxql from mariaex. Since then, when starting the application, the second repo errors out, and seems to use the IP address/hostname of the machine network I am instead of what is supplied in the config.
Surely, there is a tiny mistake I am overlooking, but it is driving me mad.
As a first hint: how would ecto/myxql be able to get a hold of that ip?
For instance, on my local machine, it goes ahead and fetches my public ip (behind ISP router here). Or for the actual app running docker, it has the public IP of the host machine, instead of the actual DB host ip, as configured in the settings. The settings itself seem to be OK, we inspected the sys.config file inside the docker container.
Maybe our supervision tree for the application is not ok, but it worked just fine with mariaex.
children = [
# Start the Ecto repository
supervisor(App.Repo, []),
supervisor(App.RepoDuo, []),
# Start the endpoint when the application starts
supervisor(App.Endpoint, []),
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security











Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
wojtekmach
So both repos use myxql but only the 2nd repo has problems? Could you paste your repos config? Whats the exact issue, its trying to connect to a host that it shouldn’t?
wojtekmach
and if you have any additional repo config in its init/2 callback, please paste that too.
jeroenbourgois
Hard to give too much config away since it is a client project, but I think it is pretty basic. What truly boggles me is the ip address it is trying to connect to. As I said, when I run the release on my local machine, the external IP of my ISP is mentioned (something like ‘78-xxx-xxx-xxx.access.telenet.be’ and if I run it on the actual machine, it shows the public Digital Ocean box IP, instead of the one for the db, supplied by the config).
Both repos have this as a module:
Second:
Then in the config:
Almost as soon as we start the app, we get:
MyXQL.Connection (#PID<0.2640.0>) failed to connect: ** (MyXQL.Error) (1045) (ER_ACCESS_DENIED_ERROR) Access denied for...wojtekmach
Where is the IP mentioned? In your logs from init callback? From the MySQL server error? Both? Are you setting db config in prod.exs or releases.exs? Are you building release with Elixir releases or distillery? What’s your ecto, ecto_sql, and myxql version?
I know it’s related to deployment but if you could build a project that reproduces this, Ill be happy to help.
jeroenbourgois
Yes in the logs. I commented out the other repo from the supervisor and output the
optsthat get in to theinit/2callback of the repo. There it seems fine, but immediately after seeing the log file, the errors come:Just curious: is the supervisor setup ok?
jeroenbourgois
Ok, we got it!
I knew it was going to be something silly, sorry to waste your time a bit. Our generated pwd for the db had a
$in it, and it had to be escaped (in the env file where we export it from). So dumb… but it works now!