Bug #13347
closedCannot update or publish legacy records
100%
Description
I'm facing the following error when trying to publish or update legacy records.
2019-02-18 11:36:02 ERROR GrsfPublisher:110 - Fatal transport error: java.lang.Exception: Method failed: HTTP/1.1 500 Internal Server Error; Response body: {"id":null,"knowledge_base_id":null,"product_url":null,"error":"refers_to cannot be null/empty"} at gr.forth.ics.isl.grsfservicescore.GrsfPublisher.publishRecord(GrsfPublisher.java:102) at gr.forth.ics.isl.grsfservicescore.clients.PublisherClient.publishRecords(PublisherClient.java:758) at gr.forth.ics.isl.grsfservicescore.clients.PublisherClient.publishOriginalFisheries(PublisherClient.java:386) at gr.forth.ics.isl.grsfservicescore.clients.PublisherClient.publishOriginalFishery(PublisherClient.java:356) at gr.forth.ics.isl.grsfservicescore.clients.PublisherClient.main(PublisherClient.java:979)
The property refers_to is only used when publish grsf records (and this property is used to point to the corresponding legacy records). When publishing legacy records it does not exist, so the service should not check if it exists.
Files
Related issues
Updated by Yannis Marketakis about 6 years ago
- Blocks Bug #13250: Honduran management organization acronym not appearing added
Updated by Luca Frosini about 6 years ago
- Status changed from New to In Progress
Updated by Luca Frosini about 6 years ago
- Status changed from In Progress to Closed
The patched service has been deployed
Updated by Luca Frosini about 6 years ago
@marketak@ics.forth.gr let me know if it works for you.
Updated by Yannis Marketakis about 6 years ago
- File be735335-7291-3f55-97a3-de7b9047bac2.json be735335-7291-3f55-97a3-de7b9047bac2.json added
- Status changed from Closed to In Progress
@luca.frosini@isti.cnr.it thanks for the update.
I am facing a similar issue. Now it fails because it is missing the traceability flag (which does not exist for GRSf records). Below you'll find the corresponding part of the log
java.lang.Exception: Method failed: HTTP/1.1 500 Internal Server Error; Response body: {"id":null,"knowledge_base_id":null,"product_url":null,"error":"traceability_flag cannot be null"}
Attached you will find the json serialization of the legacy record so that you can check if there are other fields that should be mandatory.
Updated by Luca Frosini about 6 years ago
Hi @marketak@ics.forth.gr
thanks for your feedback.
apart refers_to, the code performs the following checks:
Boolean traceabilityFlag = record.isTraceabilityFlag(); if(traceabilityFlag == null) throw new Exception("traceability_flag cannot be null"); String shortTitle = record.getShortName(); if(shortTitle == null || shortTitle.isEmpty()) throw new Exception("short_title cannot be null/empty"); Status status = record.getStatus(); if(status == null) throw new Exception("status cannot be null/empty");
Do I have to exclude all of these checks for GRSF records or traceabilityFlag is enough?
Updated by Yannis Marketakis about 6 years ago
The fields traceability_flag and status are optional for legacy records so remove them.
The field short_name is OK.
Updated by Luca Frosini about 6 years ago
Summarizing:
traceability_flag and status are not mandatory for legacy records. I'll not check for them.
Do I have to perform the check for GRSF records?
Updated by Yannis Marketakis about 6 years ago
Yes, these fields (as well as the refers_to) are mandatory for GRSF records
Updated by Luca Frosini about 6 years ago
The service has been patched. We have to wait for ETICS build to update the service.
I'm reopening the upgrade ticket.
Updated by Luca Frosini about 6 years ago
- Status changed from In Progress to Feedback
- % Done changed from 90 to 100
@marketak@ics.forth.gr the patched service is available.
Updated by Yannis Marketakis about 6 years ago
- Status changed from Feedback to Closed
It works as expected.
Thanks @luca.frosini@isti.cnr.it