SQLalchemy failure to connect to postgres database
smehra opened this issue · 6 comments
This is out of the box running with docker as shown here
docker run \ -p 8000:8000 -p 3000:3000 -p 8080:8080 \ --add-host=host.docker.internal:host-gateway \ ghcr.io/rashadphz/farfalle:main
Sqlchemy fails to connect:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused backend-1 | Is the server running on that host and accepting TCP/IP connections? backend-1 | connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused backend-1 | Is the server running on that host and accepting TCP/IP connections?
Hey, the Dockerfile doesn't yet support the Postgres database, for now you'll have to use the docker-compose. I'll update you when I add support for this in the Dockerfile.
I have cloned the repo and using Groq with Bing. When I ask a query, it starts generating the answer, however, before the complete answer is generated it shows the following error.
In Inspect element -> console, it says :1 Unchecked runtime.lastError: The message port closed before a response was received.
Hmm, thats weird. Did you modify the database URL in the .env?
Did you modify the database URL in the .env?
Actually, there was a typo in db url earlier, however, I have corrected it and have double checked that I have also enabled DB_ENABLED as true. However, still now I'm getting the following error:
500: (psycopg2.OperationalError) could not translate host name "db" to address: Name or service not known (Background on this error at: https://sqlalche.me/e/20/e3q8)
Do you have the updated docker-compose.dev file?
This part is especially important:
db:
image: postgres:15.2-alpine
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_DB=${POSTGRES_DB:-postgres}
ports:
- "5432:5432"
volumes:
- db_volume:/var/lib/postgresql/data
networks:
- farfalle-network