Contact Form Error

47 views
Skip to first unread message

Richard Jackson

unread,
Feb 13, 2017, 4:38:42 AM2/13/17
to Mezzanine Users
Hi everyone,

I'm getting the following traceback error when I try to submit a form (/contact) - it's been affecting my live site for a while, and here's the error when it's done locally. Any thoughts?

Thanks,

Rich

Environment:


Request Method: POST

Django Version: 1.8.4
Python Version: 2.7.6
Installed Applications:
(u'mezzanine.boot',
 u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.redirects',
 u'django.contrib.sessions',
 u'django.contrib.sites',
 u'django.contrib.sitemaps',
 u'vital_theme',
 u'mezzanine.conf',
 u'mezzanine.core',
 u'mezzanine.generic',
 u'mezzanine.pages',
 u'mezzanine.blog',
 u'mezzanine.forms',
 u'mezzanine.galleries',
 u'mezzanine.twitter',
 u'mezzanine.accounts',
 u'debug_toolbar',
 u'filebrowser_safe',
 u'grappelli_safe',
 u'django.contrib.admin',
 u'django.contrib.staticfiles',
 u'django_comments')
Installed Middleware:
(u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'mezzanine.core.request.CurrentRequestMiddleware',
 u'mezzanine.core.middleware.RedirectFallbackMiddleware',
 u'mezzanine.core.middleware.TemplateForDeviceMiddleware',
 u'mezzanine.core.middleware.TemplateForHostMiddleware',
 u'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
 u'mezzanine.core.middleware.SitePermissionMiddleware',
 u'mezzanine.pages.middleware.PageMiddleware',
 u'debug_toolbar.middleware.DebugToolbarMiddleware')


Traceback:
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  125.                     response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/mezzanine/pages/middleware.py" in process_view
  111.             processor_response = processor(request, page)
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/mezzanine/forms/page_processors.py" in form_processor
  64.                                attachments=attachments, headers=headers)
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/mezzanine/utils/email.py" in send_mail_template
  66.     msg.send(fail_silently=fail_silently)
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/django/core/mail/message.py" in send
  303.         return self.get_connection(fail_silently).send_messages([self])
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py" in send_messages
  100.             new_conn_created = self.open()
File "/home/majora/.virtualenvs/richardjackson/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py" in open
  58.             self.connection = connection_class(self.host, self.port, **connection_params)
File "/usr/lib/python2.7/smtplib.py" in __init__
  256.             (code, msg) = self.connect(host, port)
File "/usr/lib/python2.7/smtplib.py" in connect
  316.         self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python2.7/smtplib.py" in _get_socket
  291.         return socket.create_connection((host, port), timeout)
File "/usr/lib/python2.7/socket.py" in create_connection
  571.         raise err

Exception Type: error at /contact/
Exception Value: [Errno 111] Connection refused



Iain Mac Donald

unread,
Feb 13, 2017, 5:46:48 AM2/13/17
to mezzani...@googlegroups.com
On Mon, 13 Feb 2017 01:38:42 -0800 (PST)
Richard Jackson <rjack...@gmail.com> wrote:

> Exception Value: [Errno 111] Connection refused

Can you access the SMTP server?

--

Regards,
Iain.

Richard Jackson

unread,
Feb 13, 2017, 7:29:03 AM2/13/17
to mezzani...@googlegroups.com
Hi Iain,

I'm at work atm but will check as soon as I'm home. What's the best way to test that?

Thanks,

Rich

--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/SH46jnSkr3o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Iain Mac Donald

unread,
Feb 13, 2017, 8:36:11 AM2/13/17
to mezzani...@googlegroups.com
On Mon, 13 Feb 2017 12:28:50 +0000
Richard Jackson <rjack...@gmail.com> wrote:

> What's the best way to
> test that?

Python, system utility like mailx or you could communicate directly
using telnet:
https://www.port25.com/how-to-check-an-smtp-connection-with-a-manual-telnet-session-2/

MTAs all have means of test routing too.

I guess you need to set these to something sensible:
SERVER_EMAIL
DEFAULT_FROM_EMAIL

--

Regards,
Iain.

Richard Jackson

unread,
Feb 13, 2017, 8:56:18 AM2/13/17
to mezzani...@googlegroups.com
Much obliged, I'll check these tonight.

Rich

--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/SH46jnSkr3o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Freelance Composer - Richard Jackson Music
Twitter: @rjmusic87

Richard Jackson

unread,
Feb 13, 2017, 1:46:53 PM2/13/17
to Mezzanine Users, ri...@richardjacksonmusic.com
I started looking into these and will keep doing so in the next few days. How would SMPT server settings be configured in Django/Mez?

I've also found that the form IS storing the entries correctly but then erroring/not sending out any emails to either the form submitter or any admin. Does this sound like an SMPT issue?

Cheers,

Rich

Iain Mac Donald

unread,
Feb 13, 2017, 2:36:12 PM2/13/17
to mezzani...@googlegroups.com
On Mon, 13 Feb 2017 10:46:53 -0800 (PST)
Richard Jackson <rjack...@gmail.com> wrote:

> I started looking into these and will keep doing so in the next few
> days. How would SMPT server settings be configured in Django/Mez?

https://docs.djangoproject.com/en/1.10/topics/email/


. Does this sound like an SMPT issue?

The very last line of your traceback suggests a connection error (host
port timeout). SMTP not running? Authentication error?

If you haven't explicitly set the SMTP server it probably defaults to
localhost.

--

Regards,
Iain.

Richard Jackson

unread,
Feb 13, 2017, 2:52:09 PM2/13/17
to mezzani...@googlegroups.com
OK thank you - I don't believe anything's been set up explicitly so I'll take a look into it. Really appreciate your time on this.

Rich


--

Regards,
Iain.

--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/SH46jnSkr3o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Melvyn Sopacua

unread,
Feb 15, 2017, 12:09:42 PM2/15/17
to mezzani...@googlegroups.com

On Monday 13 February 2017 10:46:53 Richard Jackson wrote:

> I started looking into these and will keep doing so in the next few

> days. How would SMPT server settings be configured in Django/Mez?

 

Not so obvious, but remember "Mezzanine is just Django":

https://docs.djangoproject.com/en/1.10/ref/settings/#email-host

 

--

Melvyn Sopacua

Richard Jackson

unread,
Feb 16, 2017, 11:42:58 AM2/16/17
to Mezzanine Users
Hi all,

This has been sorted in the live environment - was actually an issue with how I'd configured my domain's email addresses/mailboxes. The issue still persists in development, though I don't feel this is as pressing a concern!

Thanks for your time and input!

Rich
Reply all
Reply to author
Forward
0 new messages