Encryption key is invalid, Please check site_config.json


I have seen this topic has been pointed several time. The server gives error “Encryption key is invalid, Please check site_config.json”

Now I know there encryption key which is mentioned in site_config.json but in my case my site_config.json was deleted somehow and I am not having backup, so what should i do now, from where I can regenerate or get the old encryption key ?

Please note: I am using let’s encrypt https certificate.



I found the solution.

You have to overwrite the certificate using sudo bench setup lets-encrypt “site name” without quotes.

It will ask you for the overwriting the certificate or keep existing, say overwrite and it will create a new site_config.json with encryption key.

It will not generate the database and password parameters so you have to reset the password of database and create the entries manually in site_config.json.

Then reconfigure your email accounts in erpnext setup.

You are done.


1 Like