go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.28k stars 194 forks source link

tegola + postgresql13: could not register providers: Failed while creating connection pool: unknown authentication type: 10 #748

Closed r4naf closed 2 years ago

r4naf commented 3 years ago
  1. Operating System: CentOS Linux 8
  2. Kernel: Linux 4.18.0-240.15.1.el8_3.x86_64
  3. PostgreSQL 13.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit
  4. POSTGIS="3.1.1 aaf4c79" [EXTENSION] PGSQL="130" GEOS="3.9.0-CAPI-1.16.2" SFCGAL="1.3.7" PROJ="7.2.1" GDAL="GDAL 3.2.1, released 2020/12/29" LIBXML="2.9.7" LIBJSON="0.13.1" LIBPROTOBUF="1.3.0" WAGYU="0.5.0 (Internal)" TOPOLOGY RASTER
  5. Tegola version v0.12.1
  6. I have installed the Bonn base. Things are good.
  7. config.toml = https://tegola.io/documentation/getting-started/#3-create-a-configuration-file. I made different settings - it does not help.

Hello! Unfortunately, I can't connect the software with the database server PostgreSQL 13.2. An error is written: Error: could not register providers: Failed while creating connection pool: unknown authentication type: 10 What am I doing wrong? Help, I really want to tegola. I also have Ubuntu 20.04. I'll try on it. But there is also version PostgreSQL 13.2.

112

r4naf commented 3 years ago

Ubuntu 20.04 - all ok! 113

ARolek commented 3 years ago

@r4naf thanks for the report. I will need to dig into what the code 10 type is. It might be time to upgrade the Postgres driver.

gdey commented 3 years ago

It looks like we need to upgrade the Postgres drivers. I think type 10 is a new encryption scheme (scram-sha-256) that is now the default in 13.

https://www.postgresql.org/docs/10/auth-methods.html https://stackoverflow.com/questions/64210167/unable-to-connect-to-postgress-db-due-to-the-authentication-type-10-is-not-suppo

ARolek commented 3 years ago

@gdey excellent. That driver is due for an upgrade. The newest version of pgx is a bit of a rework but it should not be too crazy. I know @ear7h has done the upgrade before.

dBitech commented 2 years ago

What "rework" issues do you forsee? I just bumped to pgx4 v4.130.0 in my dev and some quick poking around and testing, I'm not seeing anything not working as expected

ARolek commented 2 years ago

@dBitech mainly the connection pool instantiation. There are likely some other APIs that were removed. Would you want to work on this upgrade? I don't think it's very involved and I'm happy to support it.

dBitech commented 2 years ago

@ARolek I could look at this yes, but it would be several weeks before I have any openings to devote time to looking at this in depth

ARolek commented 2 years ago

@dBitech I'm in a similar situation, though I might be able to address it earlier. I don't think it's going to be a bad cutover, though you never really know... ;-)

ghost commented 2 years ago

I also got the same error, is there any way to fix it?

`D:\tegola>tegola.exe serve --config=config.toml 2021-12-18 00:36:55 [INFO] root.go:63: Loading config file: config.toml 2021-12-18 00:36:55 [INFO] config.go:309: loading local config (config.toml) Error: could not register providers: Failed while creating connection pool: unknown authentication type: 10 Usage: tegola serve [flags]

Aliases: serve, server

Flags: -h, --help help for serve -n, --no-cache turn off the cache -p, --port string port to bind tile server to (default ":8080")

Global Flags: --config string path or http url to a config file, or "-" for stdin (default "config.toml")

could not register providers: Failed while creating connection pool: unknown authentication type: 10

D:\tegola> ` I also edited the pg_hba.conf but it doesn't work.

`# TYPE DATABASE USER ADDRESS METHOD

"local" is for Unix domain socket connections only

local all all trust

IPv4 local connections:

host all all 127.0.0.1/32 trust

IPv6 local connections:

host all all ::1/128 scram-sha-256

Allow replication connections from localhost, by a user with the

replication privilege.

local replication all trust host replication all 127.0.0.1/32 trust host replication all ::1/128 trust `

ARolek commented 2 years ago

@anhln8x yes, we need to upgrade to pgx v4. Would you be interested in helping with this effort? We absolutely want to get this upgrade done, but it requires updating the postgis data provider and a good deal of testing.

ARolek commented 2 years ago

A pull request has been submitted to address this issue. It would be great to have some help running some QA tests. Please feel free to pull down and build the code.

gregorwebdev commented 2 years ago

this answer worked for me to fix the problem, but it's a security downgrade: https://stackoverflow.com/questions/64210167/unable-to-connect-to-postgres-db-due-to-the-authentication-type-10-is-not-suppor

ARolek commented 2 years ago

@gregorwebdev the current PR I mentioned above is addressing this issue. We're close to polishing out the details. You can try the code if you're interested and you won't need to downgrade security.