sops icon indicating copy to clipboard operation
sops copied to clipboard

SOPS does not support ENV files that contain empty lines

Open akunaatrium opened this issue 5 years ago • 4 comments

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)

akunaatrium avatar Dec 02 '20 13:12 akunaatrium

Just faced this problem with SOPS v3.7.3 on Windows 10. With Mac everything works okay.

heikkilamarko avatar May 15 '22 19:05 heikkilamarko

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

heikkilamarko avatar May 15 '22 20:05 heikkilamarko

Same issue - Ubuntu 23.10 in March of 2024. Same fix.

JSv4 avatar Mar 07 '24 19:03 JSv4