Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"error loading config: no matching creation rules found" when decrypting from stdin #884

Closed
adrian-gierakowski opened this issue Jun 4, 2021 · 6 comments

Comments

@adrian-gierakowski
Copy link

running following command in a directory containing .sops.yaml:

cat $PATH_OF_SOME_ENCRYPTED_FILE | sops --input-type json -d /dev/stdin

results in following error:

error loading config: no matching creation rules found

This is clearly a bug since creation rules should not be required for decryption.

NOTE: a workaround has been suggested here, however adding a catch-all rule without a key leads to a change of behaviour during encryption: when running sops some_new_file_not_matching_any_proper_rule instead of instant error loading config: no matching creation rules found, the editor opens and the error only happens when closing/saving the file ([CMD] ERRO[0004] No master keys were provided, so sops can't encrypt the file. Press a key to return to the editor, or Ctrl+C to exit. )

this, together with #594 could be tackled at the same time in order to improve user experience when working with stdin

@adrian-gierakowski
Copy link
Author

looks like the same error happens when trying to decrypt any file which path does not match any creation rules in a .sops.yaml file

another workaround I just found is to pass an empty file using the --config options:

sops --config <(echo '') -d $PATH_TO_ENCRYPTED_FILE

@bennythejudge
Copy link

bennythejudge commented Jan 25, 2022

FWIW I was having this issue and actually the solution under #884 (comment) did work for me but more importantly I found I had a .sops.yaml in my home directory which was causing the error. Once I moved the .sops.yaml and its (bugged) content, sops -d worked fine.

@adrian-gierakowski
Copy link
Author

would a PR be welcome?

@WolfangAukang
Copy link

looks like the same error happens when trying to decrypt any file which path does not match any creation rules in a .sops.yaml file

another workaround I just found is to pass an empty file using the --config options:

sops --config <(echo '') -d $PATH_TO_ENCRYPTED_FILE

Just wanted to confirm this also worked for me. The difference is that I didn't have a .sops.yaml file on my home directory, as @bennythejudge specified, so not sure of what is going on. The --verbose flag doesn't tell anything.

@archite
Copy link

archite commented Jan 22, 2023

Thanks @adrian-gierakowski, I ended up with the following config entry and all works well:

[diff "sopsdiffer"]
    textconv = "sops --config /dev/null -d"

@felixfontein
Copy link
Contributor

Fixed in #1434.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants