getsops / sops

Simple and flexible tool for managing secrets
https://getsops.io/
Mozilla Public License 2.0
16.97k stars 878 forks source link

Decrypting dotenv gives parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006" #1128

Open tomcoppensucll opened 2 years ago

tomcoppensucll commented 2 years ago

On windows 10 with version 3.7.3 and using age:

When I encrypt the .env file: PORT=test

with the command sops --encrypt --age xxxxx ./config/dev/secrets.env > ./config/dev/secrets.enc.env

it gives the following result PORT=ENC[AES256_GCM,data:AxlvkA==,iv:cwHo+jRhK2Qu88UnRz6ThHmdvMIEFKZQT3SMhS4qhHM=,tag:vk6wW1zQC7foeb3Valt2Qw==,type:str] sops_version=3.7.3 sops_age__list_0__map_recipient=age16ma5vqf88ycmlmkr5y4dvd7a4q9y9fuxc6u8u2ltprr2l0v7ff3sktlyjr sops_lastmodified=2022-09-21T21:03:17Z sops_unencrypted_suffix=_unencrypted sops_age__list_0__map_enc=-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNcDF0ZTVRckNwS1B6YjBP\nWkl4bFRUY0kxb1hEd1VpL3VGd0kvQ09kYkZJCjJyVzl3cGhIMzFHeURrZDlGVmYy\nWEVCS1lGTVdZRWd0cUl6dFZzdTlhTU0KLS0tIHdpSXJFY0VxQnB0cGFrcWhjUzRC\nRnZXRGVsVWEyMjhTUDdTVmxGa2VaencKVNROzvT4Pfu1KTGkW0JbCa3WZppFKt8D\nOs5kkhWWZ+AOF5sRnKGiQ6EKAGKCPx+qFMbqRCQODnoFI70lTczPgg==\n-----END AGE ENCRYPTED FILE-----\n sops_mac=ENC[AES256_GCM,data:sgBnRnbhc1mqqzwPgX+nB4X5du40R7BNHNm1ixv3CoX3WGPd9FoWDEwK5Ym/spNoQErIV4dn1rOYXMKxxkKeq3kh/Y6ttsO5F2wnXHX3oLJb/ZWCL2iBeyVt8tUZjqu9XkRWoBYK5DeUqtudePLgvTRs52yDruybnmtpfvg6rj4=,iv:/Vp0mMspsLSwwLvfDsZOZB8r3XxrI9BF8azHS+DO8Dw=,tag:nH0tKJH/x1Ple6p2n8e61w==,type:str]

And when I try to decrypt again with the command sops --d ./config/dev/secrets.enc.env > ./test.env

It throws the error parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"

Anything I'm missing? Decrypting yaml files works as expected

Wurstnase commented 11 months ago

I saw this exception, when I accidentally tried to decrypt an unencrypted file.

Did you use --d or -d?

MightyMoud commented 1 month ago

Has anybody found a solution for this issue?