#7096 encoding error on smtp_server task handoff

sf-1 (616)

Here's the trace, and one of the email headers is Content-Type: text/plain; charset=ISO-8859-1; format=flowed and certainly there was some non-utf8 in the mail body.

Traceback (most recent call last):
  File "/var/local/allura/Allura/allura/command/smtp_server.py", line 57, in process_message
    peer=peer, mailfrom=mailfrom, rcpttos=rcpttos, data=data)
  File "/var/local/allura/Allura/allura/lib/decorators.py", line 62, in post
    return M.MonQTask.post(func, args, kwargs, delay=delay)
  File "/var/local/allura/Allura/allura/model/monq_model.py", line 173, in post
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/base.py", line 29, in inner
    result = func(obj, *args, **kwargs)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/odmsession.py", line 59, in flush
    self.insert_now(obj, st)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/base.py", line 29, in inner
    result = func(obj, *args, **kwargs)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/odmsession.py", line 67, in insert_now
    mapper(obj).insert(obj, st, self, **kwargs)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/base.py", line 29, in inner
    result = func(obj, *args, **kwargs)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/odm/mapper.py", line 55, in insert
    session.impl.insert(doc, validate=False)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/session.py", line 22, in wrapper
    return func(self, doc, *args, **kwargs)
  File "/var/local/env-allura/lib/python2.7/site-packages/Ming-0.4.2-py2.7.egg/ming/session.py", line 160, in insert
    bson = self._impl(doc).insert(data, safe=kwargs.get('safe', True))
  File "/var/local/env-allura/lib/python2.7/site-packages/pymongo-2.4.2-py2.7-linux-x86_64.egg/pymongo/collection.py", line 359, in insert
    continue_on_error, self.__uuid_subtype), safe)
InvalidStringData: ('strings in documents must be valid UTF-8', 'doc: 


  • Dave Brondsema

    Dave Brondsema - 2014-01-24
    • Size: --> 1
  • Tim Van Steenburgh

    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
  • Tim Van Steenburgh

    • status: in-progress --> code-review
  • Tim Van Steenburgh


    To repro on master (tail allura.log to see error):

    yum install swaks
    swaks --server localhost:50088 --to 1@tickets.testproject.p.tvansteenburgh-1024.sb.sf.net --from 'user01@users.sf.net' --body "`printf "\xc3\x28"`"

    Apply fix, restart smtp_server, rerun swaks command.

  • Dave Brondsema

    Dave Brondsema - 2014-01-31
    • status: code-review --> closed
    • QA: Dave Brondsema

Log in to post a comment.