Skip to content

Skip pre-upgrade package validation when download_url_override is set - #268

Open
stlng2 wants to merge 1 commit into
chef-cookbooks:mainfrom
stlng2:skip-validation-with-download-url-override
Open

stlng2 wants to merge 1 commit into
chef-cookbooks:mainfrom
stlng2:skip-validation-with-download-url-override

Conversation

@stlng2

@stlng2 stlng2 commented Nov 13, 2026

Copy link
Copy Markdown

Description

validate_package_availability, added in #261 and released in 3.14.0, calls mixlib_install.artifact_info before every upgrade, even when download_url_override is set. In that case the package location (and usually the checksum) come from the user, so there's nothing to look up. The lookup still goes to Chef's packages API, and that causes two failures:

  • Hosts without internet access silently stop upgrading. On a host that can't reach packages.chef.io, which is common when packages are served from an internal mirror, which is exactly why download_url_override exists, artifact_info times out. The resource then logs:
    WARN: Package validation failed: Failed to open TCP connection to packages.chef.io:443 (execution expired). Skipping upgrade.
    
    The client never changes version, and since the Chef run itself succeeds, nothing alerts. This happens on Linux, not only Windows, because the validation step runs on all platforms.
  • The wrong build can be validated (Cannot upgrade cinc-client on Windows Server 2022 #266). On Windows Server 2022, Omnitruck returns the Windows 2016 build in compatibility mode, and validate_windows_package_availability then rejects it, even though the user pointed download_url_override at a valid package.

This change returns early from validate_package_availability when download_url_override is set, and logs which URL will be used. Behavior without download_url_override is unchanged, so the CDN-propagation race protection from #261 still applies to downloads from Chef's servers.

Before 3.14.0, an X.Y.Z version together with download_url_override didn't need Chef's servers at all. This restores that for the validation step.

Issues Resolved

Check List

  • All tests pass (chef exec rspec spec/: 33 examples, 0 failures)
  • New functionality includes testing. In spec/unit/libraries/chef_client_updater_helper_spec.rb:
    • with download_url_override, the packages API isn't queried, the Windows check is skipped, and the result is true;
    • the existing validation specs now explicitly run without an override, since the shared let sets one by default.
  • New functionality has been documented in the README if applicable (no README change needed)
  • All commits have been signed for the Developer Certificate of Origin

validate_package_availability queries the packages API via
mixlib_install.artifact_info even when download_url_override is set.
The package URL and checksum already come from the user, so there is
nothing to look up, and the lookup fails on hosts without internet
access (the upgrade is skipped) and can return the wrong build for the
platform (chef-cookbooks#266).
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.

Cannot upgrade cinc-client on Windows Server 2022

1 participant