Skip to content

Commit

Permalink
debug pmc or afd
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcilvaney committed Jan 14, 2025
1 parent 3f92114 commit 0352509
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .pipelines/templates/PackageBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ steps:
max_cascading_rebuilds_arg="MAX_CASCADING_REBUILDS=${{ parameters.maxCascadingRebuilds }}"
fi
sudo make -C "${{ parameters.buildRepoRoot }}/toolkit" build-packages -j$(nproc) \
sudo make -C "${{ parameters.buildRepoRoot }}/toolkit" precache -j$(nproc) \
CONCURRENT_PACKAGE_BUILDS=${{ parameters.concurrentPackageBuilds }} \
CONFIG_FILE="" \
MAX_CPU="${{ parameters.maxCPU }}" \
Expand All @@ -244,7 +244,9 @@ steps:
$quick_rebuild_packages_arg \
$run_check_arg \
$toolchain_archive_arg \
$use_ccache_arg
$use_ccache_arg || true
sudo ${{ parameters.buildRepoRoot }}/testcurl.sh ${{ parameters.buildRepoRoot }}/build/logs/precache/precache.log
displayName: "Build packages"
- ${{ if parameters.outputArtifactsFolder }}:
Expand Down
20 changes: 20 additions & 0 deletions testcurl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

LOGFILE=$1

# We have a log file, some lines will contain "Failed to download". From each of these lines, extract the URL that failed to download.
# The URLs will be in the format "https://*.rpm".

# time="2025-01-13T15:53:34Z" level=info msg="Attempt 1/8: Failed to download (https://packages.microsoft.com/azurelinux/3.0/prod/base/x86_64/Packages/l/libnuma-2.0.16-1.azl3.x86_64.rpm) with error: (download error:\nrequest failed:\nGet \"https://packages.microsoft.com/azurelinux/3.0/prod/base/x86_64/Packages/l/libnuma-2.0.16-1.azl3.x86_64.rpm\": dial tcp 13.107.246.40:443: i/o timeout)"
# We would want to extract the URL "https://packages.microsoft.com/azurelinux/3.0/prod/base/x86_64/Packages/l/libnuma-2.0.16-1.azl3.x86_64.rpm"
urls=$(cat $LOGFILE | grep "Failed to download" | grep -oP 'https://[^ \)]*.rpm' | sort | uniq)

# For each url, debug the issue by running curl -v <url>. If the curl command fails, print the error message, but continue to the next URL.
# Save the files in a directory called "debug" in the current directory.
for url in $urls; do
printf '\n\n\n###################### Debugging %s ######################\n\n\n' "$url"
curl -vO "$url"
done

echo "Done debugging"
exit 1

0 comments on commit 0352509

Please sign in to comment.