ansible-keepass: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ansible-keepass-6d5c20be.sock'

Hey

Thanks for keeping this updated!

I have a little problem with the new update. I run Arch and downgraded python-pykeepass to version 4.0.1.

The issue I’m facing is:

KeePass: run socket for /home/dan/.ansible/ansible.kdbx
KeePass: try connect to socket 0/10
KeePass: try connect to socket 1/10
KeePass: send password to '/tmp/ansible-keepass-6d5c20be.sock'
Traceback (most recent call last):
  File "/home/dan/.ansible/plugins/lookup/keepass.py", line 364, in <module>
    _keepass_socket(args.kdbx, args.key, args.kdbx_sock, args.ttl)
  File "/home/dan/.ansible/plugins/lookup/keepass.py", line 203, in _keepass_socket
    s.bind(sock_path)
OSError: [Errno 98] Address already in use
KeePass: try connect to socket 1/10
KeePass: send password to '/tmp/ansible-keepass-6d5c20be.sock'
Traceback (most recent call last):
  File "/home/dan/.ansible/plugins/lookup/keepass.py", line 364, in <module>
    _keepass_socket(args.kdbx, args.key, args.kdbx_sock, args.ttl)
  File "/home/dan/.ansible/plugins/lookup/keepass.py", line 203, in _keepass_socket
    s.bind(sock_path)
OSError: [Errno 98] Address already in use
...
Traceback (most recent call last):
  File "/home/dan/.ansible/plugins/lookup/keepass.py", line 101, in run
    stat.S_ISSOCK(os.stat(socket_path).st_mode)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ansible-keepass-6d5c20be.sock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/ansible/template/__init__.py", line 962, in _lookup
    ran = instance.run(loop_terms, variables=self._available_variables, **kwargs)
  File "/home/dan/.ansible/plugins/lookup/keepass.py", line 144, in run
    raise AnsibleError("KeePass: socket connection failed for %s" % var_dbx)
ansible.errors.AnsibleError: KeePass: socket connection failed for /home/dan/.ansible/ansible.kdbx
...
KeePass: socket connection failed for /home/dan/.ansible/ansible.kdbx

This happend actually just for the first 3-4 targets (randomly) after that it works fine.

Is there anything else I can tweak?

Thanks again.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

The issue was fixed in v0.7.2