3liz / py-qgis-server

QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
https://docs.3liz.org/py-qgis-server
Mozilla Public License 2.0
68 stars 16 forks source link

Default user when running under k8s is now 9001 breaking volume mounts #59

Closed bjornharrtell closed 1 year ago

bjornharrtell commented 1 year ago

Looks like when I upgrade from 3.26 image to 3.28 I get into trouble because the start up logs says this:

Running as 9001:9001 ERROR: /data do not exists or is not readable

So to me it looks like the changes done at https://github.com/3liz/py-qgis-server/commit/794ca8a2c114557ec2eb0257eb04db94535fa2d3 is causing a breaking change, at least when running on k8s.

bjornharrtell commented 1 year ago

What is your opinion on this @dmarteau?

dmarteau commented 1 year ago

9001:9001 has always been the default user if do not specify QGSRV_USER - or from the --user with docker.

Your error message above come from https://github.com/3liz/py-qgis-server/commit/794ca8a2c114557ec2eb0257eb04db94535fa2d3#diff-7cfc2aa3796f096105480a1a669658cfc12d2688b6300eef89d9ce94eef44e26R75, this test that the directory passed with QGSRV_CACHE_ROOTDIR is indeed writeable instead failing later with more cryptic message.

Tests are using QGSRV_CACHE_ROOTDIR and there was no problems reported from the change above. If you can, check the read permission from inside another running container and report what you get, that would would give us some hints.

bjornharrtell commented 1 year ago

Thanks @dmarteau that makes it a bit more clear.. however I'm still confused how it then can work with the 3.26 image. And even more confused that in my deployment the directory (which is a volume mounted in k8s) seems to be group owner 2004 which I have no clue how it came to be. I.e doing ls -al shows the /data dir entry as follows:

drwxrws--x 3 root 2004 6144 Apr 10 13:33 data

dmarteau commented 1 year ago

my deployment the directory (which is a volume mounted in k8s) seems to be group owner 2004

Sorry I cannot help you with, that

it then can work with the 3.26 image

The 3.26 image has no such check, and I don't know nothing about how k8s handle mounted volumes.

bjornharrtell commented 1 year ago

@dmarteau after some digging it looks that it's likely a peculiarity of an old/obsolete storageclass to make the volume and mount. Sorry for the noise.