dataverse icon indicating copy to clipboard operation
dataverse copied to clipboard

OpenAPI endpoint is broken

Open JR-1991 opened this issue 2 years ago • 11 comments

What steps does it take to reproduce the issue?

The openapi endpoint provided by Payara results in an internal server error in version 6.0. For example, the endpoint does not function on Demo Dataverse (v6.0), although it does on Harvard's Dataverse (v5.14). Click on each link to reproduce the error.

Which version of Dataverse are you using?

Dataverse 6.0

JR-1991 avatar Oct 06 '23 12:10 JR-1991

Thanks for discussing this and opening this OpenAPI/Swagger issue, @JR-1991!

I showed the stacktrace below (from my laptop running 7e0738e, the latest from the develop branch) to @poikilotherm and he found what seems to be a related issue on the Payara side:

  • https://github.com/payara/Payara/issues/6369

@donsizemore found this issue:

  • https://github.com/payara/Payara/issues/6417

Here's the stacktrace: openapi-error.txt

Other open Swagger/OpenAPI issues:

  • #9612

pdurbin avatar Oct 06 '23 13:10 pdurbin

Today @poikilotherm suggested using https://github.com/OpenAPITools/openapi-generator which would not be dependent on Payara (should also work if we switched to Wildfly or OpenLiberty, etc.). Also, it doesn't require the app server to be running.

pdurbin avatar Oct 26 '23 11:10 pdurbin

2024/01/08: Prioritized and moved to Needs Sizing during prioritization meeting.

cmbz avatar Jan 08 '24 20:01 cmbz

2024/01/08: Moved to Needs Sizing during today's prioritization meeting

cmbz avatar Jan 09 '24 01:01 cmbz

As discussed yesterday at tech hours, a simple thing is to ask Payara about how the fix is coming along. I just did this in https://github.com/payara/Payara/issues/6369#issuecomment-1885045621

As switching to output generated from https://github.com/OpenAPITools/openapi-generator none of us have tried that library and we don't have a great sense of how much effort it is.

A major use case for getting /openapi working again is PyDataverse. See "Implementation of core generation based on Swagger/OpenAPI" at https://py.gdcc.io

pdurbin avatar Jan 10 '24 15:01 pdurbin

2024/01/16: Recommendation to create a separate spike (10) to investigate the tool suggested here: https://github.com/IQSS/dataverse/issues/9981#issuecomment-1780921206

cmbz avatar Jan 16 '24 16:01 cmbz

2024/01/16: spike created: https://github.com/IQSS/dataverse/issues/10236

cmbz avatar Jan 16 '24 17:01 cmbz

2024/01/16: Moved to waiting. Work will continue via https://github.com/IQSS/dataverse/issues/10236 while we wait for response from Payara.

cmbz avatar Jan 16 '24 19:01 cmbz

This just in. Someone has come up with a potential fix for Payara:

  • https://github.com/payara/Payara/pull/6563

pdurbin avatar Feb 14 '24 11:02 pdurbin

I just built that PR with this:

sdk use java 11.0.20-tem
mvn clean install -T 16 -PQuickBuild -DskipTests

Then I uploaded it to Google Drive: https://drive.google.com/file/d/17kVKOco86FDKXvs1aBZLq9QBABxO8S5A/view?usp=drive_link

I haven't tested it to see if /openapi works or not.

pdurbin avatar Feb 23 '24 21:02 pdurbin

2024/03/14

  • JP will reference this issue in his PR and when it's closed this issue will be too.

cmbz avatar Mar 13 '24 17:03 cmbz

This just in. Someone has come up with a potential fix for Payara:

  • https://github.com/payara/Payara/pull/6563

This PR was just closed as already fixed. See:

  • https://github.com/payara/Payara/pull/6563#pullrequestreview-1973804792
  • https://github.com/payara/Payara/pull/6546

pdurbin avatar Apr 02 '24 17:04 pdurbin

Payara 6.2024.4 RC1 is just in today. I suppose there will be a new release soon. We should update our version of Payara as it also contains my MPC NPE fix. We can check back again if it started working again.

poikilotherm avatar Apr 02 '24 17:04 poikilotherm

If this is the case we should probably have to decide what to do with #10328 here are a few things to consider:

  • We should remove the endpoints added to serve the spec
  • We should discuss if we keep using the smallrye plugin, according to the documentation shared to us by @poikilotherm if a .yaml or .json file are provided under /WEB-INF the server would provide these files.
  • We still may need to include the changes done to the API methods and the annotations added on this #10328 or the spec will be similar at the one provided at https://dataverse.unc.edu/openapi which shows some of the errors solved, I am not sure how will the spec generated the payara will take this yet, as soon as the new release is up I can test it.

jp-tosca avatar Apr 02 '24 17:04 jp-tosca