RPM error under Chef Habitat

Running into a bit of an odd issue. We are running under Chef v15. Under Chef habitat, we are installing a series of app/package cookbooks. One of them has been recently been erroring out and we cannot find the cause of it. Per the journald
output, we are seeing that the RPM package is being downloaded correctly, but the RPM command seems to be bugging out for the query/installing the RPM.

However, if we run “chef-client -o recipe[wabtec_nessus]” from the command line on a Linux/CentOS 7 instance, the package installs fine.

Any help would be appreciated.

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): [2020-04-24T14:47:07+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: yum_package[nessus] (wabtec_nessus::linux line 28)

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): ---- Begin output of rpm -qp --queryformat '%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{ARCH}

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): ' /hab/svc/wabtec_base_tools/data/cache/cache/NessusAgent-7.4.3-es7.x86_64.rpm ----

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): STDOUT:

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): STDERR: rpm: unrecognized option: -

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): BusyBox v1.29.2 (2019-01-15 01:45:56 UTC) multi-call binary.

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O):

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): Usage: rpm -i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O):

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): Manipulate RPM packages

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O):

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): Commands:

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): -i Install package

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): -qp Query package

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): -qpi Show information

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): -qpl List contents

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): -qpd List documents

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): -qpc List config files

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): ---- End output of rpm -qp --queryformat '%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{ARCH}

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): ' /hab/svc/wabtec_base_tools/data/cache/cache/NessusAgent-7.4.3-es7.x86_64.rpm ----

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): Ran rpm -qp --queryformat '%{NAME} %{EPOCH} %{VERSION} %{RELEASE} %{ARCH}

Apr 24 10:47:07 ip-10-91-68-29.ec2.internal hab[646]: wabtec_base_tools.default(O): ' /hab/svc/wabtec_base_tools/data/cache/cache/NessusAgent-7.4.3-es7.x86_64.rpm returned 1

Anyone have an idea why this rpm error is occurring? It's preventing us from installing rpm packages on CentOS instances using Chef Habitat. Tried using yum_package as well, but it fails with the same error.

Chef recipe code:
rpm_package 'nessus' do
source "#{Chef::Config[:file_cache_path]}/NessusAgent-7.4.3-es7.x86_64.rpm"
package_name 'NessusAgent-7.4.3-es7.x86_64'
action :install
not_if { ::File.exist?('/opt/nessus_agent/sbin/nessuscli') }
end

Rather than debugging the issue, discovered that Chef has made some updates to the 'package' function, so utilized this code in the recipe and it solved the issue.

package 'nessus' do
source "#{Chef::Config[:file_cache_path]}/NessusAgent-7.4.3-es7.x86_64.rpm"
package_name 'NessusAgent-7.4.3-es7.x86_64'
action :install
end

Actually it didn't fix it. Under Chef Habitat it still fails, but under manual installation chef-client steps it works fine.

Adding core/rpm into the pkg_deps array fixes this issue as it overrides the Busybox rpm implementation.