Gitea: [E] Failed to initialize ORM engine: dial tcp 127.0.0.1:5432: connect: connection refused

Created on 1 May 2018  路  5Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.4 Docker Image
  • Git version: What ever is in the 1.4 Docker Image
  • Operating system: Docker running on Ubuntu Xenial
  • Database (use [x]):

    • [x] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [x] Not relevant

  • Log gist:
    Unneccesary, the log exclusively consists of the title of this issue

    Description

Hello,
I'd normally not open an issue for this but I am at a loss. I've been able to run gitea optimally in this setup, I don't know when it broke because I haven't been using gitea for a while, but my database can not be connected for some reason. It's a postgres running on the host the docker image is on, which has worked fine for almost a year. Gitea also worked perfectly otherwise.

Since I have no clue where to go from here (I've tried all in my might to solve this myself.) I'm very much open to questions regarding my setup.

kinquestion

Most helpful comment

you need to use linked postgresql container name to connect to database from gitea for example postgres:5432

All 5 comments

127.0.0.1 is different from inside the docker container vs 127.0.0.1 on the host.

you need to use linked postgresql container name to connect to database from gitea for example postgres:5432

Oh yeah, I should have mentioned. That was the previous setup which resulted in a different error of the machine unable to find the database on a wildly different port, port 53 for some reason. And I did doublecheck the config.

port 53 is DNS which means that postgres is probably not what you are using for hostname. Try plugging in the IP of the DB server instead. For instance on my home network my DB is at 192.168.1.201, ipconfig is a command you can run to find what the IP is.

@Aetheros I'm going to close this issue now, however please feel free to re-open it if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonasfranz picture jonasfranz  路  3Comments

cookiengineer picture cookiengineer  路  3Comments

lunny picture lunny  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

thehowl picture thehowl  路  3Comments