Crashing on adding SMTP password

Hi,
I am having issues with setting up emails with the production VM of erpnext. I downloaded a new version today and still have the same isdue. First I can’t connect to a local SMTP server with no password and when I try connecting to any external SMTP server with a password, or local with password, the webpage freezes on save. It’s not a port issue as I can send mail via the mail command and connect to the external servers via terminal.

Is there a fix as this greatly effects my use of erpnext :frowning: I tried rolling back the cryptography with pip but got errors so have to stay with the installed version which comes with the VM.

Thanks

Hello,

When saving Email Account fails, is there any message in the browser’s console?

O found a partial fix was to use the ip address of the mail server instead of the host name when my vm would hang on trying to talk to my mail server via its host name.

This does need a fix really.

When I enter a password all I get is a grey out saving logo when using domain names and passwords. No error is recorded in the error log. I get the following error when trying to connect without a password

{‘retry’: 0, ‘log’: <function log at 0xb5ca656c>, ‘site’: u’erpnext.vm’, ‘event’: u’all’, ‘method_name’: u’frappe.email.queue.flush’, ‘method’: <function flush at 0xb5c2233c>, ‘user’: u’Administrator’, ‘kwargs’: {}, ‘async’: True, ‘job_name’: u’frappe.email.queue.flush’}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 61, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 227, in flush
check_email_limit([])
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 136, in check_email_limit
smtp_server = SMTPServer()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 134, in init
self.setup_email_account(append_to)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 137, in setup_email_account
self.email_account = get_outgoing_email_account(raise_exception_not_set=False, append_to=append_to)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/smtp.py”, line 62, in get_outgoing_email_account
email_account.password = email_account.get_password()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 660, in get_password
return get_decrypted_password(self.doctype, self.name, fieldname, raise_exception=raise_exception)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/password.py”, line 19, in get_decrypted_password
frappe.throw(_(‘Password not found’), frappe.AuthenticationError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 310, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 303, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 276, in _raise_exception
raise raise_exception, encode(msg)
AuthenticationError: Password not found

which I assume means I need a password. A shame as I really want to use postfix as an SMTP send only server and this means I have to setup a full user/password authentication. I will try connecting to my external provider via ip address not domain name and let you know what happens.

I placed in the IP address for my external mail server using authentication and I get the grey saving logo of death again :frowning: So it’s some issue with authentication happening… and I can’t roll back using pip as I get failed with error code 1 as per below

Collecting cryptography==1.2.1
_ Downloading cryptography-1.2.1.tar.gz (372kB)_
Requirement already satisfied: idna>=2.0 in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: pyasn1>=0.1.8 in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: setuptools>=1.0 in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: enum34 in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: ipaddress in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: cffi>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from cryptography==1.2.1)
Requirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi>=1.4.1->cryptography==1.2.1)
Installing collected packages: cryptography
_ Found existing installation: cryptography 1.7.1_
_ Uninstalling cryptography-1.7.1:_
_ Successfully uninstalled cryptography-1.7.1_
_ Running setup.py install for cryptography: started_
_ Running setup.py install for cryptography: finished with status ‘error’_
_ Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=’/tmp/pip-build-BMKQky/cryptography/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-q5ECzl-record/install-record.txt --single-version-externally-managed --compile:_
_ running install_
_ running build_
_ running build_py_
_ creating build_
_ creating build/lib.linux-i686-2.7_
_ creating build/lib.linux-i686-2.7/cryptography_
_ copying src/cryptography/fernet.py -> build/lib.linux-i686-2.7/cryptography_
_ copying src/cryptography/about.py -> build/lib.linux-i686-2.7/cryptography_
_ copying src/cryptography/init.py -> build/lib.linux-i686-2.7/cryptography_
_ copying src/cryptography/exceptions.py -> build/lib.linux-i686-2.7/cryptography_
_ copying src/cryptography/utils.py -> build/lib.linux-i686-2.7/cryptography_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat_
_ copying src/cryptography/hazmat/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat_
_ creating build/lib.linux-i686-2.7/cryptography/x509_
_ copying src/cryptography/x509/name.py -> build/lib.linux-i686-2.7/cryptography/x509_
_ copying src/cryptography/x509/general_name.py -> build/lib.linux-i686-2.7/cryptography/x509_
_ copying src/cryptography/x509/base.py -> build/lib.linux-i686-2.7/cryptography/x509_
_ copying src/cryptography/x509/extensions.py -> build/lib.linux-i686-2.7/cryptography/x509_
_ copying src/cryptography/x509/init.py -> build/lib.linux-i686-2.7/cryptography/x509_
_ copying src/cryptography/x509/oid.py -> build/lib.linux-i686-2.7/cryptography/x509_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/backends_
_ copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends_
_ copying src/cryptography/hazmat/backends/multibackend.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends_
_ copying src/cryptography/hazmat/backends/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/bindings_
_ copying src/cryptography/hazmat/bindings/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/serialization.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/openssl_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/backends/commoncrypto_
_ copying src/cryptography/hazmat/backends/commoncrypto/backend.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/commoncrypto_
_ copying src/cryptography/hazmat/backends/commoncrypto/ciphers.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/commoncrypto_
_ copying src/cryptography/hazmat/backends/commoncrypto/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/commoncrypto_
_ copying src/cryptography/hazmat/backends/commoncrypto/hmac.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/commoncrypto_
_ copying src/cryptography/hazmat/backends/commoncrypto/hashes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/backends/commoncrypto_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl_
_ copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl_
_ copying src/cryptography/hazmat/bindings/openssl/conditional.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl
_ copying src/cryptography/hazmat/bindings/openssl/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/openssl_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/bindings/commoncrypto_
_ copying src/cryptography/hazmat/bindings/commoncrypto/binding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/commoncrypto_
_ copying src/cryptography/hazmat/bindings/commoncrypto/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/bindings/commoncrypto_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf_
_ copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf_
_ copying src/cryptography/hazmat/primitives/kdf/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf_
_ copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf_
_ copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf_
_ copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/kdf_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor_
_ copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor_
_ copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor_
_ copying src/cryptography/hazmat/primitives/twofactor/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor_
_ copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/twofactor_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers_
_ copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers_
_ copying src/cryptography/hazmat/primitives/ciphers/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers_
_ copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers_
_ copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/ciphers_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/interfaces_
_ copying src/cryptography/hazmat/primitives/interfaces/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/interfaces_
_ creating build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/init.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-i686-2.7/cryptography/hazmat/primitives/asymmetric_
_ running egg_info_
_ writing requirements to src/cryptography.egg-info/requires.txt_
_ writing src/cryptography.egg-info/PKG-INFO_
_ writing top-level names to src/cryptography.egg-info/top_level.txt_
_ writing dependency_links to src/cryptography.egg-info/dependency_links.txt_
_ writing entry points to src/cryptography.egg-info/entry_points.txt_
_ reading manifest file ‘src/cryptography.egg-info/SOURCES.txt’_
_ reading manifest template ‘MANIFEST.in’_
_ no previously-included directories found matching 'docs/build’
_ warning: no previously-included files matching ‘*’ found under directory ‘vectors’_
_ writing manifest file ‘src/cryptography.egg-info/SOURCES.txt’_
_ running build_ext_
_ generating cffi module 'build/temp.linux-i686-2.7/padding.c’
_ creating build/temp.linux-i686-2.7_
_ generating cffi module 'build/temp.linux-i686-2.7/constant_time.c’
_ generating cffi module 'build/temp.linux-i686-2.7/openssl.c’
_ building 'openssl’ extension
_ creating build/temp.linux-i686-2.7/build_
_ creating build/temp.linux-i686-2.7/build/temp.linux-i686-2.7_
_ i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-i686-2.7/openssl.c -o build/temp.linux-i686-2.7/build/temp.linux-i686-2.7/openssl.o
_ build/temp.linux-i686-2.7/openssl.c:737:6: error: conflicting types for ‘BIO_new_mem_buf’
_ BIO *BIO_new_mem_buf(void *, int);

