-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f92114
commit 0352509
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |