question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allauth sign up / sign in seems broken - Connection Refused Errors

See original GitHub issue

I’m getting Connection Refused Error when attempting to signup or sign in in the default cookie cutter-django setup (consistent across multiple machine and whether developing locally or with docker). Which look to be due to django-allauth: (e.g. signin error looks to be caused when it can’t find the email address in the query - I would have expected just a typical error in the page for this)

Signup trace:

Internal Server Error: /accounts/signup/
Traceback (most recent call last):
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/utils/decorators.py", line 34, in _wrapper
    return bound_func(*args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/utils/decorators.py", line 30, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 173, in dispatch
    return super(SignupView, self).dispatch(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 68, in dispatch
    **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 151, in dispatch
    **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 84, in post
    response = self.form_valid(form)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 189, in form_valid
    self.get_success_url())
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/utils.py", line 171, in complete_signup
    signal_kwargs=signal_kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/utils.py", line 135, in perform_login
    send_email_confirmation(request, user, signup=signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/utils.py", line 300, in send_email_confirmation
    signup=signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/models.py", line 58, in send_confirmation
    confirmation.send(request, signup=signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/models.py", line 122, in send
    get_adapter().send_confirmation_mail(request, self, signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/adapter.py", line 355, in send_confirmation_mail
    ctx)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/adapter.py", line 102, in send_mail
    msg.send()
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/mail/message.py", line 303, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
    new_conn_created = self.open()
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 58, in open
    self.connection = connection_class(self.host, self.port, **connection_params)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/smtplib.py", line 242, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/smtplib.py", line 321, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/smtplib.py", line 292, in _get_socket
    self.source_address)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socket.py", line 512, in create_connection
    raise err
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socket.py", line 503, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

Signin trace:

 "GET /accounts/login/ HTTP/1.1" 200 13854
Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/utils.py", line 292, in send_email_confirmation
    email_address = EmailAddress.objects.get_for_user(user, email)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/managers.py", line 49, in get_for_user
    email__iexact=email)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/db/models/query.py", line 334, in get
    self.model._meta.object_name
allauth.account.models.DoesNotExist: EmailAddress matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/managers.py", line 15, in add_email
    email_address = self.get(user=user, email__iexact=email)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/db/models/query.py", line 334, in get
    self.model._meta.object_name
allauth.account.models.DoesNotExist: EmailAddress matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/utils/decorators.py", line 34, in _wrapper
    return bound_func(*args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/utils/decorators.py", line 30, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 100, in dispatch
    return super(LoginView, self).dispatch(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 68, in dispatch
    **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 84, in post
    response = self.form_valid(form)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/views.py", line 108, in form_valid
    return form.login(self.request, redirect_url=success_url)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/forms.py", line 144, in login
    redirect_url=redirect_url)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/utils.py", line 135, in perform_login
    send_email_confirmation(request, user, signup=signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/utils.py", line 309, in send_email_confirmation
    confirm=True)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/managers.py", line 20, in add_email
    signup=signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/models.py", line 58, in send_confirmation
    confirmation.send(request, signup=signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/models.py", line 122, in send
    get_adapter().send_confirmation_mail(request, self, signup)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/adapter.py", line 355, in send_confirmation_mail
    ctx)
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/allauth/account/adapter.py", line 102, in send_mail
    msg.send()
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/mail/message.py", line 303, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
    new_conn_created = self.open()
  File "/Users/Barclay/.virtualenvs/switcher2/lib/python3.4/site-packages/django/core/mail/backends/smtp.py", line 58, in open
    self.connection = connection_class(self.host, self.port, **connection_params)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/smtplib.py", line 242, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/smtplib.py", line 321, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/smtplib.py", line 292, in _get_socket
    self.source_address)
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socket.py", line 512, in create_connection
    raise err
  File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/socket.py", line 503, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

11reactions
scuerdacommented, Sep 14, 2015

Switching EMAIL_BACKEND to console fixes this for me.

EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')

1reaction
pydannycommented, Sep 12, 2015

Looks like you don’t have an email client specified, or haven’t set up Mailgun.

Read more comments on GitHub >

github_iconTop Results From Across the Web

allauth sign up / sign in seems broken - Connection Refused ...
I'm getting Connection Refused Error when attempting to signup or sign in in the default cookie cutter-django setup (consistent across ...
Read more >
Frequently Asked Questions - django-allauth! - Read the Docs
Social login trouble: There are many reasons why the social login for a provider is not working for you. Common causes are errors...
Read more >
Django allauth example [Errno 61] Connection refused
When I sign up I run into connectivity errors (connection refused et al) ... Therefore, allauth is unable to send verification mails.
Read more >
django-allauth Documentation - Read the Docs
Pluggable signup form for asking additional questions during signup. • Support for connecting multiple social accounts to a Django user ...
Read more >
signup / registration error - permissions and cert chains - Lists
If I'm reading the error correctly, this is related to an inability to verify the cert chain. The /etc/mailman3/settings.py file points to the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found