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
459 stars 250 forks source link

PyGeoAPI Process: Hello World fail to execute #1656

Closed epifanio closed 1 month ago

epifanio commented 1 month ago

Description testing the process "Hello World" from latest git master fails with an internal server error

Steps to Reproduce Try hello woirld process in the swagger interface

Expected behavior Process to succeed

Screenshots/Tracebacks

pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    |   File "/pygeoapi/pygeoapi/flask_app.py", line 451, in execute_process_jobs
pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    |     return execute_from_flask(processes_api.execute_process, request,
pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    |   File "/pygeoapi/pygeoapi/flask_app.py", line 160, in execute_from_flask
pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    |     headers, status, content = api_function(api_, api_request, *args)
pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    |   File "/pygeoapi/pygeoapi/api/processes.py", line 407, in execute_process
pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    |     result = api.manager.execute_process(
pygeoapi_pygeoapi.1.8bbkebyl4y96@pygeoapi    | TypeError: DummyManager.execute_process() got an unexpected keyword argument 'requested_outputs'

Environment

francescoingv commented 1 month ago

@epifanio Thank you. Just submitted a PR ( #1657) to fix the problem.

epifanio commented 1 month ago

Hi, thanmks for the fix - but I am now facing the same issue when starting pygeoapi after a rebuild using git masrer:

pygeoapi_pygeoapi.1.84wuau3q8jy5@pygeoapi    |   File "/pygeoapi/pygeoapi/api/processes.py", line 407, in execute_process
pygeoapi_pygeoapi.1.84wuau3q8jy5@pygeoapi    |     result = api.manager.execute_process(
pygeoapi_pygeoapi.1.84wuau3q8jy5@pygeoapi    | TypeError: DummyManager.execute_process() got an unexpected keyword argument 'requested_outputs'

I will attempt a rebuild without cache ..

francescoingv commented 1 month ago

Hi @epifanio , it works fine for me following the directions in pygeoapi.io Install in 5 minutes

python3 -m venv pygeoapi
cd pygeoapi
. bin/activate
git clone https://github.com/geopython/pygeoapi.git
cd pygeoapi
pip3 install -r requirements.txt
python3 setup.py install
cp pygeoapi-config.yml example-config.yml
vi example-config.yml  # edit as required
export PYGEOAPI_CONFIG=example-config.yml
export PYGEOAPI_OPENAPI=example-openapi.yml
pygeoapi openapi generate $PYGEOAPI_CONFIG --output-file $PYGEOAPI_OPENAPI
pygeoapi serve

After the last command ($ pygeoapi serve) I opened another terminal and issued the request using curl:

$ curl localhost:5000/processes/hello-world/execution -H 'Content-Type: application/json'     -d '{"inputs": {"message": "Messaggio", "name": "Mondo"}}'
{
    "id":"echo",
    "value":"Hello Mondo! Messaggio"
}

and the following is the log on the server:

$ pygeoapi serve
 * Serving Flask app 'pygeoapi.flask_app'
 * Debug mode: on
[2024-05-17T10:59:28Z] {/my_test_dir/pygeoapi/lib/python3.11/site-packages/werkzeug/_internal.py:97} INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5000
 * Running on http://_my_local_ip_:5000
[2024-05-17T10:59:28Z] {/my_test_dir/pygeoapi/lib/python3.11/site-packages/werkzeug/_internal.py:97} INFO - Press CTRL+C to quit
[2024-05-17T10:59:28Z] {/my_test_dir/pygeoapi/lib/python3.11/site-packages/werkzeug/_internal.py:97} INFO -  * Restarting with stat
[2024-05-17T10:59:29Z] {/my_test_dir/pygeoapi/lib/python3.11/site-packages/werkzeug/_internal.py:97} WARNING -  * Debugger is active!
[2024-05-17T10:59:29Z] {/my_test_dir/pygeoapi/lib/python3.11/site-packages/werkzeug/_internal.py:97} INFO -  * Debugger PIN: 122-116-240
[2024-05-17T10:59:37Z] {/my_test_dir/pygeoapi/lib/python3.11/site-packages/werkzeug/_internal.py:97} INFO - 127.0.0.1 - - [17/May/2024 10:59:37] "POST /processes/hello-world/execution HTTP/1.1" 200 -

Please report if the problem was solved or it persists with detailed steps to reproduce.

epifanio commented 1 month ago

Thanks @francescoingv it works here as well, my docker swarm required me to build-push-pull the freshly built image - then all worked as expected.