Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent Download Failures for Vcpkg Dependencies #392

Open
lchico opened this issue Dec 5, 2024 · 0 comments
Open

Intermittent Download Failures for Vcpkg Dependencies #392

lchico opened this issue Dec 5, 2024 · 0 comments
Labels
level/task Task issue module/packages Agent packages type/research Research issue

Comments

@lchico
Copy link
Member

lchico commented Dec 5, 2024

Description

While generating Debian/CentOS packages, I have intermittently encountered errors when vcpkg attempts to download certain dependencies. The issue seems to occur sporadically, potentially affecting different packages, but it has been repeatedly observed with the following dependency:

https://gitlab.gnome.org//GNOME/libxml2/-/archive/v2.11.7/libxml2-v2.11.7.tar.gz

Below is a sample error output:

[DEBUG] 1000: execute_process(curl --fail -L https://gitlab.gnome.org//GNOME/libxml2/-/archive/v2.11.7/libxml2-v2.11.7.tar.gz --create-dirs --output /build_wazuh/agent/wazuh-agent-5.0.0/src/vcpkg/downloads/GNOME-libxml2-v2.11.7.tar.gz.34390.part)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 22 after  4244993 us
error: Missing GNOME-libxml2-v2.11.7.tar.gz and downloads are blocked by x-block-origin.
error: https://gitlab.gnome.org//GNOME/libxml2/-/archive/v2.11.7/libxml2-v2.11.7.tar.gz: curl failed to download with exit code 22
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

curl: (22) The requested URL returned error: 503 

[DEBUG] /source/src/vcpkg/base/downloads.cpp(1030): 
[DEBUG] Time in subprocesses: 4244993us
[DEBUG] Time in parsing JSON: 2us
[DEBUG] Time in JSON reader: 0us
[DEBUG] Time in filesystem: 749us
[DEBUG] Time in loading ports: 0us
[DEBUG] Exiting after 4.2 s (4245307us)

The error indicates a 503 Service Unavailable response, which suggests temporary unavailability of the server hosting the dependency.

Observed Behavior

  • After encountering this issue, retrying the build after a few hours resolves the problem, and the packages generate successfully.
  • This behavior points to temporary server outages affecting certain vcpkg dependencies, rendering download links temporarily invalid.

Mitigation Strategy

As a workaround, the cached dependencies available in GitHub can be used by passing the --vcpkg-binary-caching-key parameter with the appropriate GitHub token to the package generation script.

./generate_package.sh --vcpkg-binary-caching-key $GH_TOKEN 

Note: The token must have write:package permissions.

This issue has been observed multiple times, causing confusion and delays. Centralizing this information in an issue will help clarify that temporary server outages cause this behavior and provide clear steps for mitigation.

@lchico lchico added type/research Research issue module/packages Agent packages labels Dec 5, 2024
@vikman90 vikman90 changed the title Informative Issue: Intermittent Download Failures for Vcpkg Dependencies Intermittent Download Failures for Vcpkg Dependencies Dec 10, 2024
@vikman90 vikman90 added the level/task Task issue label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue module/packages Agent packages type/research Research issue
Projects
None yet
Development

No branches or pull requests

2 participants