CDR Tickets

Issue Number 4663
Summary [General] Documents Modified report not working
Created 2019-09-10 16:34:06
Issue Type Bug
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2019-09-10 17:32:07
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.249576
Description

The Documents Modified report appears broken. No matter what criteria you select, you get a python script error message. This is happening on both PROD and DEV.

A problem occurred in a Python script.

D:\cdr\Log\tmpgbc4pd.html contains the description of this error.

Comment entered 2019-09-10 17:29:22 by Kline, Bob (NIH/NCI) [C]

This appears to be yet another defect in ADO/DB. All I had to do was to swap out the database library built with ADO/DB and replace it with the newer one (based on ODBC) that we used for the new Python API written to replace the C++ server and the report works again (on DEV). Here's the patch for Leibnitz:

 

cgi-bin/cdr/DocumentsModified.py
index 67257c20..55a3ec1e 100644
--- a/Inetpub/wwwroot/cgi-bin/cdr/DocumentsModified.py
+++ b/Inetpub/wwwroot/cgi-bin/cdr/DocumentsModified.py
@@ -8,7 +8,7 @@
 import cgi
 import cdr
 import cdrcgi
-import cdrdb
+from cdrapi import db
 import re
 import time
 import sys
@@ -45,7 +45,7 @@ if request == "Log Out":
 # Connect to the database.
 #----------------------------------------------------------------------
 try:
-    conn = cdrdb.connect("CdrGuest")
+    conn = db.connect(user="CdrGuest")
     cursor = conn.cursor()
 except:
     cdrcgi.bail("Unable to connect to the CDR database")

 

Since this script has not changed in over two years (and assuming it's used more frequently than ever couple of years and that you would have reported the failures if it hadn't worked before), it seems most likely that a Microsoft patch to ADO/DB (or — less likely — to SQL Server) broke something.

As part of the upgrade to Python 3 the older library based on ADO/DB will have been completely retired, so this is one class of bug we will be leave behind us for good. Now that I think of it, by the time we get to Leibnitz, the Python upgrade will already have happened, so the patch won't be necessary. 🙂

Comment entered 2019-09-10 17:32:07 by Kline, Bob (NIH/NCI) [C]

Fixed on DEV.

 

By the way, , which way are we going to spell it: Leibnitz or Leibniz? I've seen it both ways, from reliable sources.

Comment entered 2019-09-10 17:33:28 by Kline, Bob (NIH/NCI) [C]

Ah, I see we've already got a Leibniz sprint. 🙂

Comment entered 2019-09-10 17:49:35 by Englisch, Volker (NIH/NCI) [C]

Which sources were that?  Just wondering.

I have to admit that I originally spelled his last name Leibnitz myself but then I went to the German Wikipedia and found some information regarding his spelling.  His father's name was Leibnütz , his latin name was Leibnitius and in the French literature his name was spelled Leibnitz.  However, based on his signature on letters he wrote he apparently decided in 1671 to use the spelling Leibniz which is what we will use.

Comment entered 2019-09-10 17:57:10 by Kline, Bob (NIH/NCI) [C]

https://www.maths.tcd.ie/pub/HistMath/People/Leibniz/RouseBall/RB_Leibnitz.html, z.B.

Note that this one has both spellings right there in the URL! 🙂

Comment entered 2020-04-16 12:10:53 by Osei-Poku, William (NIH/NCI) [C]

Verified on DEV. Thanks!

Comment entered 2020-06-02 20:36:17 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA. Thanks!

Elapsed: 0:00:00.001581