mattermost / mattermost-plugin-google-calendar

Mattermost Google Calendar Plugin
36 stars 35 forks source link

Regenerating the encryption key should delete plugin records from the key value store #61

Open emerikaji opened 11 months ago

emerikaji commented 11 months ago

Using the [regenerate] button on the encryption key should delete all records from the database since those will be unusable after regeneration.

We should add a disclaimer below the button specifying that all records will be deleted and consequently all users will be disconnected from their google account on the server.


Original issue description:

Using Mattermost 9.2.3 on Oracle Linux 9.1, the Google Calendar plugin keeps on crashing until Mattermost disables it; The error messages all contain "cipher: message authentication failed".

I've tried reinstalling the plugin multiple times, as well as recreating the OAuth tokens, and I've changed the encryption key, so is there anything I'm missing?

The full log for my latest attempt is in this Github gist, but here are the errors sent directly by gcal to the admin account:

(log WARN) Not able to load user 46fpc3eaabd4untu5zaupcnfhy from user index. err=cipher: message authentication failed
(log ERROR) Error renewing subscription. err=It looks like your Mattermost account is not connected to Google Calendar. Please connect your account using /gcal connect.: cipher: message authentication failed

Original issue title: Plugin not working because of cipher errors

fmartingr commented 11 months ago

Hey @emerikaji, from the information you provide one thing that comes to mind is that the encryption key from your plugin configuration was regenerated when there was already data present in the plugin key store database.

You can clean your plugin store by manually by going to the database pluginkeyvaluestore table and remove the data for pluginid == com.mattermost.gcal (or change pluginid to something else if you want to preserve the data).

mmospanenko commented 10 months ago

Thank you, it works for me, I think Regenerate button should delete all records from this table as well as removing action