Skip to content

Vault masking: runtime error: index out of range [0] with length 0

Problem

We recently made vault secrets maskable (!3750 (merged)).

Maskable secrets usually have a minimum length given by GitLab.

It appears that secrets from Vault though can be zero length. This scenario isn't being handled by our masker and results in a panic: runtime error: index out of range [0] with length 0.

Workaround

Ensure that no vault secrets are empty/zero length.

Solution

!3869 (merged)

Edited by Arran Walker