Skip to content

Instantly share code, notes, and snippets.

@paoliniluis
paoliniluis / Recover.md
Last active August 1, 2023 23:02
How to recover from a "Cannot decrypt encrypted String. Have you changed or forgot to set MB_ENCRYPTION_SECRET_KEY?" issue

What's this?

This is an error that happened between 44 and more recent versions where the secret key that Metabase uses to decrypt the previously encrypted values fails.

Why does it happen?

We still can't replicate the conditions unfortunately.

How to recover?

First, you need to know what Metabase encrypts on the DB:

  • settings table, only the values column
  • metabase_database table, only the details column
CREATE TABLE IF NOT EXISTS public.activity_history (
id integer,
topic character varying(32) not null,
timestamp timestamp with time zone not null,
user_id integer,
model character varying(16),
model_id integer,
database_id integer,
table_id integer,
custom_id character varying(48),
###################
# STAGE 1: builder
###################
FROM --platform=linux/amd64 eclipse-temurin:11.0.12_7-jdk-focal as builder
ARG MB_EDITION=oss CI=true
WORKDIR /app/