Problem with recovery.py

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

Problem with recovery.py

Postby lneto » Tue Aug 16, 2011 3:16 pm

Hi there,

I have openemm running on unbutu lucid 64bit. Installation was fine and the software is running, but I have 2 issues:

1) Checking on the logs I can see there is a problem with recovery.py as follow:
[16.08.2011 11:07:36] 26223 INFO/main: Starting up
[16.08.2011 11:07:36] 26223 FATAL/except: CAUGHT EXCEPTION:
Traceback (most recent call last):
File "/home/openemm/bin/scripts/recovery.py", line 337, in <module>
main ()
File "/home/openemm/bin/scripts/recovery.py", line 324, in main
rec.collectMailings ()
File "/home/openemm/bin/scripts/recovery.py", line 187, in collectMailings
check = 'SELECT count(*) FROM rulebased_sent_tbl WHERE mailing_id = :mid AND date_to_str (lastsent, \'%Y-%m-%d\') = \'%04d-%02d-%02d\'' % (yesterday.tm_year, yesterday.tm_mon, yesterday.tm_mday)
ValueError: unsupported format character 'Y' (0x79) at index 93

2) Even thought I just installed openEMM and I have no mailings or mailing lists loaded yet, I noticed webacess to openemm keeps crashing. After a few minutes of use I can no longer access my openemm installation over the web. Then I login on my server via ssh, stop openEMM, start it again and everything is fine.
Nothing is showing up on the logs. Any thoughts?

Thanks guys
lneto
 
Posts: 2
Joined: Tue Aug 16, 2011 3:09 pm

Re: Problem with recovery.py

Postby maschoff » Tue Aug 16, 2011 8:42 pm

The error message says that the date format string \'%Y-%m-%d\' in the SQL statement is not accepted by the Python interpreter. Is file recovery.py unmodified? Normally, hex value of Y is 0x59, not 0x79 (the latter is y).
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 2144
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: Problem with recovery.py

Postby lneto » Wed Aug 17, 2011 4:00 am

Yes, it is 0x59. I played around changing Y to y thats why you see the 0x79 there.
Anyway, I've reverted the file to original version and I haven't modified anything else.

Here is the error again to make things clear:
File "/home/openemm/bin/scripts/recovery.py", line 187, in collectMailings
check = 'SELECT count(*) FROM rulebased_sent_tbl WHERE mailing_id = :mid AND date_to_str (lastsent, \'%Y-%m-%d\') = \'%04d-%02d-%02d\'' % (yesterday.tm_year, yesterday.tm_mon, yesterday.tm_mday)
ValueError: unsupported format character 'Y' (0x59) at index 93


unmodified recovery.py

Thanks
lneto
 
Posts: 2
Joined: Tue Aug 16, 2011 3:09 pm

Re: Problem with recovery.py

Postby leSasch » Sun Sep 25, 2011 3:57 pm

Same problem here:

/home/openemm/var/log/20110925-openemm-recovery.log:

[25.09.2011 16:34:56] 1323 FATAL/except: CAUGHT EXCEPTION:
Traceback (most recent call last):
File "/home/openemm/bin/scripts/recovery.py", line 337, in <module>
main ()
File "/home/openemm/bin/scripts/recovery.py", line 324, in main
rec.collectMailings ()
File "/home/openemm/bin/scripts/recovery.py", line 187, in collectMailings
check = 'SELECT count(*) FROM rulebased_sent_tbl WHERE mailing_id = :mid AND date_to_str (lastsent, \'%Y-%m-%d\') = \'%04d-%02d-%02d\'' % (yesterday.tm_year, yesterday.tm_mon, yesterday.tm_mday)
ValueError: unsupported format character 'Y' (0x59) at index 93

The recovery.py is original and unmodified.
leSasch
 
Posts: 3
Joined: Fri Sep 25, 2009 3:29 pm

Re: Problem with recovery.py

Postby maschoff » Sun Sep 25, 2011 4:22 pm

Which version of Python do you use?
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 2144
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: Problem with recovery.py

Postby leSasch » Sun Sep 25, 2011 4:35 pm

maschoff wrote:Which version of Python do you use?


It's Python 2.6 from Ubuntu 10.04.3 LTS Package (2.6.5-0ubu)
leSasch
 
Posts: 3
Joined: Fri Sep 25, 2009 3:29 pm

Re: Problem with recovery.py

Postby maschoff » Tue Sep 27, 2011 8:07 am

Sorry, it seems to be that we have to escape the percentage character!

Please replace substring
Code: Select all
(lastsent, \'%Y-%m-%d\')

with
Code: Select all
(lastsent, \'%%Y-%%m-%%d\')

Does this work for you?
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 2144
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: Problem with recovery.py

Postby bla2508 » Thu Apr 26, 2012 1:53 pm

Thanks that worked for me ;-)
bla2508
 
Posts: 8
Joined: Tue Aug 02, 2011 1:10 pm


Return to Bugs, bug fixes & releases

Who is online

Users browsing this forum: No registered users and 1 guest

cron