Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior for events with special characters (in the location description) #268

Open
hschovanec-usgs opened this issue Oct 20, 2020 · 2 comments
Assignees

Comments

@hschovanec-usgs
Copy link
Member

hschovanec-usgs commented Oct 20, 2020

Behavior:

  • Sending the onepager.pdf fails for events with special characters.
    • Example eventids: us6000ca0k and us6000ah9t
  • Failure to send the pdf result in the version being deleted.
  • Since a version is not written to the database, short and long format emails are repeatedly sent to emails for that alert level.

Failure point:

  • In the logging, the last available message is always "Sending pdf addresses..."
  • If it completed without failure it should say "Done." after that.
  • This means that it is failing between lines 316 and 329.
    • The attachment along with the special characters in the message may be causing a failure that is captured by try/except in EmailSender, but isn't logged?
@hschovanec-usgs hschovanec-usgs changed the title Strange behavior for events with special characters Strange behavior for events with special characters (in the location description) Oct 20, 2020
@hschovanec-usgs
Copy link
Member Author

hschovanec-usgs commented Oct 20, 2020

Tested locally, when a special character (example message "Hafnarfjörður, Iceland") is included in the message for an email without an attachment no error occurs. When any attachment is encluded (even simple text file) the special character results in the following exception: Exception: Could not send mail to with EmailSender. "The message to ['', ',<EMAIL REDACTED>'] was not sent. The server error messages are below:{'<SMTP SERVER REDACTED>': "Connection to server failed (possible timeout): 'ascii' codec can't encode character '\\xf6' in position 330: ordinal not in range(128)"}"

Currently, this is caught in the last "except".

@hschovanec-usgs
Copy link
Member Author

Pull request created for a temporary fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants