opengeospatial / ets-ogcapi-processes10

Other
3 stars 3 forks source link

ETS OGCAPI Processes 1.0 test failing - test Job Results: java.lang.AssertionError: Expected status code 200 but found 404 expected [true] but found [false] #68

Closed Koushikey4596 closed 6 months ago

Koushikey4596 commented 1 year ago

Dear Developers,

I am working with ZOO-Project for Google Summer of Code 2023. I am running the test for ogcapi-processes-1.0 using a local host on the web browser.

While running the test for ogcapi-processes-1.0 on the team engine for the ZOO-Project, we are getting following three failed tests:

  1. test Job Results Exception Results Not Ready: java.lang.AssertionError: Failed Abstract test A.46 (Step 4). The document did not contain an exception of type http://www.opengis.net/def/exceptions/ogcapi-processes-1/1.0/result-not-ready expected [true] but found [false]

  2. test Job Results: java.lang.AssertionError: Expected status code 200 but found 404 expected [true] but found [false]

  3. test Job Results Async Raw Value One: java.lang.AssertionError: null

Also, while debugging, I found that build command is producing following output:

...
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:55 +0000] "GET /ogc-api/jobs/06b94cdc-12e7-11ee-80da-0242ac120009 HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:55 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:55 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:56 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:56 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:56 +0000] "GET /ogc-api/jobs/074f1712-12e7-11ee-850f-0242ac120009 HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:56 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:56 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:57 +0000] "GET /ogc-api/jobs/07a24086-12e7-11ee-8c3f-0242ac120009 HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:57 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:57 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:57 +0000] "GET /ogc-api/jobs/07f5058c-12e7-11ee-9d8d-0242ac120009 HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:57 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:58 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:58 +0000] "GET /ogc-api/jobs/08537d6a-12e7-11ee-bcf9-0242ac120009 HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:58 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:58 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:59 +0000] "GET /ogc-api/jobs/08c6784c-12e7-11ee-b8b8-0242ac120009 HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:59 +0000] "GET /ogc-api/jobs/08c6784c-12e7-11ee-b8b8-0242ac120009/results HTTP/1.1" 404 202
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:59 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 500 120
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:59 +0000] "GET /ogc-api/processes/invalid-job-5adb2926-ce83-4f9b-8a09-a7627187fc7a/results HTTP/1.1" 404 245
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:29:59 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 200 174
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:30:00 +0000] "GET /ogc-api/processes/echo HTTP/1.1" 200 2982
zoo-project-zookernel-1  | 172.18.0.5 - - [24/Jun/2023:23:30:00 +0000] "POST /ogc-api/processes/echo/execution HTTP/1.1" 201 202
...

I tried to debug it further by printing the error messages:

zoo-project-teamengine-1  | Body:                       <none>
zoo-project-teamengine-1  | no validation errors :-)
zoo-project-teamengine-1  | no validation errors :-)
zoo-project-teamengine-1  | Entering testJobResults()
zoo-project-teamengine-1  | if condition
zoo-project-teamengine-1  | I am in if condition
zoo-project-teamengine-1  | Status Code: 201
zoo-project-teamengine-1  | Location String: http://zookernel/ogc-api/jobs/cd6b04f8-158d-11ee-aa16-0242ac120009
zoo-project-teamengine-1  | Status Node: {"title":"NoSuchJob","type":"http://www.opengis.net/def/exceptions/ogcapi-processes-1/1.0/no-such-job","detail":"The JobID from the request does not match any of the Jobs running on this server"}
zoo-project-teamengine-1  | Checking error: asynchronous POST request...{"inputs":{"a":"teststring","pause":5},"outputs":{"a":{"transmissionMode":"value"}},"response":"raw"}
zoo-project-teamengine-1  | HTTP Response Content: {"title":"NoSuchJob","type":"http:\/\/www.opengis.net\/def\/exceptions\/ogcapi-processes-1\/1.0\/no-such-job","detail":"The JobID from the request does not match any of the Jobs running on this server"}
zoo-project-teamengine-1  | Job location: http://zookernel/ogc-api/jobs/cdd25e46-158d-11ee-bc92-0242ac120009
zoo-project-teamengine-1  | Checking error: Sending GET request to job location...
zoo-project-teamengine-1  | Checking error: Job results location: http://zookernel/ogc-api/jobs/cdd25e46-158d-11ee-bc92-0242ac120009/results
zoo-project-teamengine-1  | HTTP Response Content: {"title":"NoSuchJob","type":"http:\/\/www.opengis.net\/def\/exceptions\/ogcapi-processes-1\/1.0\/no-such-job","detail":"The JobID from the request does not match any of the Jobs running on this server"}
zoo-project-teamengine-1  | $.jobs: is missing but it is required
zoo-project-teamengine-1  | $.links: is missing but it is required

I have the following doubts:

  1. Why is GET /ogc-api/jobs/... producing a 404 Status response for all the jobs? Could this be the issue for the failing tests?

  2. The same error information is passing for both the status node and HTTP response: The JobID from the request does not match any of the Jobs running on this server.

  3. While printing the executeNode to know the Job ID, the output is in JSON format, stating {"inputs":{"a":"teststring","pause":5},"outputs":{"a":{"transmissionMode":"value"}},"response":"raw"} . How to interpret it?

Please let me know how to solve these issues. I would be grateful.

cc: @gfenoy @omshinde @ghobona

gfenoy commented 1 year ago

For tests that failed:

  1. It is possible that the ZOO-Project wrongly report another type of issue, we can fix this if we are sure. You may try to run the echo service with a long pause value and verify this by yourself from the various tool to execute processes from the UIs available with your ZOO-Project setup
  2. job results may not be yet accessible, we can leave this one as it may be caused by other issues
  3. async raw output is not often used (not to say never) so, it is possible that the ZOO-Project return wrong stuff in the multipart content produced. It would help to execute the request from the UI and see what happen

About your doubt number 1, it may come from a wrong behaviour of the ZOO-Project or a missing configuration parameter (like defining the host as zoo kernel in main.cfg and oas.cfg, but I guess it is not the case as we can see a correct location header). This is definitely the issue causing the test to fail.

As you have the request which is used to execute the service asynchronously, it would be great to debug by hand the ZOO-Project's behaviour for this specific request. You can access the Swagger-ui (available from your browser at http://zookernel/ogc-api/api.html) and execute the request. Then, you can verify from the same UI if the job is then properly accessible or not.

Also, you can always see after the tests run if you can list the jobs and find the one which should have been found by the ETS. In case there is not such a job, it means the issue comes from the ZOO-Project.

About doubt number 3, this is the execute request used to create a new job.

ghobona commented 1 year ago

@Koushikey4596 Could you please provide me with the URL of your API so that I can test it and see the results in detail?

bpross-52n commented 11 months ago

@Koushikey4596 I cannot reproduce this issue with a current instance of the ZOO-Project OGC API - Processes. Please let us know if this is still an issue. Thanks!

dstenger commented 8 months ago

@Koushikey4596 We will close this PR on the 15th of February if there is no objection.