qgis / qgis-docker

Official Docker image for QGIS Server and Desktop
GNU Affero General Public License v3.0
67 stars 21 forks source link

Incorrect example for PGSERVICEFILE #54

Closed timlinux closed 3 years ago

timlinux commented 3 years ago

In https://github.com/gem/oq-qgis-server/blob/ba9ac5c8faa166831c508a1ade3ece0af1d0214a/docker-compose.yml#L53 you propose to mount the service file into

/etc/postgresql-common/pg_service.conf

But it doesn't work for me, giving service not found when I try to access a layer.

I tested by shelling in to the container and verifying the path for the system service file as per: https://www.postgresql.org/docs/current/libpq-pgservice.html

Inside the container:

dnf install postgresql-devel

Then test for the expected path:

bash-5.0# pg_config --sysconfdir
/etc

The example at https://github.com/gem/oq-qgis-server/blob/master/README.md#postgresql-connection-service-file-optional should also be revised to use /etc rather as per the working snippet from my docker-compose:

     # As per the oq QGIS Server docs at https://github.com/gem/oq-qgis-server/blob/master/README.md#postgresql-connection-service-file-optional but wrong! 
     #- ./pg_conf/pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
     #This works instead
     - ./pg_conf/pg_service.conf:/etc/pg_service.conf:ro
daniviga commented 3 years ago

@mbernasocchi can you please have a look?

timlinux commented 3 years ago

One other note: since you have fedora and Apt based builds these paths may differ between build bases too.

mbernasocchi commented 3 years ago

@timlinux i see dnf install so you're using the old fedora builds which were dropped in #47

can you please confirm that using a new build all warks?

which tag are you using?

timlinux commented 3 years ago

I'm testing now using :stable

Maybe you could update the example docker-compose to use the correct 'preferred' image

timlinux commented 3 years ago

I confirm that the stable uses the path as indicated in the docs as per my notes here:

     # Working path for the pg_service file if using openquake/qgis-server:stable
     # See https://github.com/gem/oq-qgis-server/issues/54
     - ./pg_conf/pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
     # As per the oq QGIS Server docs at https://github.com/gem/oq-qgis-server/blob/master/README.md#postgresql-connection-service-file-optional but wrong! 
     #This works instead for the openquake/qgis-server:3 image
     #- ./pg_conf/pg_service.conf:/etc/pg_service.conf:ro

So just chaning the image reference in your example docker-compose would be a great fix.