whythawk / full-stack-fastapi-postgresql

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Nuxt3, Docker, automatic HTTPS and more.
MIT License
231 stars 47 forks source link

ERROR:__main__:(psycopg2.OperationalError) could not translate host name "db" to address #36

Closed Jelle3345 closed 11 months ago

Jelle3345 commented 12 months ago

I followed all instructions in the development-guide however when running docker-compose I run into this error:

test-celeryworker-1 | ERROR:main:(psycopg2.OperationalError) could not translate host name "db" to address: Temporary failure in name resolution test-celeryworker-1 | test-celeryworker-1 | (Background on this error at: https://sqlalche.me/e/20/e3q8) test-celeryworker-1 | WARNING:main:Finished call to 'main.init' after 26.012(s), this was the 3rd time calling it. test-celeryworker-1 | test-celeryworker-1 | INFO:main:Starting call to 'main.init', this is the 4th time calling it. test-backend-1 | ERROR:main:(psycopg2.OperationalError) could not translate host name "db" to address: Temporary failure in name resolution test-backend-1 | test-backend-1 | (Background on this error at: https://sqlalche.me/e/14/e3q8) test-backend-1 | WARNING:main:Finished call to 'main.init' after 35.030(s), this was the 4th time calling it. test-backend-1 | test-backend-1 | INFO:main:Starting call to 'main.init', this is the 5th time calling it.

Jelle3345 commented 12 months ago

I think this is the cause of the error: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 14.8 (Debian 14.8-1.pgdg120+1). However I dont know how to fix it

Jelle3345 commented 12 months ago

Removing all images and rebuilding the project seems to have fixed the problem

turukawa commented 12 months ago

@Jelle3345 Hi ... yes, what you've described is a Docker issue rather than anything relating to the stack. You've got multiple images for PostgreSQL there and Docker got confused. Sometimes just removing all the images and rebuilding solves the problem.