Error- Failed to get the data key required to decrypt the SOPS file.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
Hi Team,
I am running helm chart in a container and passing below configurations for .sops.yaml. Also, I am using age for encryption and decryption. Now when I am running below helm command in CICD pipeline then I am getting error but when I am running same command in my local linux box then it is working fine. Can someone please help me here to fix this issue.
Command:-
"KUBECONFIG=\$KUBECONFIG helm secrets upgrade --install ${SERVICE_NAME} xperi-helm-repository/${SERVICE_NAME} \
-f secrets/\${NAMESPACE}/${SERVICE_NAME}/secrets.yaml \
-f secrets/\${NAMESPACE}/ml-common/regcred2.yaml \
-f environments/\${NAMESPACE}/${SERVICE_NAME}/values.yaml \
--version="${HELM_CHART_VERSION}" --set image.tag="${DOCKER_TAG}" -n ${NAMESPACE} --debug --dry-run --wait --timeout 20m0s"
Error :-
18:05:04 load_plugins.go:111: [info] File (/tmp/.local/share/helm/plugins/helm-diff/completion.yaml) not provided by plugin. No plugin auto-completion possible.
18:05:04 Failed to get the data key required to decrypt the SOPS file.
18:05:04
18:05:04 Group 0: FAILED
18:05:04 age1wv2tmu3szxlrn5gxr7yxx3c39spn9q30acdys5t2wpxsqzmd0yjs67XXXX: FAILED
18:05:04 - | no age identity found in "/tmp/.config/sops/age/keys.txt"
18:05:04 | that could decrypt the data
18:05:04
18:05:04 Recovery failed because no master key was able to decrypt the file. In
18:05:04 order for SOPS to recover the file, at least one key has to be successful,
18:05:04 but none were.
18:05:04 [helm-secrets] Error while decrypting file: secrets/ml-datapipeline-dev/ml-search/secrets.yaml
18:05:04 Error: plugin "secrets" exited with error
18:05:04 helm.go:88: [debug] plugin "secrets" exited with error
creation_rules:
- path_regex: .*
encrypted_regex: ^(data|stringData)$
age: "age1wv2tmu3szxlrn5gxr7yxx3c39spn9q30acdys5t2wpxsqzmd0yjsfdghgsd"
Code structure:-
environment
|--> all_code_files
secrets
|--> environment
| -- > secrets.yaml
Jenkinsfile
|--> Jenkinsfile
Dockerfile
|--> Dockerfile
.sops.yaml
>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Jenkinsfile, Dockerfile, and .sops.yaml, then inspect the helm secrets command and the CI environment named in the report. Compare the age identity available in CI with the path shown in the error and verify decryption of secrets/ml-datapipeline-dev/ml-search/secrets.yaml. Done means the documented CI command can decrypt the SOPS file successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes
- Domain
- devops, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100