sops
sops copied to clipboard
SOPS does not support ENV files that contain empty lines
On Windows 10, trying to encrypt a .env file that contains empty lines results in the following error message:
Error unmarshalling file: invalid dotenv input line:
Output of sops --version:
sops 3.6.1 (latest)
Just faced this problem with SOPS v3.7.3 on Windows 10. With Mac everything works okay.
Found the reason. The problem appears only if you have CRLF as the end of line sequence. Adding the following to .gitattributes fixed the problem:
*.env text eol=lf
Same issue - Ubuntu 23.10 in March of 2024. Same fix.