ytsapras / robonet_site

Django RoboNet operational database.
GNU General Public License v2.0
0 stars 0 forks source link

artemis_subscriber crashing with error on align file ingest #20

Closed rachel3834 closed 7 years ago

rachel3834 commented 7 years ago

Error reported (in /var/spool/mail/robouser:

decimal.InvalidOperation: quantize result has too many digits for current context

This error is originating in update_db_2.add_datafile_via_api when it attempts to save parameters read from an ARTEMiS .align and .dat files.

rachel3834 commented 7 years ago

I tracked this issue to a specific event OB171284, for which the g parameter is unusually large: 10452.24. Its causing this error because the models.py definition of the g field in the DataFiles table specifies max_digits=6, decimal_places=2, which I think means that the entries cannot exceed 999.99.

rachel3834 commented 7 years ago

I've added better error handling within the update_db_2 functions to raise error warnings rather than simply crash the code in these circumstances. However, the actual fix is to increase the models.py specification of the max_digits for this field.

rachel3834 commented 7 years ago

I've implemented these changes and deployed them in the latest update. I ran the subscriber manually to check and it now runs without errors again.