QCPump sql divide by zero error

23 views
Skip to first unread message

Michael Jensen

unread,
Nov 11, 2024, 9:58:13 PMNov 11
to QATrack+
Hello, we've been using QCPump to upload DQA3 measurements from Atlas to QATrack+ for several months without issue. Today, I received the SQL error below.

Atlas doesn't appear to have any problems. I've also tried simplifying the list of machines to upload, trying each one individually to narrow down a cause - no luck with that. All machines individually produce the same error.

Has anyone seen this before?

2024-11-11 13:11:40,751,DQA3: Atlas: One Beam Per Test List,CRITICAL,Failed to query atlas db in pump: ('22012', '[22012] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Divide by zero error encountered. (8134) (SQLExecDirectW)')
Traceback (most recent call last):
  File "C:\Users\username\AppData\Local\Programs\qcpump\contrib\pumps\dqa3\dqa3pump.py", line 241, in fetch_records
    rows = self.querier(self.db_connect_kwargs(), query, params=params, fetch_method="fetchallmap")
  File "qcpump\core\db.py", line 97, in mssql_query
  File "qcpump\core\db.py", line 23, in db_query
pyodbc.DataError: ('22012', '[22012] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Divide by zero error encountered. (8134) (SQLExecDirectW)')

Thanks,
Michael

Randle Taylor

unread,
Nov 14, 2024, 9:16:18 PM (12 days ago) Nov 14
to Michael Jensen, QATrack+
Hi Michael,

That's a bit of a strange one.  The query used to fetch data from Atlas is here: https://github.com/qatrackplus/qcpump/blob/master/qcpump/contrib/pumps/dqa3/queries/atlas/1.5/trend.sql and the only division in that is to calculate the baseline dose like:

 100*data.ABDose/(100 + data.Dose) as dose_baseline,

so the only way that would generate a divide by zero error is if somehow the dose was recorded as -100 which doesn't make much sense.

If you're able to look at the DQA3Data table in the Atlas database it might be possible to identify the offending record and then either remove it or modify it to allow QCPump to proceed.

Randy

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/qatrack/da53f83f-6804-4cfd-8ab2-2e38924baf4dn%40googlegroups.com.

Michael Jensen

unread,
Nov 14, 2024, 10:01:26 PM (12 days ago) Nov 14
to QATrack+
Hi Randle,

Turns out half of our DQA3 devices have simultaneously reached their expiry date as they started routinely giving faulty readings this week. We had two different devices record -100 dose on Monday.

I edited trend.sql with the following:
CASE
WHEN data.Dose=-100 THEN 0
ELSE 100*data.ABDose/(100 + data.Dose)
END as dose_baseline,

which restored the upload functionality.

Thanks for replying.  

Michael

Randle Taylor

unread,
Nov 15, 2024, 10:19:13 AM (12 days ago) Nov 15
to Michael Jensen, QATrack+
Ah great! (Well, not that your DQA3's are failing, but you know what I mean).  I appreciate you following up with the fix.  I'll update the query with that change.

Randy

Reply all
Reply to author
Forward
0 new messages