HandyGuySoftware / dupReport

Email summary reporting tool for use with Duplicati backup system
MIT License
77 stars 9 forks source link

dupReport throws a strange error #6

Closed WolfTohsaka closed 7 years ago

WolfTohsaka commented 7 years ago

Brand new Debian 9 with nothing uncecessary installed,

wolf@dupReport:~/dupReport-master$ ./dupReport.py Traceback (most recent call last): File "./dupReport.py", line 868, in create_summary_report() File "./dupReport.py", line 646, in create_summary_report d0 = datetime.date(int(then[0]),int(then[1]), int(then[2])) ValueError: month must be in 1..12

dupReport.rc as :


[main]
dbpath = /home/adeo/dupReport-master
logpath = /home/adeo/dupReport-master
verbose = 1
logappend = true
sizereduce = giga
subjectregex = ^Duplicati Backup report for
summarysubject = Duplicati Backup Summary Report
srcregex = \w*
destregex = \w*
srcdestdelimiter = -
border = 1
padding = 5

[incoming]
transport = imap
server = ssl0.ovh.net
port = 993
encryption = tls
account = dupreport@*.com
password = ****************
folder = INBOX

[outgoing]
server = ssl0.ovh.net
port = 587
encryption = tls
account = dupreport@*.com
password = ****************
sender = dupreport@*.com
receiver = support@*.com
HandyGuySoftware commented 7 years ago

WolfTohsaka, can you run the program using the -v 2 option (or set verbose=2 in the .rc file), then send/post the dupReport.log file so I can try to trace the problem? Thanks.

WolfTohsaka commented 7 years ago

Could be a datetime problem, as I use a French-locale Debian :

wolf@dupReport:~/dupReport-master$ locale LANG=fr_FR.UTF-8 LANGUAGE= LC_CTYPE="fr_FR.UTF-8" LC_NUMERIC="fr_FR.UTF-8" LC_TIME="fr_FR.UTF-8" LC_COLLATE="fr_FR.UTF-8" LC_MONETARY="fr_FR.UTF-8" LC_MESSAGES="fr_FR.UTF-8" LC_PAPER="fr_FR.UTF-8" LC_NAME="fr_FR.UTF-8" LC_ADDRESS="fr_FR.UTF-8" LC_TELEPHONE="fr_FR.UTF-8" LC_MEASUREMENT="fr_FR.UTF-8" LC_IDENTIFICATION="fr_FR.UTF-8" LC_ALL=

End of the .log :


SELECT messageId FROM emails WHERE messageId='<MWMVKGGQO2U4.0U8P5T43BVTG3@wolf-HP>'
Message [<MWMVKGGQO2U4.0U8P5T43BVTG3@wolf-HP>] already in email database
create_summary_report(): SELECT source, destination, lastDate,lastTime,lastFileCount,lastFileSize from backupsets order by source, destination
create_email_text(): textTup=('Duplicati Backup Summary Report\n',)  fmtTup=('^',)create_email_text(): textTup=('Date', 'Time', 'Files', '+/-', 'Size (GB)', '+/- (GB)', 'Added', 'Deleted', 'Modified', 'Errors', 'Result')  fmtTup=('11', '9', '>10', '10', '>18', '18', '>10', '>10', '>10', '>10', '<11')bkSetRows=[[('wolfPC', 'BackupBox01wolf', '2017/24/10', '11:00:39', 86055, 10362526558)]]
Src=[wolfPC] Dest=[BackupBox01wolf] lastDate=[2017/24/10] lastTime=[11:00:39] lastFileCount=[86055] lastFileSize=[10362526558]
create_email_text(): textTup=('***** wolfPC to BackupBox01wolf *****',)  fmtTup=('',)SELECT endDate, endtime, examinedFiles, sizeOfExaminedFiles, addedFiles, deletedFiles, modifiedFiles,             filesWithError, parsedResult, warnings, errors FROM emails WHERE sourceComp='wolfPC' AND destComp='BackupBox01wolf'             AND  ((endDate > '2017/24/10') OR  ((endDate == '2017/24/10') AND (endtime > '11:00:39'))) order by endDate, endTime
emailRows=[[]]

And opening the .db file, seems theres something weird in the fridge :

emailDate gets a "2017-10-24" as expected

But beginDate and endDate get "2017/24/10" (Yes, the Duplicati-running computer gets a French locale too)

WolfTohsaka commented 7 years ago

FYI went fishing the mail,

Goes like :


EndTime: 24/10/2017 11:00:39
BeginTime: 24/10/2017 11:00:00
HandyGuySoftware commented 7 years ago

Once the program runs it remembers the emails it read. You'll need to reset the database with dupReport.py -i, then run the program with the -v 2 to capture the full log. The locale thing might be the issue, but the full log (with -v 2) will tell me for sure (& how to fix it).

HandyGuySoftware commented 7 years ago

WolfTohsaka, doing some research I can't seem to confirm that the locale setting is the problem. I've added some more debug code to test with.

Please download dupReport.py from the "beta" branch and run it with option '-v2'. Then post the last 20 lines from the dupReport.log file. That should give me the information I need to figure out what's happening. Thanks.

WolfTohsaka commented 7 years ago

With the beta branch, it worked by copying the .rc and doing a -i first,

Thanx

HandyGuySoftware commented 7 years ago

OK, then. That's great (but strange). I didn't change anything in the beta build, just added some more debug statements. Just for testing, can you run the 'master' branch version of the program again and see if it goes back to the old behavior?

HandyGuySoftware commented 7 years ago

Closed, but still a mystery...