I have the same problem with one of my two instances of ERPNext. They both have the exact same setup (Ubuntu 18.04, latest ERPNext v12 and Frappe v12, …), the only difference is that the instance that is having the problem uses a self-signed ssl certificate and is accessed via https, while the other isn’t.
So I think the culprit here is SSL.
A solution to this problem was suggested her, however it didn’t work for me:
I already did this and my browser also shows erpnext as secure connection.
However, I didn’t create a certificate authority to sign the certificates and bench shows a warning that ssl stapling will be ignored since there is no authority mentioned in the certificate, so maybe that’s the problem.
This is what OpenSSL shows when connecting to the site:
CONNECTED(00000005)
depth=0 C = DE, L = example-city, O = example-company, CN = site1.local
verify error:num=18:self signed certificate
verify return:1
depth=0 C = DE, L = example-city, O = example-company, CN = site1.local
verify return:1
---
Certificate chain
0 s:C = DE, L = example-city, O = example-company, CN = site1.local
i:C = DE, L = example-city, O = example-company, CN = site1.local
---
Server certificate
-----BEGIN CERTIFICATE-----
xyz
-----END CERTIFICATE-----
subject=C = DE, L = example-city, O = example-company, CN = site1.local
issuer=C = DE, L = example-city, O = example-company, CN = site1.local
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, P-384, 384 bits
---
SSL handshake has read 1631 bytes and written 801 bytes
Verification error: self signed certificate
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 18 (self signed certificate)
---
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: xyz.....
Session-ID-ctx:
Resumption PSK: xyz.....
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000...
0010...
Start Time: 1590481036
Timeout : 7200 (sec)
Verify return code: 18 (self signed certificate)
Extended master secret: no
Max Early Data: 0
---
read R BLOCK
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: xyz....
Session-ID-ctx:
Resumption PSK: xyz.....
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000...
0010...
Start Time: 1590481036
Timeout : 7200 (sec)
Verify return code: 18 (self signed certificate)
Extended master secret: no
Max Early Data: 0
---
read R BLOCK
closed
This issue is with the this command:
sudo -H bench setup lets-encrypt [site-name]
If alters the nginx config in the wrong manner and breaks the socket io connectivity.
I have reported this issue.
To fix this issue there is a work around.
Goto site_config.json remove the ssl certifactes
Convert the site back to DNS based multitenancy
Re generate nginx config bench setup nginx
Install certbot
setup ssl with certbot --nginx
Allow certbot to make changes to redirect http to https
Here’s what worked for me. Node JS v8 is what gets installed with easy install script. I just upgraded to v12 (latest stable) and the SSL error went away.
in my “/frappe-bench/logs/node-socketio.log” file.
Turns out this exact error is thrown due to a bug in node v8.
So, I started looking around for what my node version is with “node -v”. It showed the version as v14. But, I was still getting this error.
Here is my solution and what I found:
It turns out that my “frappe-bench/config/supervisor.conf” file was using “/usr/bin/node” to start the “-node-socketio” process. But, Since I had nvm installed to manage my node versions, the node version used in the terminal was installed locally and “/usr/bin/node” was left at v8.