Email setup fail

I have 2 fresh installs, one local VM and one on Google Cloud. Both packaged from Bitnami. I get this error when trying to set up email server. Same on both.

App Versions

{
“erpnext”: “7.0.0-beta”,
“frappe”: “7.0.0-beta”
}
Route

Form/Email Account/Notifications
Error Report

Traceback (most recent call last):
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 20, in savedocs
doc.save()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 250, in save
self._validate()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 369, in _validate
self._save_passwords()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 582, in _save_passwords
set_encrypted_password(self.doctype, self.name, new_password, df.fieldname)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 25, in set_encrypted_password
{ ‘doctype’: doctype, ‘name’: name, ‘fieldname’: fieldname, ‘pwd’: encrypt(pwd) })
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 95, in encrypt
cipher_suite = Fernet(encode(get_encryption_key()))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python2.7/site-packages/cryptography/fernet.py”, line 32, in init
backend = default_backend()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python2.7/site-packages/cryptography/hazmat/backends/init.py”, line 35, in default_backend
_default_backend = MultiBackend(_available_backends())
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python2.7/site-packages/cryptography/hazmat/backends/init.py”, line 22, in _available_backends
“cryptography.backends”
AttributeError: ‘EntryPoint’ object has no attribute ‘resolve’

Traceback (most recent call last):
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/app.py”, line 58, in application
response = frappe.handler.handle()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/init.py”, line 875, in call
return fn(*args, **newargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 20, in savedocs
doc.save()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 250, in save
self._validate()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 369, in _validate
self._save_passwords()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 582, in _save_passwords
set_encrypted_password(self.doctype, self.name, new_password, df.fieldname)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 25, in set_encrypted_password
{ ‘doctype’: doctype, ‘name’: name, ‘fieldname’: fieldname, ‘pwd’: encrypt(pwd) })
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 95, in encrypt
cipher_suite = Fernet(encode(get_encryption_key()))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python2.7/site-packages/cryptography/fernet.py”, line 32, in init
backend = default_backend()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python2.7/site-packages/cryptography/hazmat/backends/init.py”, line 35, in default_backend
_default_backend = MultiBackend(_available_backends())
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/env/lib/python2.7/site-packages/cryptography/hazmat/backends/init.py”, line 22, in _available_backends
“cryptography.backends”
AttributeError: ‘EntryPoint’ object has no attribute ‘resolve’
Request Data

{
“type”: “POST”,
“args”: {
“doc”: “{"default_outgoing":1,"email_id":"art.b@shopinpart.com","creation":"2016-08-18 04:08:25.146662","doctype":"Email Account","unreplied_for_mins":30,"use_imap":0,"owner":"Administrator","use_ssl":1,"always_use_account_email_id_as_sender":0,"default_incoming":0,"modified_by":"Administrator","service":"GMail","use_tls":1,"enable_incoming":0,"attachment_limit":1,"docstatus":0,"enable_auto_reply":0,"enable_outgoing":1,"add_signature":0,"email_account_name":"Notifications","name":"Notifications","idx":0,"modified":"2016-08-18 04:08:25.146662","login_id_is_different":0,"notify_if_unreplied":0,"__last_sync_on":"2016-09-11T20:19:09.656Z","__unsaved":1,"email_server":"pop.gmail.com","smtp_server":"smtp-relay.gmail.com","smtp_port":587,"password":"*****"}”,
“action”: “Save”,
“cmd”: “frappe.desk.form.save.savedocs”
},
“btn”: {},
“freeze”: true,
“freeze_message”: “Saving”,
“url”: “/”
}
Response JSON

{
“_server_messages”: “["{\"message\": \"Did not save\"}"]”
}

Anyone have a clue how to fix this? Is this due to Bitnami packaging or not?

Thanks,
Art.

1 Like

I second this behaviour. I am using Google Cloud without Bitnami. I am unable to setup Email Account SMTP settings. It freezes on ‘Saving’.

I am using Mailgun transactional e-mail service.

Same here, have a Digital Ocean installation, and it’s freezing on setting up Email SMTP Servers.

I found the culprit. Google Cloud does not allow ports 25/465/587 for VM instances. Sending email from an instance  |  Compute Engine Documentation  |  Google Cloud

You can check if you can connect to a port by SSHing to VM and passing
nc -z -v -w5 <host> <port>

The only option is to use Google Apps or services supported by Google Cloud.
Fortunately for me, I was using Mailgun for which Google has allowed port 2525.

That’s not where my problem is. I’m using Google Apps SMTP Relay service on
port 587 which is allowed. I’ve tried inputting wrong settings and each
time I get a different error related to that setting.
The one that I can’t find is:

AttributeError: ‘EntryPoint’ object has no attribute ‘resolve’

I’m sorry. I misinterpreted the issue. Anyway after doing some research I found that it had something to do with cryptography version. To find the version, type:

pip show cryptography

Make a note of the version in case you want to revert any changes. As per this Github issue, the problem was solved by downgrading to Version 1.2.1 by passing command:

pip install cryptography==1.2.1

@snv I am trying to setup the email domain with Mailgun.
Could you share the steps to do that?

I appreciate your help :slight_smile:

Use smtp.mailgun.org:587 with the SMTP user and pass available on domain’s control panel in Mailgun. Just need to setup an email domain, email account(s) and enable the relevant port (587) then.

https://documentation.mailgun.com/en/latest/user_manual.html#sending-via-smtp
https://documentation.mailgun.com/en/latest/user_manual.html#smtp-protocol