Problem with recovery.py

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

Moderator: moderator

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

Problem with recovery.py

Post by lneto »

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
maschoff
Site Admin
Posts: 2596
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Problem with recovery.py

Post by maschoff »

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
lneto
Posts: 2
Joined: Tue Aug 16, 2011 3:09 pm

Re: Problem with recovery.py

Post by lneto »

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
leSasch
Posts: 3
Joined: Fri Sep 25, 2009 3:29 pm

Re: Problem with recovery.py

Post by leSasch »

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.
maschoff
Site Admin
Posts: 2596
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Problem with recovery.py

Post by maschoff »

Which version of Python do you use?
OpenEMM Maintainer
leSasch
Posts: 3
Joined: Fri Sep 25, 2009 3:29 pm

Re: Problem with recovery.py

Post by leSasch »

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)
maschoff
Site Admin
Posts: 2596
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Problem with recovery.py

Post by maschoff »

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
bla2508
Posts: 8
Joined: Tue Aug 02, 2011 1:10 pm

Re: Problem with recovery.py

Post by bla2508 »

Thanks that worked for me ;-)
Post Reply