The main reason for this error is related to user permissions. Frappe is unable to access required files such as CSS, JS, Python files, etc.
Additionally, if you’ve recently restored a site, make sure to update the encryption_key
in the config file (sites/site_config.json
) using the key from your backup.
How to Fix the Permission Issue:
Run the following commands carefully:
bash
cd /home/{your_frappe_bench_folder}
sudo chmod o+x /home/{your_frappe_bench_folder}
sudo usermod -aG sudo {your_user}
sudo supervisorctl reload
bench restart
bench --site {your-site-name} clear-cache
bench --site {your-site-name} migrate
Example:
bash
cd /home/frappe-bench
sudo chmod o+x /home/frappe-bench
sudo usermod -aG sudo frappe-user
sudo supervisorctl reload
bench restart
bench --site my-site.domain.com clear-cache
bench --site my-site.domain.com migrate
These steps ensure that the necessary user has proper access to the bench folder and can execute the required files.
Hope this will help !!!
…
…
…
ERROR LOG
Traceback (most recent call last):
File “env/lib/python3.12/site-packages/cryptography/fernet.py”, line 130, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “apps/frappe/frappe/utils/password.py”, line 194, in decrypt
return cstr(cipher_suite.decrypt(encode(txt)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “env/lib/python3.12/site-packages/cryptography/fernet.py”, line 89, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “env/lib/python3.12/site-packages/cryptography/fernet.py”, line 148, in _decrypt_data
self._verify_signature(data)
File “env/lib/python3.12/site-packages/cryptography/fernet.py”, line 132, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken