Error while connecting to email account Notifications

Good day all

Trust you are having a great weekend

I have just completed an exercise of migrating my V12 server to V13. My end-goal is to
migrate 4 servers on a multi-tenant system but for now I am checking my procedures on
a single domain server.

The thread that I posted is -

The procedure involved the following -

Existing server : V12.29

  1. make backups on V12 server : sql-database + csv exports
  2. Create fresh V13 server
  3. Copy database.sql.gz file to new server with winscp
  4. Unzip gz file to yield sql-file
  5. Do restore
  6. do migration
  7. No errors reported

( detail of commands in thread listed above)

Logged in to server. No problems. All data seem to be there. Can create new data e.g. item.

At some stage I saw a pop-up about unread error messages and when I looked in the
error log list I saw 62 errors of the same kind-

Error while connecting to email account Notifications

Trace-back further down in this post.

I did see a post before I did the database transfer and hence I made a backup of the
site_config.json file. The post that I saw is -

My observaions-

Fresh V13 site_config.json file did not have an encryption key.
Unfortunately I did not check the state of the json file directly of the migration.
I deleted the “notifications” email and its domain and recreated them.
The json file on the new V13 server now has an encryption key.
No more errors.

My question;
I read suggestions about transfering the encryption key. Do I still need to do that since the
error does not occur anyore ? Is this key only used for emails? It seems to have been
created when I re-created the email account and domain. It sees as if the problem
is solved … or am I missing something?

If someone can clarify this I would really appreciate it. After “practicing” my procedure on
a single domain system I need to push on and migrate my multi-tenant system.

Thank you all for reading such a long post !

Trace back

Traceback (most recent call last):
File “env/lib/python3.8/site-packages/cryptography/”, line 119, in _verify_signature
File “env/lib/python3.8/site-packages/cryptography/hazmat/primitives/”, line 74, in verify
File “env/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/”, line 75, in verify
raise InvalidSignature(“Signature did not match digest.”)
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/”, line 212, in decrypt
plain_text = cstr(cipher_suite.decrypt(encode(pwd)))
File “env/lib/python3.8/site-packages/cryptography/”, line 80, in decrypt
return self._decrypt_data(data, timestamp, time_info)
File “env/lib/python3.8/site-packages/cryptography/”, line 137, in _decrypt_data
File “env/lib/python3.8/site-packages/cryptography/”, line 121, in _verify_signature
raise InvalidToken

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/email/doctype/email_account/”, line 308, in receive
email_server = self.get_incoming_server(in_receive=True, email_sync_rule=email_sync_rule)
File “apps/frappe/frappe/email/doctype/email_account/”, line 188, in get_incoming_server
args.password = self.get_password()
File “apps/frappe/frappe/model/”, line 859, in get_password
return get_decrypted_password(self.doctype,, fieldname, raise_exception=raise_exception)
File “apps/frappe/frappe/utils/”, line 59, in get_decrypted_password
return decrypt(result[0][0])
File “apps/frappe/frappe/utils/”, line 216, in decrypt
frappe.throw(_(‘Encryption key is invalid, Please check site_config.json’))
File “apps/frappe/frappe/”, line 444, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “apps/frappe/frappe/”, line 423, in msgprint
File “apps/frappe/frappe/”, line 378, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Encryption key is invalid, Please check site_config.json

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.