martin: Cant retrieve connection from the pool: Timed out in bb8
Hi all. Just started on this mapping tools quest š Iām not being able to solve what seems to be a simple issue with martin.
I have my postgres bd running (OSM is the bd name), it is already fed with data coming from osm2pgsql with flex output. No issues there. It has a points, lines, polygons table with geometries. Now i want to serve my vector tiles with martin š
Iām on windows 10, my postegres is running on a local server on ubuntu.
Running on terminal:
PS C:\Users\[user]\Desktop\martin> .\martin.exe -c .\config.yaml
On yaml file I have:
connection_string: "postgres://postgres:[pass]@[local_ip_for_ubuntu]:5432/OSM"
default_srid: 4326
listen_addresses: "0.0.0.0:4000"
Iāve tried without the config file, using connection string on the terminal. Same output:
[2022-11-29T16:13:46Z INFO martin] Starting Martin v0.6.1
[2022-11-29T16:13:46Z INFO martin] Using .\config.yaml
[2022-11-29T16:13:46Z INFO martin::pg::db] Connecting to database
[2022-11-29T16:14:16Z ERROR martin] Can't retrieve connection from the pool: Timed out in bb8
I can connect just fine with pgadmin to the bd, and I ran the osm2pgsql process on this windows machine with output going to this same bd. I can“t seem to make this work. What am I missing? Thanks in advance.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 55 (33 by maintainers)
Commits related to this issue
- Improve SSL support (#567) This is a partial fix for #496 * BREAKING: Now Martin behaves the same way as `psql` -- by default, if SSL is available on the server, it will be used, even though it w... — committed to maplibre/martin by nyurik a year ago
- Switch bb8 to DeadPool (#570) DeadPool seem to be better maintained, and most importantly, it properly reports connection errors - something bb8 does not support yet. I also removed connection ti... — committed to maplibre/martin by nyurik a year ago
I think I finally was able to reliably reproduce it. The issue (suprise!) is related to SSL ā I need to disable hostname verification during SSL handshake. Secondary issue was upstream ā https://github.com/djc/bb8/issues/151 ā thatās why no errors were being reported, instead giving a silly ātimeoutā.
I will fix this in the next few days, and republish, possibly backporting it to 0.6.0 too.
I just merged the fix to main, could someone with this issue try it? Note that you would need to either use the
maplibre/martin:maindocker image or usecargo run --features ssl --release -- postgres://...to build it locally. Thanks!CC: @IceMan1910 @CarlosZiegler @carlosrziegler @ItsCoolOnMars @dwweb0309
@dwweb0309 ah, you forgot to share the file with the docker container itself, and doing the same thing as tileserve-gl wouldnāt help here.
try this:
from the dir that contains your config file (or specify the full path in
-vparam. This way you share the file with the docker container, and it can read it.my plan to fix this:
psqlssl modesI have the same error right now if try to connect to an external DB ( Google Cloud ). PGAdmin works fine with the same string connection.