Renable Germplasm Export
Bug
Set up dev instance using data-discovery/HOW-TO-SETUP-LOCAL-DEV.md
Filter to select 3 germplasms :
Download : MCPD --> fail , plant material (but looks like MCPD) --> OK, MCPD again --> OK
Filter to select 50 germplasms : http://localhost:8280/faidare-dev/search?query=triticum&page=1&descendants=false&entry=Germplasm&bs=Advanced%20or%20improved%20cultivar&coo=France#germplasm
Donwload Fail whatever you do
Analyze
Using IDEA Debuger on both applications (faidare & data-discovery) Spring boot Application configuration: go to backend/src/main/java/fr/inra/urgi/datadiscovery/Application.java Click run/debug. If need be edit configuration and select "faidare-app" profile
Breakpoints :
- B1: data-discovery: backend/src/main/java/fr/inra/urgi/datadiscovery/germplasm/ExportController.java line 76 --> return ResponseEntity.ok().contentType(MediaType.parseMediaType("text/csv")).body(body);
- B2: faidare: backend/src/main/java/fr/inra/urgi/faidare/web/germplasm/GermplasmController.java line 115 --> return ResponseEntity.ok().contentType(MediaType.parseMediaType("text/csv")).body(body);
- B3: faidare : backend/src/main/java/fr/inra/urgi/faidare/web/germplasm/GermplasmMcpdExportService.java line 135 --> csvWriter.flush();
Web interface: http://localhost:8280/faidare-dev/search?query=triticum&page=1&descendants=false&entry=Germplasm&bs=Advanced%20or%20improved%20cultivar&coo=France&coo=United%20Kingdom%20of%20Great%20Britain%20and%20Northern%20Ireland#germplasm Click on export MCPD. On the breakpoints:
- B1: germplasmIds=52 --> germplasmIds are fetched correctly , Impossible to see response (Async subscribe I assume ?)
- B2: Impossible to see response (Async subscribe I assume ?). PArameters and germplasmDbIds are ok
- B3: csvWriter.writer.cb contains 8000+ characters. Expected results are present (headers plus data (triticum, DOI, etc...). while loop handles the expected number of lines with apparently expected values (doi & accNumber changing)
conclusion
THE CSV seems to be correctly generated in GermplasmMcpdExportService.java but not corectly sent back either from CSVWriter to response r between applications.
Additional information
Stack on the data-discovery side:
Caused by: org.apache.coyote.CloseNowException: Failed write
at org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.doWrite(Http11OutputBuffer.java:549) ~[tomcat-embed-core-9.0.65.jar!/:na]
at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:110) ~[tomcat-embed-core-9.0.65.jar!/:na]
at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:194) ~[tomcat-embed-core-9.0.65.jar!/:na]
...