geopython / geopython/pygeoapi

gunicorn/gevent version mismatch on pygeoapi Docker Image:

Open
#2,221 6 comments 0 reactions 3 assignees Claimed by @jorgejesus View on GitHub
bug
Dominant language
Python
Stars
624
Forks
326
Avg merge
8h 25m
Merged PRs (30d)
2

Description

**Description**
See https://github.com/geopython/demo.pygeoapi.io/issues/76 where error first reported.

**Steps to Reproduce**
pull latest docker image, try to start.

**Expected behavior**
clean startup

**Screenshots/Tracebacks**

There is now a constant restart of the above containers (who share the same image).
But the error looks more internal, a version mismatch due to some upgrade, so looks like an issue for pygeoapi itself:

```
$ docker logs --follow pygeoapi_master

START /entrypoint.sh
Default config in /pygeoapi/local.config.yml
Trying to generate openapi.yml
/usr/lib/python3/dist-packages/pyproj/crs/crs.py:1293: UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
proj = self._crs.to_proj4(version=version)
Generating /pygeoapi/local.openapi.yml
Done
openapi.yml generated continue to pygeoapi
Starting gunicorn name=pygeoapi on 0.0.0.0:80 with 4 workers and SCRIPT_NAME=/master

Error: class uri 'gevent' invalid or not found:

[Traceback (most recent call last):
File "/venv/lib/python3.12/site-packages/gunicorn/util.py", line 110, in load_class
mod = importlib.import_module('.'.join(components))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/venv/lib/python3.12/site-packages/gunicorn/workers/ggevent.py", line 18, in
raise RuntimeError("gevent worker requires gevent 24.10.1 or higher")
RuntimeError: gevent worker requires gevent 24.10.1 or higher
]
```

**Environment**
- OS: Noble Docker image
- Python version: 3.12
- pygeoapi version: latest

**Additional context**
See https://github.com/geopython/demo.pygeoapi.io/issues/76 where error first reported.

Quick analysis: the version mismatch is probably caused by a mix of installments for gunicorn and gevents in the pygeoapi Dockerfile. A mix of a Ubuntu/Debian package [gevent 24.2.1](https://github.com/geopython/pygeoapi/blob/master/Dockerfile#L98) and a pypi install [gunicorn 24.1.1](https://github.com/geopython/pygeoapi/blob/master/Dockerfile#L136). The latter was [updated 4 days ago](https://github.com/benoitc/gunicorn/releases/tag/24.1.1), just inbetween two pygeoapi build/deploys....

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.