nadineproject / nadine

Open Coworking Software
http://nadineproject.org
GNU Affero General Public License v3.0
163 stars 78 forks source link

Invalid Email settings throw "name resolution" error on user create. #434

Closed Midna3689 closed 4 years ago

Midna3689 commented 4 years ago

Hello, so im very new to nadine and trying to learn its functionality to implement it in my work enviroment. after i finish the setup and migrate, when i run ' ./manage.py createsuperuser ' , i get the error: "socket.gaierror: [Errno -3] Temporary failure in name resolution" even when i run the website and create user i get this error page:

Request Method: POST

http://localhost:8000/admin/auth/user/add/ 3.0.2 gaierror [Errno -3] Temporary failure in name resolution /usr/lib/python3.7/socket.py in getaddrinfo, line 748 /home/maha/nadine/bin/python3 3.7.5 ['/home/maha/nadine/nadine', '/home/maha/nadine/lib/python37.zip', '/home/maha/nadine/lib/python3.7', '/home/maha/nadine/lib/python3.7/lib-dynload', '/usr/lib/python3.7', '/home/maha/nadine/lib/python3.7/site-packages', '/home/maha/nadine/src/django-jsignature'] Sun, 2 Feb 2020 11:41:44 +0300

can anyone help me identify the issue? ps: my work pc is behind a proxy.

jsayles commented 4 years ago

That is possibly an error when it is sending the email validation email. Check your mail settings. On Feb 2, 2020, 12:43 AM -0800, Maha notifications@github.com, wrote:

Hello, so im very new to nadine and trying to learn its functionality to implement it in my work enviroment. after i finish the setup and migrate, when i run ' ./manage.py createsuperuser ' , i get the error: "socket.gaierror: [Errno -3] Temporary failure in name resolution" even when i run the website and create user i get this error page: Request Method: POST http://localhost:8000/admin/auth/user/add/ 3.0.2 gaierror [Errno -3] Temporary failure in name resolution /usr/lib/python3.7/socket.py in getaddrinfo, line 748 /home/maha/nadine/bin/python3 3.7.5 ['/home/maha/nadine/nadine', '/home/maha/nadine/lib/python37.zip', '/home/maha/nadine/lib/python3.7', '/home/maha/nadine/lib/python3.7/lib-dynload', '/usr/lib/python3.7', '/home/maha/nadine/lib/python3.7/site-packages', '/home/maha/nadine/src/django-jsignature'] Sun, 2 Feb 2020 11:41:44 +0300 can anyone help me identify the issue? ps: my work pc is behind a proxy. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Midna3689 commented 4 years ago

Yes i found out that the issue was that the email is not being sent. even in another tuitorial project the django is showing the same error.. i'm doubting its my proxy.. is there a way i can let nadine knows that my pc is behind a proxy?

jsayles commented 4 years ago

The Django Project has extensive documentation on how to configure your server for sending emails.
https://docs.djangoproject.com/en/3.0/topics/email/ https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-EMAIL_HOST

I've changed this bug to represent the red herring error message caused by improperly configured mail settings.

Midna3689 commented 4 years ago

i have found the solution so i thought i would share it in case someone come across a similar error. basically the smtp code had to be wrapped in http socket since my company gateway server is http.

step 1: go to the resolv.conf file and add

nameserver <your proxy server IP address here>
nameserver 8.8.4.4
nameserver 8.8.8.8

step 2: after finishing installing nadine, source the nadine virtual enviroment and then install PySocks using pip command

step 3: edit the smtp.py file located in /home/nadine/lib/python3.7/site-packages/django/core/mail/backends add these three lines in the code

import socks

under the EmailBackend(BaseEmailBackend) class

socks.setdefaultproxy(socks.HTTP, '<your proxy server ip address here>', <your por here>) socks.wrapmodule(smtplib)

i hope this could be helpful for others.