0

I'm struggling with installation of packages available in form of locally downloaded rpm file - just on Oracle Linux (OEL). Is there a bug? Has anyone observed this? It would be a huge bug, so I'm bit surprised.

Chef recipe is quite simple:

pkg_src_location = 'https://s3.amazonaws.com/solution-automation-folder/qualys'
pkg = 'qualys-cloud-agent.x86_64.rpm'
local_image = "#{Chef::Config['file_cache_path']}/#{pkg}"

remote_file 'qualys-cloud-agent-image' do
  path local_image
  source "#{pkg_src_location}/#{pkg}"
end

package 'qualys-cloud-agent' do
  source local_image
end

It's available from https://github.com/r2oro/oel_pkg_test.git.

I have observed that on Oracle Linux (OEL) it results with following python script being triggered:

/usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30

It runs for quite a while (downloading several hundreds of megabytes of data - as far I can see - yum repo metadata) and eventually fails (kitchen in debug mode dumps all this to stdout...). Anyway the result is:

     * yum_package[qualys-cloud-agent] action install[2016-12-01T12:35:32+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py exceeded timeout 900


       ================================================================================
       Error executing action `install` on resource 'yum_package[qualys-cloud-agent]'
       ================================================================================

       Mixlib::ShellOut::CommandTimeout
       --------------------------------
       Command timed out after 900s:
       Command exceeded allowed execution time, process terminated
       ---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
       STDOUT:
       STDERR:
       ---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----
       Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42/lib/chef/provider/package/yum/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/oel_pkg_test/recipes/default.rb

        16: package 'qualys-cloud-agent' do
        17:   source local_image
        18: end

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/oel_pkg_test/recipes/default.rb:16:in `from_file'

       yum_package("qualys-cloud-agent") do
         package_name "qualys-cloud-agent"
         action [:install]
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         declared_type :package
         cookbook_name "oel_pkg_test"
         recipe_name "default"
         source "/tmp/kitchen/cache/qualys-cloud-agent.x86_64.rpm"
         flush_cache {:before=>false, :after=>false}
       end

Did you note that yum flush_cache should not happen, but it still does? It's frustrating. This always fails so in my local kitchen (with vagrant/virtualbox) or even in AWS cloud kitchen... Real instances sometimes fail sometimes converge... But it's a lottery. Anyway why this cache update happens at all for single local rpm image!?

I did try to use rpm_package but this leads to problems with yum_package beings used in other recipes...

Any thoughts?

r2oro
  • 43
  • 6

1 Answers1

1

You probably do want to use rpm_package in this case, but as for why the cache is reloading, it might just be the first time it is getting hit and so has to do the initial reload, or it's after something else modified the package set.

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • I tried to use rpm_package but (as mentioned above) it lead to a conflict with some other recipes which use yum_package, they failed with following error message: "yum-dump General Error: Rpmdb changed underneath us". Actually this yum-dump happens on Centos as well... however it does not produce so much data... – r2oro Dec 01 '16 at 16:20
  • It sounds like your package is doing something wonky to the RPM database that yum does not like. Does all of this work by hand? – coderanger Dec 01 '16 at 16:23
  • Yes, sure the rpm package is ok. However I'm really concerned about yum_package behaviour. It fires that yum-dump.py quering for repo metadata that it is not needed at all (for local rpm installation). Actually it happens also on nodes whose caches were already refreshed. Usually it would not pose a problem, but on OEL it does, as yum-dump.py is really huge and the dump eventually times out. – r2oro Dec 02 '16 at 09:35