error upon retrieving mail through fetchmail, message_process

Bug #1063251 reported by JKW
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team
Therp Backports (Deprecated)
Status tracked in Addons-6.1
Addons-6.1
Fix Released
High
Holger Brunn (Therp)

Bug Description

I had installed openerp on a windows 7 64bit installation, everything went well and I was able to create applicant (hr module) from email addresses just fine, however, in the past 2 days, I started to encounter an issue where email cannot be retrieved anymore. The log shows as below:

2012-10-08 00:20:54,927 6776 INFO ? fetchmail: start checking for new emails on pop server my_pop_server
2012-10-08 00:20:57,460 6776 ERROR ? fetchmail: Failed to fetch mail from pop server my_pop_server
Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 6.1-20121006-233043\Server\server\openerp\addons\fetchmail\fetchmail.py", line 221, in fetch_mail
  File "C:\Program Files (x86)\OpenERP 6.1-20121006-233043\Server\server\openerp\addons\mail\mail_thread.py", line 361, in message_process
TypeError: expected string or buffer

I have no idea what's causing it as I'm not a programmer.

PS. on a side note, there was an email that received through my pop server that has empty 'subject', could that be the cause of the problem?

JKW

Related branches

Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

JKW,

You are right and this is a good catch!

We confirm the error.

Thanks.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

The proposed fix is attached in the branch linked.
Thanks.

Changed in openobject-addons:
importance: Undecided → Critical
status: Confirmed → Fix Committed
importance: Critical → Low
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

More than a month elapsed!

Hope is alive to get this merged for stable!

Thanks.

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote : Re: [Bug 1063251] Re: error upon retrieving mail through fetchmail, message_process

+1

2012/11/9 Serpent Consulting Services <email address hidden>

> More than a month elapsed!
>
> Hope is alive to get this merged for stable!
>
> Thanks.
>
> --
> You received this bug notification because you are subscribed to OpenERP
> Project Group.
> https://bugs.launchpad.net/bugs/1063251
>
> Title:
> error upon retrieving mail through fetchmail, message_process
>
> Status in OpenERP Addons (modules):
> Fix Committed
>
> Bug description:
> I had installed openerp on a windows 7 64bit installation, everything
> went well and I was able to create applicant (hr module) from email
> addresses just fine, however, in the past 2 days, I started to
> encounter an issue where email cannot be retrieved anymore. The log
> shows as below:
>
> 2012-10-08 00:20:54,927 6776 INFO ? fetchmail: start checking for new
> emails on pop server my_pop_server
> 2012-10-08 00:20:57,460 6776 ERROR ? fetchmail: Failed to fetch mail
> from pop server my_pop_server
> Traceback (most recent call last):
> File "C:\Program Files (x86)\OpenERP
> 6.1-20121006-233043\Server\server\openerp\addons\fetchmail\fetchmail.py",
> line 221, in fetch_mail
> File "C:\Program Files (x86)\OpenERP
> 6.1-20121006-233043\Server\server\openerp\addons\mail\mail_thread.py", line
> 361, in message_process
> TypeError: expected string or buffer
>
> I have no idea what's causing it as I'm not a programmer.
>
> PS. on a side note, there was an email that received through my pop
> server that has empty 'subject', could that be the cause of the
> problem?
>
> JKW
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/1063251/+subscriptions
>

--
--------------------
Saludos Cordiales

Nhomar G. Hernandez M.
+58-414-4110269
Skype: nhomar00
Web-Blog: http://geronimo.com.ve
Servicios IT: http://vauxoo.com
Linux-Counter: 467724
Correos:
<email address hidden>
<email address hidden>
twitter @nhomar

Revision history for this message
Mohamed M. Hagag (mohamedhagag1981) wrote :

OK, I got the same error with the fixed branch:
Traceback (most recent call last):
  File "/opt/1/openerp/addons/fetchmail/fetchmail.py", line 221, in fetch_mail
    context=context)
  File "/opt/1/openerp/addons/mail/mail_thread.py", line 361, in message_process
    match = tools.res_re.search(msg.get('subject',_('No Subject')))
TypeError: expected string or buffer

And in the same time - i tried to fix the old stable branch with the same error - I will post the changes i made because i'm not python programmer and i don't know how to submit such fix - BTW the fix is working fine with Arabic (unicode) and (No subject) msgs.

function message_append_dict line 289 :
                            subject = unicode(str(msg_dict.get('subject')),errors='ignore') or "No Subject!",

function message_process line 361:
            match = tools.res_re.search(unicode(str(msg['subject']), errors='ignore'))

that solved the TypeError msg mentioned before and another error of type UnicodeDecodeError ( i don't remember the other Unicode error exactly ).

Again I'm not a python programmer and for sure there's a better way to fix this - or it may not be a bug at all - so plz review and fix the fix if possible.

Hope this helps - and hope it will be fixed in the next release.

Regards,

Revision history for this message
Mohamed M. Hagag (mohamedhagag1981) wrote :

sorry attached is the complete file with the fix.

Revision history for this message
Mohamed M. Hagag (mohamedhagag1981) wrote :

Notes on the previous fix:

For this fix to work you have to stop the openerp-server & delete mail_thread.pyc - ( for beginners who don't know)

then copy the new file to replace the old file.

start openerp-server again - it should work.

this worked fine on my testing VM - on the production VM this works also fine except for a python threading and strptime error printed in the server log - I think python version affects this - or some python pkg is missing on the prod VM.

Regards,

Revision history for this message
Mohamed M. Hagag (mohamedhagag1981) wrote :

OK the The proposed fix is attached in the branch linked is working fine on my production VM but raises TypeError msg on the test VM

And the fix which i submitted is working fine on the test VM - but raises a UnicodeDecodeError on the Production VM.

i think python version is the problem as the production is CentOS 6 with py-2.6.6 and the Test is Ubu-12.04 LTS with py-2.7.3 .

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.