fix: improve error handling for network connectivity issues - #38
Closed
bussyjd wants to merge 1 commit into
Closed
Conversation
- Add explicit error messages when curl commands fail due to network issues - Check for empty responses from API calls before processing - Provide clear feedback when internet connection is unavailable - Gracefully handle cases where tools are already installed but updates can't be checked Fixes #28
OisinKyne
approved these changes
Sep 11, 2025
Comment on lines
+386
to
+390
| REMOTE_HASH=$(curl -s "$OBOLUP_URL" 2>/dev/null | sha256sum | awk '{print $1}') | ||
| if [[ -z "$REMOTE_HASH" || "$REMOTE_HASH" == "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ]]; then | ||
| log_warn "Unable to check for obolup updates. Network may be unavailable." | ||
| return | ||
| fi |
Contributor
There was a problem hiding this comment.
Does this actually work? i didn't know we had obolup hosted yet.
| if [[ -z "$KUBECTL_VERSION" ]]; then | ||
| log_error "Failed to fetch kubectl version. Please check your internet connection." | ||
| fi | ||
|
|
Contributor
There was a problem hiding this comment.
Not a problem for this PR, but we should make a ticket to update kubectl by comparing local kubectl version versus fetched kubectl version and do a which kubectl like we do for k9s and only run the next download if they differ and its the type of installation we expect.
| if ! curl -sSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/$ARCHITECTURE/kubectl.sha256" 2>/dev/null; then | ||
| log_warn "Failed to download kubectl checksum. Continuing without validation..." | ||
| else | ||
| echo "$(cat kubectl.sha256) kubectl" | sha256sum --check || log_warn "kubectl checksum validation failed. Continuing anyway..." |
Contributor
There was a problem hiding this comment.
Lets crash if this fails, it looks sloppy to do the check and continue anyways
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves error handling throughout the obolup script to provide clear feedback when network connectivity issues occur, rather than failing silently.
Problem Solved
Fixes #28 - When running without internet, obolup now provides clear error messages instead of ending unclearly.
The Issue
Previously, when running
obolupwithout internet connection, the script would fail silently:And then just stop with no error message, leaving users confused.
Changes
🛡️ Improved Error Handling in All Installation Functions
kubectl installation
helm installation
kind installation
k9s installation
obol CLI installation
obolup update checker
📝 User Experience Improvements
Example Output
Before (silent failure):
(script ends with no explanation)
After (clear error):
Testing
To test these improvements:
./obolupFor tools already installed:
For tools not installed:
Impact
Related Issue
Closes #28