ansible-consul icon indicating copy to clipboard operation
ansible-consul copied to clipboard

Unable to find '/tmp/consul_raw.key' in expected paths

Open JakobStadlhuber opened this issue 4 years ago • 5 comments

The first run of the playbook is successful but every repeated run fails with the following error message:

Playbook

    - role: brianshumate.consul
      vars:
        consul_group_name: "consul_nodes"

Error:

task path: /root/.ansible/roles/brianshumate.consul/tasks/nix.yml:116
[WARNING]: Unable to find '/tmp/consul_raw.key' in expected paths (use -vvvvv to see paths)
File lookup using None as file
fatal: [chachingprod0]: FAILED! => {
    "censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"
}

Hack/Workaround: On line: 112 in file nix.yml remove the conditions:

      when:
        - not consul_local_key.changed
        - not bootstrap_state.stat.exists | bool

This hack will fix the issue but certainly cause unwanted side effects?!? Any idea what is causing the error in first place what actions should we take to solve this issue? Maybe we are missing some required configuration?

Versions: python-version: 2.7.16 ansible-version: 2.9.7 os-version: Debian 10 brianshumate.consul: v2.5.3

JakobStadlhuber avatar Apr 23 '20 16:04 JakobStadlhuber

I can confirm that I'm seeing this issue as well, thanks for the hack @JakobStadlhuber

bsodmike avatar Jan 09 '21 07:01 bsodmike

This is fixed on #407 Any timeline for the next release?

walbertus avatar Feb 04 '21 06:02 walbertus

Update : https://github.com/ansible-community/ansible-consul/issues/389#issuecomment-860003991

Can confirm this. Using master branch. Hosts run ubuntu. image

Was working fine few days ago !

I tried logging it and the below error appears:

The task includes an option with an undefined variable. The error was: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'encrypt

From what i understand, the Json is not being parsed properly...

blmhemu avatar Jun 11 '21 08:06 blmhemu

Update: It seems that my /etc/consul/config.json is messed up in previous run. Hence in the new run, it is not able to parse it correctly. So no +1 in this issue. Thanks !

blmhemu avatar Jun 12 '21 05:06 blmhemu

If you are using the new fixed version and still getting this error, you are probably running ansible for the second time on the same server, like me. At this stage, you need to delete all the paths in "defaults/main.yml" in order to overcome the problem.

After deleting all defined paths, I was able to bypass the error.

Like as; rm -rf /usr/local/bin/consul rm -rf /etc/consul* rm -rf /opt/consul rm -rf /run/consul

sedatsencan avatar Jan 24 '22 18:01 sedatsencan