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

./batou secrets summary fails when one cannot decrypt a secret file #165

Closed
frlan opened this issue May 20, 2021 · 0 comments · Fixed by #197
Closed

./batou secrets summary fails when one cannot decrypt a secret file #165

frlan opened this issue May 20, 2021 · 0 comments · Fixed by #197
Assignees
Labels
bug Something isn't working gocept
Projects
Milestone

Comments

@frlan
Copy link
Member

frlan commented May 20, 2021

Traceback (most recent call last):
  File "/mybatou/.batou/f1e41f9f/bin/batou", line 33, in <module>
    sys.exit(load_entry_point('batou==2.2.4', 'console_scripts', 'batou')())
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/main.py", line 149, in main
    args.func(**func_args)
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/manage.py", line 109, in summary
    for e in Environment.all():
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/manage.py", line 30, in all
    yield Environment(path=e)
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/manage.py", line 19, in __init__
    self.f = EncryptedConfigFile(
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/encryption.py", line 137, in __init__
    self.main_file = self.add_file(encrypted_file)
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/encryption.py", line 148, in add_file
    f.read()
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/encryption.py", line 70, in read
    self.cleartext = self._decrypt()
  File "/mybatou/.batou/f1e41f9f/lib/python3.9/site-packages/batou/secrets/encryption.py", line 96, in _decrypt
    return subprocess.check_output(args, stderr=NULL).decode("utf-8")
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['gpg', '-q', '--no-tty', '--batch', '--decrypt', 'secrets/vagrant.cfg']' returned non-zero exit status 2.

On CLI I'd use something like

gpg --pinentry-mode cancel --list-packets secrets/vagrant.cfg

@ctheune ctheune changed the title ./batou secrets summary failes when one cannot decrypt a secret file ./batou secrets summary fails when one cannot decrypt a secret file May 21, 2021
@ctheune ctheune added the bug Something isn't working label May 21, 2021
@ctheune ctheune added this to the batou 2.3 milestone May 21, 2021
@ctheune ctheune added the gocept label May 26, 2021
@ctheune ctheune added this to To do in batou May 31, 2021
@icemac icemac self-assigned this Jul 9, 2021
batou automation moved this from To do to Done Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gocept
Projects
No open projects
batou
Done
Development

Successfully merging a pull request may close this issue.

3 participants