Project

General

Profile

Actions

Bug #13347

closed

Cannot update or publish legacy records

Added by Yannis Marketakis about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
Feb 18, 2019
Due date:
% Done:

100%

Estimated time:

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

Blocks StocksAndFisheriesKB - Bug #13250: Honduran management organization acronym not appearingClosedYannis MarketakisApr 11, 2064

Actions
Actions #1

Updated by Yannis Marketakis about 6 years ago

  • Blocks Bug #13250: Honduran management organization acronym not appearing added
Actions #2

Updated by Luca Frosini about 6 years ago

  • Status changed from New to In Progress
Actions #3

Updated by Luca Frosini about 6 years ago

  • % Done changed from 0 to 30
Actions #4

Updated by Luca Frosini about 6 years ago

  • % Done changed from 30 to 90
Actions #7

Updated by Luca Frosini about 6 years ago

  • Status changed from In Progress to Closed

The patched service has been deployed

Actions #8

Updated by Luca Frosini about 6 years ago

@marketak@ics.forth.gr let me know if it works for you.

Actions #9

Updated by Yannis Marketakis about 6 years ago

@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.

Actions #10

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?

Actions #11

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.

Actions #12

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?

Actions #13

Updated by Yannis Marketakis about 6 years ago

Yes, these fields (as well as the refers_to) are mandatory for GRSF records

Actions #14

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.

Actions #15

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.

Actions #16

Updated by Yannis Marketakis about 6 years ago

  • Status changed from Feedback to Closed

It works as expected.

Thanks @luca.frosini@isti.cnr.it

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)