Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to database #2

Open
mattkibbler opened this issue Mar 16, 2021 · 4 comments
Open

Unable to connect to database #2

mattkibbler opened this issue Mar 16, 2021 · 4 comments

Comments

@mattkibbler
Copy link

mattkibbler commented Mar 16, 2021

Hi,

I can get this set up and seemingly working correctly after running docker-compose up, when I navigate to http://localhost:20009/ I see the TileMill interface, but when I run the imposm command I get a database error.

Here is the command that I run:

docker exec osm-bright_tilemill_1 imposm -m /osm-bright/imposm-mapping.py --connection postgis://docker:docker@postgis/gis --read --write --optimize --deploy-production-tables /data.osm.pbf

Here is the error that I get:

[12:38:30] ERROR: unable to connect to database. Check your DB settings.
FATAL:  no pg_hba.conf entry for host "172.19.0.2", user "docker", database "gis", SSL off
FATAL:  no pg_hba.conf entry for host "172.19.0.2", user "docker", database "gis", SSL on

I'm not too experienced with Docker so this might be a simple problem I'm not aware of.

Any help would be greatly appreciated.

Thanks.

@hmeine
Copy link
Owner

hmeine commented Mar 16, 2021

Looks like a postgres setup thing, not very docker-related.

Is that maybe the problem just fixed by #1? Are you using the latest master? (I have not used tilemill for a long time anymore, and did not try this setup recently.)

@mattkibbler
Copy link
Author

Yep, I fetched the latest master today, I've just checked and it does have the image: kartoza/postgis:9.5-2.2 line.

I'm not terribly familiar with postgres either. Do you have any suggestions for resolving this?

@CaptainInler
Copy link

Hi all. I came along the same issue. I'm running docker-compose on a server. So maybe this occurs only in this occasion and not when running on a local machine.
I was able to solve this by adding a environment-variable on the docker-compose.yml.
Details see pull request: #3

@hmeine
Copy link
Owner

hmeine commented Mar 11, 2022

Strange. As far as I understand, #3 is about allowing external access to the DB, but the docker exec should work, because the connection should succeed inside the docker setup, right?

I have not used tilemill for a long time, but I have just run the commands I documented in the README on a fresh system (so only using public images etc.), and they still work for me, including the imposm. Oh, got it… I can reproduce this on another system, with the same commands.

Which version of docker-compose do you have? For me, v2.2.3 on MacOS worked (but had dashes in the generated container names, so I might want to update the README) and 1.25.0 on Linux did not work / showed the same error you reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants