mysql in docker only works when changing folder name

Viewed 22

I was working on a project that uses docker-compose to bring up a container with a REST API (python) and another with a mysql db. The API exposes an endpoint that calls the db (sqlalchemy). At some point, I started getting this error when calling the API:

sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1130, "192.168.80.1' is not allowed to connect to this MySQL server")
(Background on this error at: https://sqlalche.me/e/14/e3q8)

Then, I cloned a similar project that uses the same libraries for everything and it worked. After this, I spent the next 6 hours in a ship-of-theseus-like effort turning the working project into my own project, and it still worked. What I found out in the end is if I change the folder name of my existing, non-functional project, it will start functioning.

Additional information:

  • Every time I ran docker, I made sure to remove everything by running it in this fashion:
docker system prune -a && docker-compose up --build --force-recreate
  • When copying my broken project into a new location, it was still broken
  • When copying my broken project into a new location, but changing its folder name afterwards, it would work

My question is - is there any form of caching that I don't know about that maybe gets invalidated when I change the folder name? Or is there another problem that I'm overlooking?

0 Answers
Related