Unprocessable Entity - HTTP code 422
Insieme a @valentino.lauciani, in coerenza con l'attuale gestione da parte del Webservice Dante di alcuni messaggi, abbiamo lasciato che ew2openapi
nel caso riceva il codice http code 422 ripeta infinite volte la chiamata per l'inserimento del messaggio.
Tramite il commit c2fbd111 in questa linea avevo lasciato un appunto nel codice:
case 422: // Unprocessable Entity
// TODO: in the future 422 will be set handler_status_code = HANDLER_STATUS_ERROR_NO_RETRIES
case 428: // Precondition Required
Poco fa, risolvendo l'issue #34 (closed), riavviando i processi ew2openapi
però è accaduto che il modulo cerca di inserire una magnitudo di cui però non esiste l'ipocentro:
20200728_UTC_13:10:46 JSON: {"ewLogo":{"type":"TYPE_MAGNITUDE","module":"MOD_LOCALMAG_PREL","installation":"INST_INGV","instance":"hew20_mole","user":"ew","hostname":"hew20"},"ewMessage":{"quakeId":246162,"version":"ew prelim","mag":1.41,"error":0.28,"quality":0.71,"minDist":16.89,"azimuth":-1,"nStations":5,"nChannels":10,"qAuthor":"014101073:028129073","qddsVersion":0,"iMagType":1,"magType":"ML","algorithm":"MED","ingvQuality":"B ","phases":[{"sta":"PLLN","comp":"EHE","net":"IV","loc":"--","mag":1.23,"dist":16.89,"corr":0.00,"time1":"2020-07-28 13:00:29.760000","amp1":-0.1200,"period1":-1.0000,"time2":"2020-07-28 13:00:30.190000","amp2":0.1700,"period2":-1.0000},{"sta":"PLLN","comp":"EHN","net":"IV","loc":"--","mag":1.41,"dist":16.89,"corr":0.00,"time1":"2020-07-28 13:00:29.900000","amp1":-0.2040,"period1":-1.0000,"time2":"2020-07-28 13:00:30.650000","amp2":0.2320,"period2":-1.0000},{"sta":"GIB","comp":"HHE","net":"IV","loc":"--","mag":1.40,"dist":22.30,"corr":0.00,"time1":"2020-07-28 13:00:34.310000","amp1":-0.1720,"period1":-1.0000,"time2":"2020-07-28 13:00:34.120000","amp2":0.1520,"period2":-1.0000},{"sta":"GIB","comp":"HHN","net":"IV","loc":"--","mag":1.42,"dist":22.30,"corr":0.00,"time1":"2020-07-28 13:00:33.070000","amp1":-0.1530,"period1":-1.0000,"time2":"2020-07-28 13:00:32.330000","amp2":0.1850,"period2":-1.0000},{"sta":"CSLB","comp":"HHE","net":"IV","loc":"--","mag":1.04,"dist":25.46,"corr":0.00,"time1":"2020-07-28 13:00:34.270000","amp1":-0.0635,"period1":-1.0000,"time2":"2020-07-28 13:00:34.030000","amp2":0.0643,"period2":-1.0000},{"sta":"CSLB","comp":"HHN","net":"IV","loc":"--","mag":1.02,"dist":25.46,"corr":0.00,"time1":"2020-07-28 13:00:31.790000","amp1":-0.0618,"period1":-1.0000,"time2":"2020-07-28 13:00:31.530000","amp2":0.0622,"period2":-1.0000},{"sta":"PETRA","comp":"HHE","net":"IV","loc":"--","mag":1.58,"dist":34.64,"corr":0.00,"time1":"2020-07-28 13:00:40.750000","amp1":-0.1550,"period1":-1.0000,"time2":"2020-07-28 13:00:40.450000","amp2":0.1570,"period2":-1.0000},{"sta":"PETRA","comp":"HHN","net":"IV","loc":"--","mag":1.64,"dist":34.64,"corr":0.00,"time1":"2020-07-28 13:00:36.020000","amp1":-0.1680,"period1":-1.0000,"time2":"2020-07-28 13:00:36.360000","amp2":0.1910,"period2":-1.0000},{"sta":"GALF","comp":"HHE","net":"IV","loc":"--","mag":1.87,"dist":57.54,"corr":0.00,"time1":"2020-07-28 13:00:51.810000","amp1":-0.1170,"period1":-1.0000,"time2":"2020-07-28 13:00:52.060000","amp2":0.2020,"period2":-1.0000},{"sta":"GALF","comp":"HHN","net":"IV","loc":"--","mag":1.68,"dist":57.54,"corr":0.00,"time1":"2020-07-28 13:00:51.840000","amp1":-0.1080,"period1":-1.0000,"time2":"2020-07-28 13:00:52.110000","amp2":0.0964,"period2":-1.0000}]}}
20200728_UTC_13:10:46 URL-DATA: http://jabba.int.ingv.it:10013/ingvws/eventdb/ew/magnitude/1/
20200728_UTC_13:10:46 JSON-DATA: {"data":{"ewLogo":{"type":"TYPE_MAGNITUDE","module":"MOD_LOCALMAG_PREL","installation":"INST_INGV","instance":"hew20_mole","user":"ew","hostname":"hew20"},"ewMessage":{"quakeId":246162,"version":"ew prelim","mag":1.41,"error":0.28,"quality":0.71,"minDist":16.89,"azimuth":-1,"nStations":5,"nChannels":10,"qAuthor":"014101073:028129073","qddsVersion":0,"iMagType":1,"magType":"ML","algorithm":"MED","ingvQuality":"B ","phases":[{"sta":"PLLN","comp":"EHE","net":"IV","loc":"--","mag":1.23,"dist":16.89,"corr":0.00,"time1":"2020-07-28 13:00:29.760000","amp1":-0.1200,"period1":-1.0000,"time2":"2020-07-28 13:00:30.190000","amp2":0.1700,"period2":-1.0000},{"sta":"PLLN","comp":"EHN","net":"IV","loc":"--","mag":1.41,"dist":16.89,"corr":0.00,"time1":"2020-07-28 13:00:29.900000","amp1":-0.2040,"period1":-1.0000,"time2":"2020-07-28 13:00:30.650000","amp2":0.2320,"period2":-1.0000},{"sta":"GIB","comp":"HHE","net":"IV","loc":"--","mag":1.40,"dist":22.30,"corr":0.00,"time1":"2020-07-28 13:00:34.310000","amp1":-0.1720,"period1":-1.0000,"time2":"2020-07-28 13:00:34.120000","amp2":0.1520,"period2":-1.0000},{"sta":"GIB","comp":"HHN","net":"IV","loc":"--","mag":1.42,"dist":22.30,"corr":0.00,"time1":"2020-07-28 13:00:33.070000","amp1":-0.1530,"period1":-1.0000,"time2":"2020-07-28 13:00:32.330000","amp2":0.1850,"period2":-1.0000},{"sta":"CSLB","comp":"HHE","net":"IV","loc":"--","mag":1.04,"dist":25.46,"corr":0.00,"time1":"2020-07-28 13:00:34.270000","amp1":-0.0635,"period1":-1.0000,"time2":"2020-07-28 13:00:34.030000","amp2":0.0643,"period2":-1.0000},{"sta":"CSLB","comp":"HHN","net":"IV","loc":"--","mag":1.02,"dist":25.46,"corr":0.00,"time1":"2020-07-28 13:00:31.790000","amp1":-0.0618,"period1":-1.0000,"time2":"2020-07-28 13:00:31.530000","amp2":0.0622,"period2":-1.0000},{"sta":"PETRA","comp":"HHE","net":"IV","loc":"--","mag":1.58,"dist":34.64,"corr":0.00,"time1":"2020-07-28 13:00:40.750000","amp1":-0.1550,"period1":-1.0000,"time2":"2020-07-28 13:00:40.450000","amp2":0.1570,"period2":-1.0000},{"sta":"PETRA","comp":"HHN","net":"IV","loc":"--","mag":1.64,"dist":34.64,"corr":0.00,"time1":"2020-07-28 13:00:36.020000","amp1":-0.1680,"period1":-1.0000,"time2":"2020-07-28 13:00:36.360000","amp2":0.1910,"period2":-1.0000},{"sta":"GALF","comp":"HHE","net":"IV","loc":"--","mag":1.87,"dist":57.54,"corr":0.00,"time1":"2020-07-28 13:00:51.810000","amp1":-0.1170,"period1":-1.0000,"time2":"2020-07-28 13:00:52.060000","amp2":0.2020,"period2":-1.0000},{"sta":"GALF","comp":"HHN","net":"IV","loc":"--","mag":1.68,"dist":57.54,"corr":0.00,"time1":"2020-07-28 13:00:51.840000","amp1":-0.1080,"period1":-1.0000,"time2":"2020-07-28 13:00:52.110000","amp2":0.0964,"period2":-1.0000}]}}}
20200728_UTC_13:10:46 RESPONSE: {
"type": "https://tools.ietf.org/html/rfc4918#section-11.2",
"title": "Unprocessable Entity",
"status": 422,
"detail": "The hypocenter with:\"event.id_locator=246162\", \"provenance.instance=hew20_mole\" and \"hypocenter.fk_type_hypocenter=<id_of__type_hypocenter.name=ew prelim>\"doesn't exists!",
"instance": "http://jabba.int.ingv.it/ingvws/eventdb/ew/magnitude/1",
"version": "1.52.6",
"request_submitted": "2020-07-28T13:07:46 UTC"
}
20200728_UTC_13:10:46 Error POST to http://jabba.int.ingv.it:10013/ingvws/eventdb/ew/magnitude/1/ with http code 422.
20200728_UTC_13:10:46 HTTP CODE: 422
20200728_UTC_13:10:46 Retry to POST last message later.
20200728_UTC_13:10:46 Current number of elements in queue: 65.
20200728_UTC_13:10:46 Wait 5 seconds before retrying.
In questo modo però si genera un'iterazione senza fine.
Propongo di attivare la modifica già da adesso.