Skip to content

Stop/Start supabase locally results in Vault secrets with invalid ciphertext #1204

@bombillazo

Description

@bombillazo

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Start supabase locally
  2. Create a secret in the vault.secrets schema and table. Can be via GUI or the create_secret function (don't pass any key)
  3. Query the secrets view to check the decryption works
  4. Run supabase stop
  5. Run supabase start
  6. Query a secret or open the decrypted secrets view
  7. An error will appear regarding an invalid ciphertext

Expected behavior

Starting the supabase stack again does not invalidate the encrypted secrets data or keys.

Screenshots

Error synchronizing data with database

Reason:
SQL Error [22000]: ERROR: pgsodium_crypto_aead_det_decrypt_by_id: invalid ciphertext
  Where: PL/pgSQL function pgsodium.crypto_aead_det_decrypt(bytea,bytea,uuid,bytea) line 12 at RETURN

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions