getsops / getsops/sops

Error encrypting tree: Error walking tree: Tree contains a non-string key (type <nil>): %!s(<nil>). Only string keys aresupported

Open
#674 1 comment 0 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

cat redis-vs-patch.yaml

- op: replace
  path: /spec/http/0/match/0/headers/auth
  value:
    exact: my_key_to_be_encrypted
✗  cat redis-vs-patch.yaml | yq r - .value.exact
my_key_to_be_encrypted

✗  sops --encrypt --encrypted-regex 'exact' redis-vs-patch.yaml > redis-vs-patch.enc.yaml
Error encrypting tree: Error walking tree: Tree contains a non-string key (type <nil>): %!s(<nil>). Only string keys aresupported

Not sure what it's upset about. This is a Kustomize patch, and yq is happy with the format.

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 by reproducing the command against redis-vs-patch.yaml and compare SOPS's tree-walking behavior with yq's interpretation of the Kustomize patch. Trace the encryption path that reports the nil key and determine what successful handling of the exact value should look like; the issue is done when this input encrypts without the non-string-key error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Bug
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.