ICTatRTI / coconut-analytics

Browserified & backboned version of coconut-reports
Other
2 stars 3 forks source link

Graphs are broken on democs but not zanzibar #318

Open scloo opened 6 years ago

scloo commented 6 years ago

Error message: Sorry. Unable to complete due to an error: {"status":500,"name":"invalid_value","message":"Database encountered an unknown error","reason":"builtin _sum function requires map values to be numbers or lists of numbers"}

gmcressman commented 6 years ago

Same version of CouchDB?

scloo commented 6 years ago

Zanzibar has 2.1 where as democs has 1.7.1. The problem seems to relate to the caseCounter view in couchdb. Upon investigation, don't think it is related to couchDB version. I ran the same view on 1.7.1 for the zanzibar data, and it works fine. So I suspect that in democs, there must be some data discrepancies.

gmcressman commented 6 years ago

Start by regenerating the demo database?

scloo commented 6 years ago

I need to find where that script is, that generate the demo database.

scloo commented 6 years ago

Regenerated the democs database. Now the graphs is working now.

scloo commented 6 years ago

Need to verify data whether the anonymizing is updating correctly.

scloo commented 6 years ago

Anonymizing is not updating as expected. It should have shifted the dates to current period. The data was filtered to 2014 and 2015. After filtering, it is supposed to shift the dates to 2016 to 2018, based on the current date. When I ran the CaseIDByDates view, I still see only dates in 2014 and 2015.

scloo commented 6 years ago

@mikeymckay I was checking the view codes for caseIDByDates view for all the other databases besides democs that was broken, and I found that there were no Reduce function in all of them. So I suspect that somewhere along the Reduce function _sum got inserted in democs caseIDByDates view. In which case the data was ok since it should not have the Reduce function.

scloo commented 6 years ago

Oops. I need a break from staring at the codes. I was looking at the wrong view. It isn't the caseIDByDates view but the caseCounter that was having issues with Reduce function. So please ignore last comments.

scloo commented 6 years ago

I believe this has been resolved along the way. Probably by the recreation of the demo database.

gmcressman commented 6 years ago

All graphs working now on democs. @scloo - is there any weekly aggregate data in the demo database? Those graphs are blank. @mikeymckay may also know the answer to this.

gmcressman commented 6 years ago

These two graphs indicate that the script may not be correctly advancing the timing of some date/time fields:

screen shot 2018-02-09 at 2 22 04 pm