getsops / getsops/sops

Error dumping file: cannot use complex value in dotenv file

Open
#1,154 0 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

Thanks for sops, it's all I've wanted to handle secrets, dope software !

I have written a secrets.yaml with the structure:

nix:
    signingKey: toto
    s3Password: tata

trying to use sops exec-env secrets-dev.yaml 'ci/deploy-component.sh dev deploy-hybrid-dev-aws'
Error dumping file: cannot use complex value in dotenv file: [...] {{ sops-nix doesn't let us use a structured version so we dump the whole file} <nil>} {

My problem is different from https://github.com/mozilla/sops/issues/1110 as all the leaves of the yaml (eg. what I want to import in the env are strings, and I am just interested in the "leaves"). I would just need sops to generate a name based on the tree to access my leaves. e.g, I would be totally fine with nix_signingKey in the environment generated by exec-env (or nixSigningKey, the naming scheme just has to be consistent).

For now, I've rewrittin my secrets.yaml so that it's just a list of strings , eg.:

nixSigningKey: toto
nixS3Password: tata

it works but I find it less elegant so I hope we can find a satsifying solution to keep my first version of secrets.yaml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the sops exec-env entry point and trace the dotenv dumping path that reports complex values. Check how nested YAML values and environment names are handled; done means leaf string values from nested structures produce consistent variable names without breaking flat dotenv input.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.