ansible.vault not working anymore?

Had a functional ansible-vault setup up until today.

With each run now I get the following:

ERROR! Unexpected Exception, this is probably a bug: from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object

This is a known bug and I have tried reinstalling the cryptography library through pip, but it did not solve the problem.

Anyone knows of other solutions or are there any fixes planned for this?

Without going into details - what changed on your system today?
Because logic dictates that ansible-vault (or any other tool, for that
matter) doesn't stop working if nothing changed.

Dick

Having just looked into this issue as it related to paramiko, the problem is with having an outdated version of python cryptography installed.

My current python cryptography version is 2.3 & I’ve also upgraded pip itself via pip to 18.0

Ansible version is 2.7.0

I have tried reinstalling python cryptography several times with no different results than the same error message.
The paramiko package also crossed my mind, so I updated that one as well. The issue still persists…

The only thing that changed today was a package update with apt-get update && upgrade (running Linux Mint)

Hmm, that sounds like a somewhat volatile environment.
In any case, if somethings "suddenly" stops working, I would suggest
to find out what exactly changed that caused it to stop working.
Carpet-upgrading involved libraries might fix the issue, but it's not
going to make fault finding easier.
What about reverting the package that came in through apt-get
(interested to know which one)?

Dick

I think the upgrade brought in at least 25 updated packages, so it might be a bit messy to revert each & every one :confused:

But I’ll have a go at it and see what I can find from there.

The current stable ansible version is 2.6.2 according to the github release page https://github.com/ansible/ansible/releases

How did you get Ansible version 2.7.0? is the from the devel branch?

I would say a faster way is probably to setup a python virtualenv and see if you can reproduce the issue in the new clean virtual env.
You can find instructions how to setup a python virutal env at https://docs.python-guide.org/dev/virtualenvs/

Tried the python virtualenv and downgrading/upgrading all the possible packages with no success.

But I finally resolved the issue after mingling with the system packages…

I’m running python 2.7.12 and the issue for me was, that the libs python3-crypto & python3-cffi-backend were installed through the system package manager.

Uninstalling those immediately solved the problem :slight_smile: