After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612568 - Error while creating a user account
Error while creating a user account
Status: RESOLVED FIXED
Product: snowy
Classification: Deprecated
Component: Tomboy Online
git master
Other Linux
: Urgent major
: 0.2
Assigned To: snowy-maint
snowy-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-11 14:32 UTC by Stefano
Modified: 2010-03-19 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a simple mail debugging server (5.22 KB, patch)
2010-03-11 19:34 UTC, Sander Dijkhuis
committed Details | Review

Description Stefano 2010-03-11 14:32:08 UTC
* Operating System: Gentoo Stable
* Snowy version: checkout on 11/03/2010
* Backend used: tested with both mysql / sqlite
* General Error: 
error at /accounts/register/

(111, 'Connection refused')

Request Method: 	POST
Request URL: 	http://127.0.0.1:8000/accounts/register/
Exception Type: 	error
Exception Value: 	

(111, 'Connection refused')

Exception Location: 	/usr/lib/python2.6/socket.py in create_connection, line 514
Python Executable: 	/usr/bin/python2.6
Python Version: 	2.6.4
Python Path: 	['/home/stefano/Desktop/snowy', '/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/PIL', '/usr/lib/python2.6/site-packages/gst-0.10', '/usr/lib/python2.6/site-packages/gtk-2.0', '/usr/lib/portage/pym', '/home/stefano/Desktop/snowy/lib', '/home/stefano/Desktop/snowy/lib']
Server time: 	Thu, 11 Mar 2010 09:19:36 -0500

* Stacktrace:

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/register/
Django Version: 1.1.1
Python Version: 2.6.4
Installed Applications:
['core',
 'api',
 'accounts',
 'notes',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.humanize',
 'registration',
 'south',
 'reversion',
 'gravatar',
 'autoslug',
 'piston',
 'pagination']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.csrf.middleware.CsrfViewMiddleware',
 'django.contrib.csrf.middleware.CsrfResponseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'reversion.middleware.RevisionMiddleware',
 'recaptcha_django.middleware.ReCaptchaMiddleware',
 'pagination.middleware.PaginationMiddleware')


Traceback:
  • File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 92 in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  • File "/home/stefano/Desktop/snowy/lib/registration/views.py", line 137 in register
    new_user = form.save()
  • File "/home/stefano/Desktop/snowy/lib/registration/forms.py", line 79 in save
    email=self.cleaned_data['email'])
  • File "/usr/lib/python2.6/site-packages/django/db/transaction.py", line 240 in _commit_on_success
    res = func(*args, **kw)
  • File "/home/stefano/Desktop/snowy/lib/registration/models.py", line 133 in create_inactive_user
    send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [new_user.email])
  • File "/usr/lib/python2.6/site-packages/django/core/mail.py", line 390 in send_mail
    connection=connection).send()
  • File "/usr/lib/python2.6/site-packages/django/core/mail.py", line 266 in send
    return self.get_connection(fail_silently).send_messages([self])
  • File "/usr/lib/python2.6/site-packages/django/core/mail.py", line 166 in send_messages
    new_conn_created = self.open()
  • File "/usr/lib/python2.6/site-packages/django/core/mail.py", line 131 in open
    local_hostname=DNS_NAME.get_fqdn())
  • File "/usr/lib/python2.6/smtplib.py", line 239 in __init__
    (code, msg) = self.connect(host, port)
  • File "/usr/lib/python2.6/smtplib.py", line 295 in connect
    self.sock = self._get_socket(host, port, self.timeout)
  • File "/usr/lib/python2.6/smtplib.py", line 273 in _get_socket
    return socket.create_connection((port, host), timeout)
  • File "/usr/lib/python2.6/socket.py", line 514 in create_connection
    raise error, msg
Exception Type: error at /accounts/register/
Exception Value: (111, 'Connection refused')
Comment 1 Sandy Armstrong 2010-03-11 14:34:12 UTC
On openSUSE 11.2, I get a different trace, but I'm sharing in case it is related/helpful:

Environment:

Request Method: POST
Request URL: http://localhost:8000/accounts/register/
Django Version: 1.1
Python Version: 2.6.2
Installed Applications:
['core',
 'api',
 'accounts',
 'notes',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.humanize',
 'registration',
 'south',
 'reversion',
 'gravatar',
 'autoslug',
 'piston',
 'pagination']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.csrf.middleware.CsrfViewMiddleware',
 'django.contrib.csrf.middleware.CsrfResponseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'snowy.accounts.middleware.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'reversion.middleware.RevisionMiddleware',
 'recaptcha_django.middleware.ReCaptchaMiddleware',
 'pagination.middleware.PaginationMiddleware')


Traceback:
  • File "/usr/local/lib/python2.6/site-packages/django/core/handlers/base.py", line 92 in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  • File "/usr/local/lib/python2.6/site-packages/django/db/transaction.py", line 240 in _commit_on_success
    res = func(*args, **kw)
Exception Type: ImportError at /accounts/register/
Exception Value: No module named signals
Comment 2 Sander Dijkhuis 2010-03-11 19:34:22 UTC
I can reproduce Stefano's problem. It is caused by Django's send_mail(), which assumes that the SMTP server specified in snowy.settings is available (localhost:25 by default). On most systems, it isn't.

The Django developers seem to solve this by running a temporary debugging server, that outputs sent emails to stdout. They do not seem to be adding an option for not sending email at all.
http://code.djangoproject.com/ticket/8638

I'm adding a patch that adds a mail debugging server of this kind to Snowy. It fixes the problem, and makes it easier to debug emails and open account activation links.

Sandy's problem seems unrelated to me, but maybe the patch magically fixes that too. :-)
Comment 3 Sander Dijkhuis 2010-03-11 19:34:50 UTC
Created attachment 155885 [details] [review]
Add a simple mail debugging server

Django's send_mail() assumes that the SMTP server as set in snowy.settings
is available, and gives an error otherwise. This patch adds a debugmail
command to manage.py, which starts a small smptd server that matches these
settings. Instead of sending emails, they are printed to stdout.
Comment 4 Sandy Armstrong 2010-03-19 18:19:44 UTC
Review of attachment 155885 [details] [review]:

Looks good to me.  I made one comment to update your NOTE in INSTALL, but otherwise I'm happy with it.  Thanks for this!

::: INSTALL
@@ +30,3 @@
+
+	python manage.py debugmail
+4. Start mail debugging server (in your snowy git checkout):

maybe say "NOTE: This is only needed if Snowy needs to send mails (like in the case of user registration) and you don't have an SMTP server set up."
Comment 5 Sander Dijkhuis 2010-03-19 18:27:59 UTC
Thanks, committed the patch with the note change.