_ ^_
_ In file included from /usr/include/openssl/asn1.h:65:0,_
_ from build/temp.linux-i686-2.7/openssl.c:445:
_ /usr/include/openssl/bio.h:692:6: note: previous declaration of ‘BIO_new_mem_buf’ was here_
_ BIO *BIO_new_mem_buf(const void *buf, int len);_
_ ^_
_ error: command ‘i686-linux-gnu-gcc’ failed with exit status 1_

----------------------------------------

Rolling back uninstall of cryptography

Has anyone got a fix? Or is there someway of forcing erpnext to connect to a mail server without username/password so that I can use my internal mail server.

Thanks

Try checking your postfix logs and see what it says there. It should flag whatever happened on the smtp attempted connection.

Usually all email servers are regarded as requiring a user and password as otherwise it would be an open reply if connected to the web.

Try different ports 465 or 993. Usually port 25 isn’t acceptable nowadays as it won’t be encrypted.

Or just setup a quick Gmail account or mandril to do some test emails with instead

No issues in postfix log. If I stopped the postfix server while I had the grey saving of death an error comes up about aborted connection so it is something to do with authentication (login). I have tried connecting to multiple mail servers now (yahoo, crazy domains, etc) and every time I get this terrible saving occurring with no error log Very frustrating. It looks like email is a no go which greatly effects the abilities of erpnext. I would have thought that by using the production image I would not have had any issues. I’m looking forward to version 8 as it’s my only option now…

Interesting I created an online account at erpnext.com and added a yahoo email account… volia same issue. Looks like someone has broken the email function.

Using Google Chrome I was able to get the following errors:

WebSocket connection to ‘ws://192.168.155.202/socket.io/?EIO=3&transport=websocket&sid=66fE-WrzmMrY8ZZaAAAC’ failed: Invalid frame header
WrappedWebSocket @ VM71:35
192.168.155.202/ Failed to load resource: the server responded with a status of 504 (Gateway Time-out)
VM238:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
_ at JSON.parse ()_
_ at Object. (desk.min.js:142)_
_ at i (jquery.min.js:2)_
_ at Object.fireWith [as rejectWith] (jquery.min.js:2)_
_ at z (jquery.min.js:4)_
_ at XMLHttpRequest. (jquery.min.js:4)_

So something is differently not working when the save button is clicked.