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

Unhelpful error message on invalid file #416

Open
FiloSottile opened this issue May 9, 2022 Discussed in #415 · 1 comment
Open

Unhelpful error message on invalid file #416

FiloSottile opened this issue May 9, 2022 Discussed in #415 · 1 comment

Comments

@FiloSottile
Copy link
Owner

Discussed in #415

Originally posted by shepting May 5, 2022
I was recently using age in an automated fashion for some CI machines and received the following message:

age: error: failed to read header: parsing age header: failed to read intro: EOF

Unfortunately, since the error message didn't specify either:

  1. the filename of the invalid file or
  2. the first line of the file it was parsing
    I spent 30 minutes investigating what was wrong with my private key on my machine without realizing it was the "encrypted" file that was failing to parse!

My command was something like cat ~/setup/id_rsa.encrypted | age --decrypt --identity ~/.age/ci.key --output ~/.ssh/id_rsa so specifying that it was STDIN that was failing could help. Even moreso if it gave the first line of STDIN that didn't look right.

@covert-encryption
Copy link

Would make sense to give different messages for errors reading identity files and data files, e.g. prepending text on the error messages depending on which context it comes from, while keeping the original message for detailed information on what went wrong.

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

No branches or pull requests

2 participants