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 unmarshalling input json: invalid character 'ÿ' looking for beginning of value age Windows #1186

Open
elvarondelacerveza opened this issue Mar 10, 2023 · 3 comments

Comments

@elvarondelacerveza
Copy link

After i try to run sops with binary windows with following
command
sops\sops-v3.7.3.exe --decrypt --age agekey path/file.json i am getting

Error unmarshalling input json: invalid character 'ÿ' looking for beginning of value age

Testing in Mac and this is working but for windows binary is not .

@ghost
Copy link

ghost commented Mar 14, 2023

Hi! I had the same problem with PowerShell. I just switched to CMD (Command prompt) and everything is fine now.

@hurzelpurzel
Copy link

This is caused by File Encoding a BOM add the start of the file.
This might happens if you use the ">" to redirect stdout to a file in powershell.
To solve this I used "| Out-File -Encoding ascii -FilePath " instead that solved the problem for me.
In additon it might be a good idea to avoid this on age-keygen as well. This could be done be using -o on age-keygen.

sops do have an --output option as well, but I didn't get it to work. Maybe you can give it atry as well.

@felixfontein
Copy link
Contributor

@hurzelpurzel

sops do have an --output option as well, but I didn't get it to work. Maybe you can give it atry as well.

Please note that sops's command line parser requires all parameters to come before positional arguments. So sops\sops-v3.7.3.exe --decrypt --age agekey path/file.json --output path/file.out won't work (it will think that --output and path/file.out are two more positional arguments), but sops\sops-v3.7.3.exe --decrypt --age agekey --output path/file.out path/file.json will work.

Maybe that's the problem you're experiencing? The latest SOPS version warns about this situation BTW.

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

3 participants