Problem with recovery.py
Moderator: moderator
Problem with recovery.py
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
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
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Re: Problem with recovery.py
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
Re: Problem with recovery.py
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
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
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.
/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
It's Python 2.6 from Ubuntu 10.04.3 LTS Package (2.6.5-0ubu)maschoff wrote:Which version of Python do you use?
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Re: Problem with recovery.py
Sorry, it seems to be that we have to escape the percentage character!
Please replace substring
with
Does this work for you?
Please replace substring
Code: Select all
(lastsent, \'%Y-%m-%d\')
Code: Select all
(lastsent, \'%%Y-%%m-%%d\')
OpenEMM Maintainer
Re: Problem with recovery.py
Thanks that worked for me 
