Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Bug Report: Ansible-vault errors with "Odd-length string" #9963
Steps To Reproduce:
It doesn't matter if I enter a correct password or not or simply press enter, it always errors out.
Alright, @bcoca it does look like line ending issue, and more specifically seems to be caused by SourceTree's version of git.
And it generates that
However, if I check it out using plain Cygwin git(.exe), I get
This file works fine.
It would be nice if
I'm closing this issue because encryption in general is (on purpose) very finicky about changes in the data and should complain about them. Also we do not support windows as an ansible master (not even with cygwin), only recently as a target with the win_* modules.
I'm glad you found the source of your problems and this ticket will probably help others in the future but I'm very reticent to change vault to play with line endings as this can create more problems than it solves.
I can understand if it complains about mangled data, but failing on line breaks is a bit extreme on the "fail fast, fail early" mindset.
I agree with @mxxcon that it should at least detect whether CR/LF is happening on the file and fail with a descriptive error message. I get that cygwin isn't a supported platform, but at least pointing people in the right direction would be a good thing.
Also, what about this scenario: a developer on Windows is checking in code, and a dev ops guy is checking the code out on a Linux box to run Ansible playbooks to deploy said code. What happens if the developer is using an IDE that auto-changes every file it touches to Windows-style text and then commits it? Again, full support for CR/LF would be great, but almost as good would be an error message so the dev ops guy would know what the error is and can both manually fix it and scold the developer for using a crap IDE and poor Git settings.