Page 1 of 1

Problem with recovery.py

Posted: Tue Aug 16, 2011 3:16 pm
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

Re: Problem with recovery.py

Posted: Tue Aug 16, 2011 8:42 pm
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).

Re: Problem with recovery.py

Posted: Wed Aug 17, 2011 4:00 am
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

Re: Problem with recovery.py

Posted: Sun Sep 25, 2011 3:57 pm
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.

Re: Problem with recovery.py

Posted: Sun Sep 25, 2011 4:22 pm
by maschoff
Which version of Python do you use?

Re: Problem with recovery.py

Posted: Sun Sep 25, 2011 4:35 pm
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)

Re: Problem with recovery.py

Posted: Tue Sep 27, 2011 8:07 am
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?

Re: Problem with recovery.py

Posted: Thu Apr 26, 2012 1:53 pm
by bla2508
Thanks that worked for me ;-)