dockstore / dockstore

Our VM/Docker sharing infrastructure and management component
https://dockstore.org/
Apache License 2.0
116 stars 27 forks source link

500 error when retrieving tools table for CWL workflow with NaN values #5911

Open kathy-t opened 1 week ago

kathy-t commented 1 week ago

Describe the bug During community lead, there were 500 errors in the logs when retrieving the tools JSON table for this CWL workflow https://dockstore.org/workflows/github.com/EiffL/TXPipe:master?tab=info.

127.0.0.1 - - [14/Jun/2024:12:16:16 +0000] "GET /workflows/6503/tools/17033 HTTP/1.0" 500 110 "https://dockstore.org/workflows/github.com/EiffL/TXPipe:master?tab=info" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0" 18

The stack trace:

2024-06-14T08:16:16.494-04:00   java.lang.IllegalArgumentException: NaN is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialFloatingPointValues() method.
2024-06-14T08:16:16.494-04:00   at com.google.gson.Gson.checkValidFloatingPoint(Gson.java:402)
...

2024-06-14T08:16:16.494-04:00   at com.google.gson.Gson.toJson(Gson.java:661)
2024-06-14T08:16:16.494-04:00   at io.dockstore.webservice.languages.CWLHandler.parseWithClass(CWLHandler.java:557)
2024-06-14T08:16:16.494-04:00   at io.dockstore.webservice.languages.CWLHandler.parseWorkflow(CWLHandler.java:566)
2024-06-14T08:16:16.494-04:00   at io.dockstore.webservice.languages.CWLHandler.getContent(CWLHandler.java:448)
2024-06-14T08:16:16.494-04:00   at io.dockstore.webservice.resources.WorkflowResource.getTableToolContent(WorkflowResource.java:1523)

The primary descriptor does indeed have NaN values such as this line https://github.com/EiffL/TXPipe/blob/188559a2c810f6f720e27a22d33a5de7530c1faa/pipeline.cwl#L37 which causes the parsing to fail on the toJson call on this line https://github.com/dockstore/dockstore/blob/cb80d1884d1fec9452045025a555c761534649bf/dockstore-webservice/src/main/java/io/dockstore/webservice/languages/CWLHandler.java#L557

To Reproduce Steps to reproduce the behavior:

  1. Open your browser's developer tools
  2. Go to https://dockstore.org/workflows/github.com/EiffL/TXPipe:master?tab=info
  3. Click on the Tools tab and see that there are no tools displayed
  4. See in the developer's tool that the tools table content endpoint failed with a 500

Expected behavior It shouldn't fail with a 500

Additional context [Domain] - https://dockstore.org

Webservice - 1.15.2

UI - 2.12.2

Deploy - 1.15.0

┆Issue is synchronized with this Jira Story ┆Issue Number: DOCK-2534 ┆Sprint: Backlog ┆Issue Type: Story