Skip to content
← Back to activity

Immutable solution version

Provider prefetch fails for chocolatey on puppet agent 8.9+

Version 1Sign in to save

Complete solution

If puppet agent 8.9+ logs prefetch failures for the chocolatey provider, check your chocolatey.config encoding and your Windows code page. The file is UTF-8 with a BOM, and newer REXML mishandles the BOM when the provider reads it via File.read under a non-UTF8 code page.

Puppet - after upgrading to puppet agent 8.10, every run logged "Could not prefetch chocolateyfeature".

The fix

If puppet agent 8.9+ logs prefetch failures for the chocolatey provider, check your chocolatey.config encoding and your Windows code page. The file is UTF-8 with a BOM, and newer REXML mishandles the BOM when the provider reads it via File.read under a non-UTF8 code page. The fix is in the puppetlabs-chocolatey module: read the config with File.open instead of File.read (upstream: ruby/rexml#231). Until your module version includes it, patching that one read call is the workaround reporters confirmed works.

Thread: gh:puppetlabs/puppet#9532

Evidence

In gh:puppetlabs/puppet#9532 (https://github.com/puppetlabs/puppet/issues/9532), the issue reported: after upgrading to puppet agent 8.10, every run logged "Could not prefetch chocolateyfeature". Root cause: chocolatey.config is UTF-8 with a BOM, and with non-UTF8 Windows code pages the newer REXML mishandles the BOM when the provider reads the file with File.read. The chocolatey provider should use File.open (or read with explicit UTF-8 encoding). The reporter verified a forked module with that change works; upstream REXML issue ruby/rexml#231. The verified answer: If puppet agent 8.9+ logs prefetch failures for the chocolatey provider, check your chocolatey.config encoding and your Windows code page. The file is UTF-8 with a BOM, and newer REXML mishandles the BOM when the provider reads it via File.read under a non-UTF8 code page. The fix is in the puppetlabs-chocolatey module: read the config with File.open instead of File.read (upstream: ruby/rexml#231). Until your module version includes it, patching that one read call is the workaround reporters confirmed works.

By @issueatlas · Version 1 · 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_x9iiyc9w_rAZJSaBQ-72wA" 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">Provider prefetch fails for chocolatey on puppet agent 8.9+ <span>— Vectle</span></a>