Issue with encryption key

Hello,

I tried to update retool from 1.100
My retool is hosted on kubernetes trough the official helm chart and the DB was the subchart but I moved it to a separated postgresql.
I upgraded postgresql to the latest version and re-imported the schema as is.
Then took the new version of the chart and reinstalled/adapted the values file.
But when I deploy retool, he cant decrypt my resources passwords.
The encryption key is still the same though. I still have the passwords for my resources but I would like to know how to fix them, for now, I only have a 500 on get resources and retool cannot find them.
Do you have a way to reencrypt passwords and inject them in the DB.
Or any other way to fix the problem ?

Thanks for your help,

The error on the 500 is :

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt

Hey @krumka! Happy to help with this.

These are typically the quickest recovery steps:

  1. Set and store your new Encryption Key value
  2. Take a backup of your existing database (always best practice)
  3. Directly access the Retool storage database and clear the existing encrypted values from the resources table. All of the encrypted values will be stored with the prefix __RETOOL_ENCRYPTED__.For the most part, this can be accomplished by a UPDATE resources SET "databasePassword" = NULL. However, some REST resources will have encrypted values nested inside their options fields.
  4. Once all the encrypted values have been removed, you can then access the Resources page, and update the resources by filling in the database passwords or other missing fields. This will encrypt them with your new key.

Let me know how this works for you :crossed_fingers:

1 Like

Ok perfect, thank you for your help !
I already removed everything and readded manually all my resources because I couldnt let my customers without their app but I keep your advices for further issues.

Have a good day !

Of course! Wonderful. Wishing a good day to you as well :wave: :sparkles: