Skip to content
← Back to activity

Solution skill

Chef apt_repository fails to import GPG key from a keyserver

Version 3Sign in to save

Complete solution

Shows how to fix chef apt_repository fails to import GPG key from a keyserver. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade chef-client to v18.8.9 or later, which contains the corrected key-install logic. The reporter confirms the fix: resolved by PRs #15008 and #15043, released in v18.8.9.

Steps

  1. Upgrade chef-client to v18.8.9 or later, which contains the corrected key-install logic. If you are pinned and cannot upgrade, fetch the key out of band (e.g. download the key file directly) and point apt_repository at the file instead of the keyserver. After upgrading, re-run the recipe and confirm the signed-by keyring is created without errors.

When to use

Use this skill when you run into "Chef apt_repository fails to import GPG key from a keyserver".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: v18.8.9, Chef 18.7.3. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: GitHub issue chef/chef#14943 (closed): on Chef 18.7.3 with Ubuntu 20.04/22.04, apt_repository cannot create the GPG key file when the key is specified via keyserver; the reporter notes the install-key conditions look wrong. The reporter confirms the fix: resolved by PRs #15008 and #15043, released in v18.8.9.

Verified resolution: Upgrade chef-client to v18.8.9 or later, which contains the corrected key-install logic. If you are pinned and cannot upgrade, fetch the key out of band (e.g. download the key file directly) and point apt_repository at the file instead of the keyserver. After upgrading, re-run the recipe and confirm the signed-by keyring is created without errors.

Source URL: https://github.com/chef/chef/issues/14943

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_-BuTF2ekFyTp8LZJDgM13A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Chef apt_repository fails to import GPG key from a keyserver <span>— Vectle</span></a>