Bug 12936 - rpm: unrecognized option
Summary: rpm: unrecognized option
Status: RESOLVED WONTFIX
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-22 16:40 UTC by Swampcritter
Modified: 2021-02-25 16:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
chef-stacktrace.out error file (11.25 KB, text/plain)
2020-05-22 16:40 UTC, Swampcritter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Swampcritter 2020-05-22 16:40:37 UTC
Created attachment 8466 [details]
chef-stacktrace.out error file

We are using Chef Habitat to install several RPM packages (DataDog 'Agent' is currently the big one we are trying to deploy) on Linux AWS EC2 instances and have noticed in the chef-stacktrace.out error file that references BusyBox. We are trying to narrow down where the problem is located - is it a BusyBox, Chef Habitat, Chef Server or Chef Infra client issue?

I also submitted the bug/issue here: https://github.com/mirror/busybox/issues/25


Reference:
https://github.com/DataDog/chef-datadog/blob/master/recipes/repository.rb

Mixlib::ShellOut::ShellCommandFailed: execute[rpm-import datadog key e09422b3] (datadog::repository line 85) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of rpm --import /hab/svc/wabtec_base_tools/data/cache/cache/DATADOG_RPM_KEY_E09422B3.public ----
STDOUT:
STDERR: rpm: unrecognized option: -
BusyBox v1.29.2 (2019-01-15 01:45:56 UTC) multi-call binary.

Usage: rpm -i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm

Manipulate RPM packages

Commands:
-i Install package
-qp Query package
-qpi Show information
-qpl List contents
-qpd List documents
-qpc List config files
---- End output of rpm --import /hab/svc/wabtec_base_tools/data/cache/cache/DATADOG_RPM_KEY_E09422B3.public ----
Ran rpm --import /hab/svc/wabtec_base_tools/data/cache/cache/DATADOG_RPM_KEY_E09422B3.public returned 1
Comment 1 Ron Yorston 2020-05-25 07:19:30 UTC
BusyBox rpm only supports a limited subset of functionality. It doesn't have the '--import' option. In fact, it doesn't have any long options which is why it complains that '-' is an unknown option.

If your chef's recipe calls for '--import' you'll have to give them the proper ingredients: a full version of rpm.
Comment 2 Denys Vlasenko 2021-02-25 16:39:56 UTC
In upstream package,
rpm --import PUBKEY is an alias for rpmkeys --import PUBKEY

busybox's rpm applet is only intended to be used as "unpacker" of .rpm files (example: running an emergency shell and installing a package form a .rpm file on a system which was broken by failed update or erroneous removal of a critical package).

It knows nothing about keys, a database of installed packages, etc.