CDR Tickets

Issue Number 4545
Summary Error Message in PubStatus Report
Created 2018-11-02 18:42:20
Issue Type Bug
Submitted By Englisch, Volker (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2019-07-10 16:49:57
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.235508
Description

Anne Middleswarth reported that the first link in the Pubstatus report of the nightly/weekly publishing notification returns the following error:

Failure getting IDs for removed docs: Invalid object name '#removed_docs'.

It's the first link of the email "[PROD] Status and Error Report for Weekly Publishing":
Publishing Job Summary Report:
https://cdr.cancer.gov/cgi-bin/cdr/PubStatus.py?id=16818&type=Report&Session=Guest

Comment entered 2018-11-05 10:49:29 by Kline, Bob (NIH/NCI) [C]

This is the result of yet another bug in Microsoft's ADO/DB. Here's a patch:

diff --git a/Inetpub/wwwroot/cgi-bin/cdr/PubStatus.py b/Inetpub/wwwroot/cgi-bin/cdr/PubStatus.py
index c6ed2a1f..571764ea 100644
--- a/Inetpub/wwwroot/cgi-bin/cdr/PubStatus.py
+++ b/Inetpub/wwwroot/cgi-bin/cdr/PubStatus.py
@@ -3,10 +3,11 @@
 #
 # OCECDR-3695: PubStatus Report Drops Push Job
 #----------------------------------------------------------------------
-import cgi, cdr, cdrdb, cdrcgi, re, time
+import cgi, cdr, cdrcgi, re, time
+from cdrapi import db as cdrdb
 
 # Logfile is same as that used in cdrpub.py
-LOG         = "d:/cdr/log/publish.log"
+LOG         = cdr.WORK_DRIVE + ":/cdr/log/publish.log"
 WAIT_STATUS = "Waiting user approval"
 
 #----------------------------------------------------------------------
@@ -55,7 +56,7 @@ def dispJobStatus():
     # Find some interesting information.
     #----------------------------------------------------------------------
     try:
-        conn = cdrdb.connect('CdrGuest')
+        conn = cdrdb.connect(user='CdrGuest')
         cursor = conn.cursor()
         cursor.execute("""\
             SELECT d.title,
@@ -188,7 +189,7 @@ def dispFilterFailures(flavor = 'full'):
     # Find some interesting information.
     #----------------------------------------------------------------------
     try:
-        conn = cdrdb.connect('CdrGuest')
+        conn = cdrdb.connect(user='CdrGuest')
         cursor = conn.cursor()
         cursor.execute("""\
             SELECT ppd.doc_id,
@@ -294,7 +295,7 @@ def dispJobSetting():
     # Find some interesting information.
     #----------------------------------------------------------------------
     try:
-        conn = cdrdb.connect('CdrGuest')
+        conn = cdrdb.connect(user='CdrGuest')
         cursor = conn.cursor()
         cursor.execute("""\
             SELECT ppp.parm_name,
@@ -436,7 +437,7 @@ def dispCgWork():
     buttons = []
     header  = cdrcgi.header(title, title, instr, None, buttons)
 
-    conn = cdrdb.connect('CdrGuest')
+    conn = cdrdb.connect(user='CdrGuest')
     cursor = conn.cursor()
 
     ###
@@ -986,6 +987,7 @@ def createTemporaryPubInfoTables(cursor, conn, latestFullLoad, cgJob):
                     AND failure IS NULL""", cgJob)
         conn.commit()
     except cdrdb.Error, info:
+        raise
         cdrcgi.bail("Failure getting IDs for removed docs: %s" % info[1][0])
 
     #------------------------------------------------------------------
@@ -1063,7 +1065,7 @@ def dispJobReport():
     script  = "PubStatus.py"
     header  = cdrcgi.header(title, title, instr, script, buttons)
 
-    conn = cdrdb.connect('CdrGuest')
+    conn = cdrdb.connect(user='CdrGuest')
     cursor = conn.cursor()
 
 
@@ -1408,7 +1410,7 @@ def dispJobRepDetail():
     script  = "PubStatus.py"
     header  = cdrcgi.header(title, title, instr, script, buttons)
 
-    conn = cdrdb.connect('CdrGuest')
+    conn = cdrdb.connect(user='CdrGuest')
     cursor = conn.cursor()
     pushJobName = "Push_Documents_To_Cancer.Gov_"
 
Comment entered 2019-07-10 16:49:57 by Kline, Bob (NIH/NCI) [C]
Comment entered 2019-08-29 12:22:12 by Englisch, Volker (NIH/NCI) [C]

The changes are on PROD.

Elapsed: 0:00:00.001571