Skip to content

Retry rpm gpg imports - #975

Open
ignasr wants to merge 1 commit into
DataDog:mainfrom
ignasr:add_retries_for_rpm_gpg_import
Open

ignasr wants to merge 1 commit into
DataDog:mainfrom
ignasr:add_retries_for_rpm_gpg_import

Conversation

@ignasr

@ignasr ignasr commented Oct 23, 2026

Copy link
Copy Markdown

It was noticed that sometimes our Kitchen CI fails because of rpm gpg import failing, possibly because some other process is still holding it on a freshly provisioned VM.

We use a workaround that patches this step in our wrapper cookbook, and it solved the probem.

This should resolve the issue at source, while not having negative impact. I see similar thing is being done with Debian based OSes.

The error from CI:

[2026-10-19T02:37:23+00:00] INFO: remote_file[remote_file_DATADOG_RPM_KEY_CURRENT.public] sending run action to execute[rpm-import datadog key current] (immediate)
  * execute[rpm-import datadog key current] action run[2026-10-19T02:37:23+00:00] INFO: Processing execute[rpm-import datadog key current] action run (datadog::repository line 225)
[2026-10-19T02:37:23+00:00] INFO: Processing execute[Guard resource] action run (dynamically defined)
gpg: keyblock resource '/root/.gnupg/pubring.kbx': No such file or directory
pub   rsa4096 2023-04-20 [SC] [expires: 2028-04-18]
uid           Datadog, Inc. RPM key (2023-04-20) (RPM key) <package+rpmkey@datadoghq.com>
[2026-10-19T02:37:23+00:00] INFO: execute[Guard resource] ran successfully

    [execute] error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Resource temporarily unavailable)
       error: /tmp/kitchen/cache/DATADOG_RPM_KEY_CURRENT.public: key 1 import failed.

    ================================================================================
    Error executing action `run` on resource 'execute[rpm-import datadog key current]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of rpm --import /tmp/kitchen/cache/DATADOG_RPM_KEY_CURRENT.public ----
    STDOUT:
    STDERR: error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Resource temporarily unavailable)
    error: /tmp/kitchen/cache/DATADOG_RPM_KEY_CURRENT.public: key 1 import failed.
    ---- End output of rpm --import /tmp/kitchen/cache/DATADOG_RPM_KEY_CURRENT.public ----
    Ran rpm --import /tmp/kitchen/cache/DATADOG_RPM_KEY_CURRENT.public returned 1

    Resource Declaration:
    ---------------------
    # In /tmp/kitchen/cache/cookbooks/datadog/recipes/repository.rb

    225:     execute "rpm-import datadog key #{rpm_gpg_key[rpm_gpg_keys_short_fingerprint]}" do
    226:       command "rpm --import #{key_local_path}"
    227:       only_if "gpg --dry-run --quiet --with-fingerprint #{key_local_path} | grep '#{rpm_gpg_key[rpm_gpg_keys_full_fingerprint]}' || gpg --dry-run --import --import-options import-show #{key_local_path} | grep '#{gpg_key_fingerprint_without_space}' || [ #{rpm_gpg_key[rpm_gpg_keys_short_fingerprint]} = \"current\" ]"
    228:       action :nothing
    229:     end
    230:   end

    Compiled Resource:
    ------------------
    # Declared in /tmp/kitchen/cache/cookbooks/datadog/recipes/repository.rb:225:in `block in from_file'

@ignasr
ignasr requested review from a team as code owners October 23, 2026 13:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T13:31:22.571448Z 02e1daa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant