Comments (13)
What error ?
from py-qgis-server.
What error ?
2023-11-28 13:08:23Running as 9001:9001
2023-11-28 13:08:23ERROR: /home/qgis must be writable for user:group 9001:9001
2023-11-28 13:08:23ERROR: You should consider the '--user' Docker option
from py-qgis-server.
This error is rather self explanatory: use the user
docker option or set the QGSRV_USER
to your :
from py-qgis-server.
Setting user to 9001:9001 doesn't change the error. /home/qgis is writable by all users. This is a problem with if [[ ! -w $HOME ]], it returns the wrong exitcode. If I start the image with entrypoint /bin/sh and run the following code I should get exitcode 0, but get 1 (even if I change user to root):
$ [ -w /tmp ]; echo $?
1
$ ls -la /tmp
total 0
drwxrwxrwt 1 root root 40 Nov 7 18:00 .
drwxr-xr-x 1 root root 60 Nov 29 09:03 ..
drwxr-xr-x 3 root root 60 Nov 6 04:16 .cache
drwx------ 2 root root 40 Nov 6 04:16 crssync-QisbHN
drwx------ 2 root root 40 Nov 6 04:16 crssync-gUwQDV
Here is where this was discussed in Alpine:
alpinelinux/docker-alpine#156
from py-qgis-server.
Tests with [ -r ] doesn't seem to work either but most other file tests (-e, -f, -d, etc.) works. Could you make an alternative docker-entrypoint.sh without the troublesome -w and -r tests?
from py-qgis-server.
Setting user to 9001:9001 doesn't change the erro
You missed the point: do not set user to 9001:9001 but set it to the actuel uid:gid of your actual binded directory !
Setting directory root will not work: for security reason the image will not start
Your problem come from the fact the /home/qgis is not writable by the user that run in the container.
You may either:
- Set
user
option to the actual uid:gid of the binded directory (on the host) - Set container env var QGSRV_USER to
uid:gid
of the binded directory (on the host) - Do not bind /home/qgis except if you really want to make Qgis settings persistent wich is not recommended in the context
of a server - (furthemore, you way use the QGIS_OPTIONS_PATH enviironment variable)
Do not use root !
from py-qgis-server.
I havn't binded /home/qgis. Pure image, no mounts.
from py-qgis-server.
I did not try to run the image as root. I was just confirming that the write permission test [ ! -w ] fails even if I'm a superuser (root).
from py-qgis-server.
I havn't binded /home/qgis. Pure image, no mounts.
I don't understand your issue then, the /home/qgis is created at image build with correct uid/gid and has no issue so far.
Please give more details about your environment and the command used to run the image.
from py-qgis-server.
As I said, this is only a problem if running on a host with a docker engine older than 20.10.0.
I copied your image and removed the problematic tests from docker-entrypoint.sh:
https://github.com/Kristianstad/qgis-map-server/pkgs/container/qgis-map-server
With this image I got further, but ended up with another error:
2023-11-29 12:44:53QGSRV_CACHE_ROOTDIR set to /qgis-data
2023-11-29 12:44:53Running as 9001:9001
2023-11-29 12:44:53Running Xvfb
2023-11-29 12:44:53nohup: appending output to '/home/qgis/nohup.out'
2023-11-29 12:44:54OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 6: Operation not permitted
2023-11-29 12:44:54OpenBLAS blas_thread_init: RLIMIT_NPROC 160435 current, 160435 max
2023-11-29 12:44:54OpenBLAS blas_thread_init: pthread_create failed for thread 2 of 6: Operation not permitted
2023-11-29 12:44:54OpenBLAS blas_thread_init: RLIMIT_NPROC 160435 current, 160435 max
2023-11-29 12:44:54OpenBLAS blas_thread_init: pthread_create failed for thread 3 of 6: Operation not permitted
2023-11-29 12:44:54OpenBLAS blas_thread_init: RLIMIT_NPROC 160435 current, 160435 max
2023-11-29 12:44:54OpenBLAS blas_thread_init: pthread_create failed for thread 4 of 6: Operation not permitted
2023-11-29 12:44:54OpenBLAS blas_thread_init: RLIMIT_NPROC 160435 current, 160435 max
2023-11-29 12:44:54OpenBLAS blas_thread_init: pthread_create failed for thread 5 of 6: Operation not permitted
2023-11-29 12:44:54OpenBLAS blas_thread_init: RLIMIT_NPROC 160435 current, 160435 max
2023-11-29 12:44:54Traceback (most recent call last):
2023-11-29 12:44:54 File "/usr/local/bin/qgisserver", line 5, in <module>
2023-11-29 12:44:54 from pyqgisserver.server import main
2023-11-29 12:44:54 File "/opt/local/pyqgisserver/lib/python3.10/site-packages/pyqgisserver/server.py", line 23, in <module>
2023-11-29 12:44:54 from .runtime import run_server
2023-11-29 12:44:54 File "/opt/local/pyqgisserver/lib/python3.10/site-packages/pyqgisserver/runtime.py", line 34, in <module>
2023-11-29 12:44:54 from .qgspool import create_poolserver
2023-11-29 12:44:54 File "/opt/local/pyqgisserver/lib/python3.10/site-packages/pyqgisserver/qgspool.py", line 30, in <module>
2023-11-29 12:44:54 from .qgsworker import QgsRequestHandler
2023-11-29 12:44:54 File "/opt/local/pyqgisserver/lib/python3.10/site-packages/pyqgisserver/qgsworker.py", line 31, in <module>
2023-11-29 12:44:54 from qgis.core import QgsProject
2023-11-29 12:44:54 File "/usr/lib/python3/dist-packages/qgis/__init__.py", line 86, in <module>
2023-11-29 12:44:54 import qgis.gui
2023-11-29 12:44:54 File "/usr/lib/python3/dist-packages/qgis/gui/__init__.py", line 25, in <module>
2023-11-29 12:44:54 from qgis._gui import *
2023-11-29 12:44:54 File "<frozen importlib._bootstrap>", line 1022, in _find_and_load
2023-11-29 12:44:54KeyboardInterrupt
I guess I simply can't run your image on our old hosts anymore (up until 3.30 worked fine).
from py-qgis-server.
Tried the image on a newer host, running docker 23.0.6, and it worked.
from py-qgis-server.
Docker 18 is known te be incompatible with new distros: see https://medium.com/nttlabs/ubuntu-21-10-and-fedora-35-do-not-work-on-docker-20-10-9-1cd439d9921 and HumanSignal/label-studio#3070 (ubuntu 22,04 and bookworm included).
You may try to rebuild the image using debian:bullseye as base image instead ubuntu:22.04 or bookworm
from py-qgis-server.
Ok, thanks.
from py-qgis-server.
Related Issues (20)
- Is it necessary QGIS to use this server? HOT 3
- Abort request to PostgreSQL if the connection pool is full HOT 3
- Missing documentation about new environment variables
- Improve how to use a symlink for a QGIS plugin HOT 2
- implement multiprocessing by adding php proxy/wrapper HOT 4
- Can we have the form UI design in QGIS as HTML in the response in GetFeatureInfo ? HOT 1
- Add a QuickStart mode HOT 2
- Running proxy and workers separately with docker image show argument error HOT 1
- QGSRV_SERVER_ALLOW_HEADERS config does not appear in documentation HOT 1
- Default user when running under k8s is now 9001 breaking volume mounts HOT 5
- How to force py-qgis-server to not use cache for GetCapabilities request ? HOT 9
- Is there a problem in the refresh_cache method ? HOT 8
- customize SVG search path? HOT 3
- We need a docker image with Qgis 3.22 HOT 2
- Qgis: WMS: Download of capabilities failed: SSL handshake failed HOT 2
- Feature request: preload cache ready healcheck HOT 2
- Workers update sequentially HOT 9
- Cannot use WFS3 ogc api HOT 9
- Capabilities to change port HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-qgis-server.