USACE / cwms-data-api

Corps Water Management System RESTful Data Service
MIT License
13 stars 14 forks source link

Error code 500 in ratings template catalog #865

Open adamkorynta opened 1 month ago

adamkorynta commented 1 month ago

Produced through CWMSVue when loading CWBI Test data using office "NAB":

GET https://cwms-data-test.cwbi.us/cwms-data/ratings/template?page-size=1000&office=NAB

Error code: 500

{
    "message": "Failed to process request: Number of independent parameters does not match number of rating methods. indParams: Opening,Head methodsForParam: NEAREST,LINEAR,NEAREST",
    "incidentIdentifier": "3324399523317528522",
    "details": {}
}
MikeNeilson commented 1 month ago

indParams: Opening,Head methodsForParam: NEAREST,LINEAR,NEAREST

I believe this is an error with a particular rating table. Perhaps CDA can handle it a bit more gracefully, but other rating templates with multiple parameters do infact contain the / and follow on values.

MikeNeilson commented 1 month ago

https://github.com/USACE/cwms-data-api/blob/fbce50d6abbdb74e15caac28a5020b4e0c24c3b7/cwms-data-api/src/main/java/cwms/cda/data/dao/RatingTemplateDao.java#L212 is where the exception is thrown. Perhaps the calling buildRatingTemplate should catch the exception and move on.

zack-rma commented 1 month ago

I was unable to recreate this issue with tests on my Docker DB instance. Is there a specific issue with the first record of the results that I can try to reproduce?

MikeNeilson commented 1 month ago

You might be able to recreate if you're connected to the HEC NAB copy, but I'm not sure if you have access, or if we can even set that up.