Error while adding a user. EC2 installation

Hi, I am running ver4 on Amazon EC2. When I try to add users I get this error every time. I have another instance on EC2 that does not give the same error. I don’t know what’s wrong here. Can somebody help please…

Traceback (innermost last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 175, in save
self.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 162, in insert
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 442, in run_post_save_methods
self.run_method(“on_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 412, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 493, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 476, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 406, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 85, in on_update
self.send_welcome_mail()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 135, in send_welcome_mail
self.send_login_mail(_(“Verify Your Account”), “templates/emails/new_user.html”, {“link”: link})
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 162, in send_login_mail
message=frappe.get_template(template).render(args))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 243, in sendmail
subject=subject, msg=message, attachments=attachments)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/email_lib/init.py”, line 17, in sendmail
send(get_email(recipients, sender, msg, subject, attachments=attachments))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/email_lib/smtp.py”, line 27, in send
email.as_string())
File “/usr/lib/python2.7/smtplib.py”, line 738, in sendmail
self.rset()
File “/usr/lib/python2.7/smtplib.py”, line 462, in rset
return self.docmd(“rset”)
File “/usr/lib/python2.7/smtplib.py”, line 387, in docmd
return self.getreply()
File “/usr/lib/python2.7/smtplib.py”, line 363, in getreply
raise SMTPServerDisconnected(“Connection unexpectedly closed”)
SMTPServerDisconnected: Connection unexpectedly closed

Traceback (innermost last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 49, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 66, in handle
execute_cmd(cmd)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 531, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/widgets/form/save.py”, line 18, in savedocs
doc.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 175, in save
self.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 162, in insert
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 442, in run_post_save_methods
self.run_method(“on_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 412, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 493, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 476, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 406, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 85, in on_update
self.send_welcome_mail()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 135, in send_welcome_mail
self.send_login_mail(_(“Verify Your Account”), “templates/emails/new_user.html”, {“link”: link})
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 162, in send_login_mail
message=frappe.get_template(template).render(args))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 243, in sendmail
subject=subject, msg=message, attachments=attachments)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/email_lib/init.py”, line 17, in sendmail
send(get_email(recipients, sender, msg, subject, attachments=attachments))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/email_lib/smtp.py”, line 27, in send
email.as_string())
File “/usr/lib/python2.7/smtplib.py”, line 738, in sendmail
self.rset()
File “/usr/lib/python2.7/smtplib.py”, line 462, in rset
return self.docmd(“rset”)
File “/usr/lib/python2.7/smtplib.py”, line 387, in docmd
return self.getreply()
File “/usr/lib/python2.7/smtplib.py”, line 363, in getreply
raise SMTPServerDisconnected(“Connection unexpectedly closed”)
SMTPServerDisconnected: Connection unexpectedly closed

raise SMTPServerDisconnected(“Connection unexpectedly closed”)
SMTPServerDisconnected: Connection unexpectedly closed

Check your SMTP connections settings.

TLS is one i suspect to be culprit.

Verify your SMTP config with your email provider and fill it in correctly in email/SMTP settings.

1 Like

Thanks for the hint. It worked with the same settings when I checked the “Always use above Login Id as sender” check box. I did’t have to do anything else.