bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

[Air Mozilla] dev server unable to write out sent emails



Infrastructure & Operations
WebOps: IT-Managed Tools
3 years ago
3 years ago


(Reporter: peterbe, Assigned: cyliang)



(Whiteboard: [kanban:https://webops.kanbanize.com/ctrl_board/2/1524] )



3 years ago
On the dev server we have configured the email sending backend to instead write to a static directory that is then accessible by apache viewing so you can see what emails *would* have been sent if it was sent to an SMTP server or something. 

This has stopped working in the new dev server.

Failed to send about <Event: Ma Face>
  File "/data/python-dev/src/air-dev.allizom.org/air/airmozilla/new/eventemails.py", line 43, in send_new_event_emails
  File "/data/python-dev/src/air-dev.allizom.org/air/airmozilla/new/sending.py", line 56, in send_about_new_event
  File "/data/python-dev/src/air-dev.allizom.org/venv/lib/python2.6/site-packages/django/core/mail/message.py", line 276, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/data/python-dev/src/air-dev.allizom.org/venv/lib/python2.6/site-packages/django/core/mail/message.py", line 237, in get_connection
    self.connection = get_connection(fail_silently=fail_silently)
  File "/data/python-dev/src/air-dev.allizom.org/venv/lib/python2.6/site-packages/django/core/mail/__init__.py", line 30, in get_connection
    return klass(fail_silently=fail_silently, **kwds)
  File "/data/python-dev/src/air-dev.allizom.org/venv/lib/python2.6/site-packages/django/core/mail/backends/filebased.py", line 30, in __init__
    raise ImproperlyConfigured('Could not create directory for saving email messages: %s (%s)' % (self.file_path, err))
ImproperlyConfigured: Could not create directory for saving email messages: /data/www/air-dev.allizom.org/air/media/emails ([Errno 13] Permission denied: '/data/www')


3 years ago
Whiteboard: [kanban:https://webops.kanbanize.com/ctrl_board/2/1524]

Comment 1

3 years ago
Is the email supposed to be generated by code running on the Air Mozilla web heads?  Or some other component (like a job invoked by manage.py / django-admin)?

I ask because the presence of "/data/python-dev/src/air-dev.allizom.org" in the traceback implies that this is being run on the admin node.  On that node, there is no /data/www/ directory, which is why writing a message to /data/www/air-dev.allizom.org/air/media/emails would fail.

That directory definitely does on the -dev web head and Apache can write to it. [1]  

[1] [cliang@python1.dev.webapp.phx1 ~]$ ls -lad /data/www/air-dev.allizom.org/air/media/emails
drwxrwxrwx 2 apache apache 20480 Aug  7 21:47 /data/www/air-dev.allizom.org/air/media/emails

Comment 2

3 years ago
Before we only sent emails from the webheads. I.e. as part of a request/response cycle. 
These emails do get sent from a cron job. 

Would it be possible to change things so that they both write to the same destination? Do they have any shared filesystem?


3 years ago
Assignee: server-ops-webops → cliang

Comment 3

3 years ago
The file system that's mounted as /data/www/air-dev.allizom.org/air/media on the webheads is *already* mounted on the admin node under a different file path.  As an experiment, I've changed the EMAIL_FILE_PATH in the local settings file to reflect the underlying file mount, which is present on both the admin node and the web-heads.  Can you please test and let me know if it works?

Comment 4

3 years ago
Emails from the admin node works
And it works from the webheads too


Thanks for being awesome!
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.