bstopp/puppet-aem

aem_installer is failing after calling stop script for AEM process

Opened this issue · 0 comments

Hi @bstopp,

I'm encountering an issue where the method monitor_site is failing after calling the stop script.

Error message:

aws: Error: Could not set 'present' on ensure: Failed to open TCP connection to localhost:4502 (Address family not supported by protocol - socket(2) for "localhost" port 4502) (file: /tmp/packer-puppet-masterless/module-0/aem/manifests/instance.pp, line: 143)

aws: Error: Could not set 'present' on ensure: Failed to open TCP connection to localhost:4502 (Address family not supported by protocol - socket(2) for "localhost" port 4502) (file: /tmp/packer-puppet-masterless/module-0/aem/manifests/instance.pp, line: 143)

System Infos:
OS: RHEL 7
Ruby version: 2.4.0

After some debugging I found out that two approaches fixes the issue:

First approach:
Change localhost to 127.0.0.1

https://github.com/bstopp/puppet-aem/blob/master/lib/puppet/provider/aem_installer/default.rb#L130

Second approach:

Add Errno::EAFNOSUPPORT to the rescue call when trying to connect to AEM

https://github.com/bstopp/puppet-aem/blob/master/lib/puppet/provider/aem_installer/default.rb#L145

I can't really determine why it doesn't like localhost on my instance but extending the resuce method seems like the better solution. Hence why I'll raise a PR for this approach.

Cheers
Michael