geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
490 stars 260 forks source link

TypeError: DummyManager.execute_process() got an unexpected keyword argument 'subscriber' #1597

Closed anitagraser closed 6 months ago

anitagraser commented 6 months ago

Description

Trying to run the hello-world process from Swagger UI or the command line fails with

TypeError: DummyManager.execute_process() got an unexpected keyword argument 'subscriber'

Steps to Reproduce Steps to reproduce the behavior:

http://localhost:5000/openapi?f=html#/hello-world/executeHello-worldJob

or

curl -X 'POST' \
  'http://localhost:5000/processes/hello-world/execution' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "inputs": {
    "message": "An optional message.",
    "name": "World"
  }
}'

Expected behavior The demo process should run out of the box.

Screenshots/Tracebacks

FO - 127.0.0.1 - - [16/Mar/2024 20:12:38] "POST /processes/hello-world/execution HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/flask/app.py", line 1488, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/flask/app.py", line 1466, in wsgi_app
    response = self.handle_exception(e)
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/flask/app.py", line 1463, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/flask/app.py", line 872, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/pygeoapi/flask_app.py", line 395, in execute_process_jobs
    return get_response(api_.execute_process(request, process_id))
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/pygeoapi/api.py", line 228, in inner
    headers, status, content = func(*args, **kwargs)
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/pygeoapi/api.py", line 210, in inner
    return func(cls, req_out, *args[2:])
  File "/home/agraser/miniconda3/envs/pygeoapi/lib/python3.10/site-packages/pygeoapi/api.py", line 3521, in execute_process
    result = self.manager.execute_process(
TypeError: DummyManager.execute_process() got an unexpected keyword argument 'subscriber'

Environment

Additional context

totycro commented 6 months ago

The PR mentioned above should fix this. For now you could use the TinyDB manager instead of the dummy one as a workaround

The documenation includes an example of how the config for the TinyDB manager can look like here: https://docs.pygeoapi.io/en/latest/configuration.html#reference

anitagraser commented 6 months ago

Awesome, thanks for the tip: simply uncommenting the TinyDB option in the example config did the trick.

DanielMartinPerezdeLeon commented 6 months ago

Hi, it looks like this hasnt be uploaded into the docker-version, will this be availabe soon?