shinesolutions/packer-aem

Puppet-Agent 5.5.21 breakes baking process when configuring AEM

Closed this issue · 5 comments

Describe the bug
The new puppet agent version 5.5.21 released on the 14th of july(https://puppet.com/docs/puppet/5.5/release_notes.html#puppet-5521) is breaking the baking process when configuring AEM via swagger-aem.

To Reproduce

  1. trigger a regular baking process.
  2. Baking fails with following error message:
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Install_aem_profile[author: Install AEM profile aem65_sp1]/Aem_curator::Install_aem65_sp1[author: Install AEM profile aem65_sp1]/Aem_curator::Install_aem_package[author: Install service pack 1]/Exec[author: Wait post login page for aem-service-pkg]/returns: executed successfully
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Archive[/tmp/shinesolutions/packer-aem/author/aem.key]/ensure: download archive from file:///tmp/shinesolutions/packer-aem/certs/aem.key to /tmp/shinesolutions/packer-aem/author/aem.key  with cleanup
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Archive[/tmp/shinesolutions/packer-aem/author/aem.cert]/ensure: download archive from file:///tmp/shinesolutions/packer-aem/certs/aem.cert to /tmp/shinesolutions/packer-aem/author/aem.cert  with cleanup
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Wrapped exception:
invalid memory read at address=0x0000000000000000
Error: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_resources::Create_system_users[author: Create system users]/Aem_user[[author] Create user - orchestrator]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Wrapped exception:
invalid memory read at address=0x0000000000000000
Error: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_resources::Create_system_users[author: Create system users]/Aem_user[[author] Create user - replicator]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Wrapped exception:
invalid memory read at address=0x0000000000000000
Error: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_resources::Create_system_users[author: Create system users]/Aem_user[[author] Create user - deployer]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Wrapped exception:
invalid memory read at address=0x0000000000000000
Error: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_resources::Create_system_users[author: Create system users]/Aem_user[[author] Create user - exporter]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Error: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Wrapped exception:
invalid memory read at address=0x0000000000000000
Error: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_resources::Create_system_users[author: Create system users]/Aem_user[[author] Create user - importer]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: invalid memory read at address=0x0000000000000000 (file: /tmp/shinesolutions/packer-aem/modules/aem_resources/manifests/create_system_users.pp, line: 31)
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_node[author: Create AEM Password Reset Activator config node]: Dependency Aem_user[[author] Create user - orchestrator] has failures: true
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_node[author: Create AEM Password Reset Activator config node]: Dependency Aem_user[[author] Create user - replicator] has failures: true
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_node[author: Create AEM Password Reset Activator config node]: Dependency Aem_user[[author] Create user - deployer] has failures: true
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_node[author: Create AEM Password Reset Activator config node]: Dependency Aem_user[[author] Create user - exporter] has failures: true
Notice: /Stage[main]/Aem_curator::Install_author/Aem_curator::Install_aem[author: Install AEM Author]/Aem_curator::Config_aem[author: Configure AEM]/Aem_node[author: Create AEM Password Reset Activator config node]: Dependency Aem_user[[author] Create user - importer] has failures: true
  1. uninstall puppet-agent 5.5.21
yum remove -y puppet-agent
  1. Install puppet-agent 5.5.20
yum -y install https://yum.puppetlabs.com/puppet5/el/7/x86_64/puppet-agent-5.5.20-1.el7.x86_64.rpm
  1. Trigger baking manually again and it is sucessfully

Expected behavior
Baking should pass

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information if relevant):

  • puppet-agent 5.5.21
  • OS rhel7 & AL2

Additional context
.

I'm currently trying to reproduce it on the CLI and I can see that the execution of the ruby_aem resource user fails even if I try it manually

[root@ip-10-0-15-190 packer-aem]# /opt/puppetlabs/puppet/bin/irb 
irb(main):001:0> 
irb(main):001:0> require 'ruby_aem'
irb(main):001:0> client = RubyAem::Aem.new
irb(main):001:0> user = client.user('/home/users/r','replicator')
irb(main):001:0> user.exists.data
irb(main):001:0> user.delete
FFI::NullPointerError: invalid memory read at address=0x0000000000000000
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ffi-1.13.1/lib/ffi/pointer.rb:62:in `get_string'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ffi-1.13.1/lib/ffi/pointer.rb:62:in `read_string'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy.rb:287:in `escape'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/queryable.rb:35:in `block (2 levels) in to_s'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/queryable.rb:35:in `map'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/queryable.rb:35:in `block in to_s'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/queryable.rb:31:in `map'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/queryable.rb:31:in `to_s'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/http/actionable.rb:124:in `set_params'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/http/actionable.rb:106:in `setup'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/http/post.rb:16:in `setup'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ethon-0.12.0/lib/ethon/easy/http.rb:39:in `http_request'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus/easy_factory.rb:95:in `get'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus/request/operations.rb:17:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus/request/cacheable.rb:18:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus/request/block_connection.rb:34:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb:25:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/typhoeus-1.4.0/lib/typhoeus/request/before.rb:27:in `run'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/swagger_aem-3.3.0/lib/swagger_aem/api_client.rb:50:in `call_api'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/swagger_aem-3.3.0/lib/swagger_aem/api/sling_api.rb:1894:in `post_node_with_http_info'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ruby_aem-3.8.0/lib/ruby_aem/client.rb:74:in `call'
	from /opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ruby_aem-3.8.0/lib/ruby_aem/resources/user.rb:50:in `delete'
	from (irb):5
	from /opt/puppetlabs/puppet/bin/irb:11:in `<main>'

This is working fine if Puppet-agent 5.5.20 is installed but fails if puppet-agent 5.5.21 is installed.

Error still exists, tried to regenerate swagger-aem with different versions of openapitools/openapi-generator-cli but it didn't solve the problem, yet.

Issue is also described here typhoeus/ethon#169

It seems like it has something to do that we are passing an empty value for the parameter delete_authorizable in ruby_aem
https://github.com/shinesolutions/ruby_aem/blob/master/conf/spec.yaml#L450

The reason of this error is described in shinesolutions/ruby_aem#38, which is that we are passing empty values to swagger-aem.

Fix included in master and will be released with the next release version.