-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Report failures to update native packages. #21144
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
base: master
Are you sure you want to change the base?
Conversation
The current check is relatively naive and only compares the installed version of Netdata against the latest published release. Long term we should probably improve it, but for now this is good enough to clearly report the inability to update.
This avoids the most likely case of false positives (updating while we’re in the process of publishing a new version).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the version checking logic in the netdata-updater script by extracting helper functions for better code organization and reusability. It also adds validation for binary package updates to detect when the package manager fails to update Netdata despite not reporting an error.
- Extracted
get_latest_tag(),get_current_version(), andget_latest_version()as separate helper functions - Added post-update verification for binary package installations to detect incomplete updates
- Updated the error code counter to U001E
Comments suppressed due to low confidence (2)
packaging/installer/netdata-updater.sh:820
- The variable
latest_tagis undefined in this scope after the refactoring. The oldupdate_available()function previously set this variable fromget_latest_version(), but the refactored version no longer does. Line 820 should callget_latest_tag()instead:latest_major=\"$(echo \"$(get_latest_tag)\" | cut -f 1 -d '.' | tr -d 'v')\"
current_major="$(${ndbinary} -v | cut -f 2 -d ' ' | cut -f 1 -d '.' | tr -d 'v')"
latest_major="$(echo "${latest_tag}" | cut -f 1 -d '.' | tr -d 'v')"
packaging/installer/netdata-updater.sh:819
- The variable
ndbinaryis undefined in this scope. After refactoring,get_current_version()setsndbinaryas a local variable, butupdate_available()attempts to use it. Eitherndbinaryshould be exported fromget_current_version()or line 819 should be changed to re-execute the netdata binary lookup or extract the major version from the current version information.
current_major="$(${ndbinary} -v | cut -f 2 -d ' ' | cut -f 1 -d '.' | tr -d 'v')"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| error "" | ||
| error "A newer version of Netdata is available, but the system package manager does not appear to have updated to that version." | ||
| error "" | ||
| error "Most likely, your system is not up to date, and you have it configured in a way that prevents updating Netdata from updating any of Netdata's dependencies." |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase 'prevents updating Netdata from updating' contains redundant wording. It should be 'prevents Netdata from updating' or 'prevents the updater from updating'.
| error "Most likely, your system is not up to date, and you have it configured in a way that prevents updating Netdata from updating any of Netdata's dependencies." | |
| error "Most likely, your system is not up to date, and you have it configured in a way that prevents Netdata or any of Netdata's dependencies from updating." |
| error "Please try updating your system manually and then re-running the Netdata updater before reporting an issue with the update process." | ||
| error "" | ||
| fatal "Package manager did not fully update Netdata despite not reporting a failure." U001D | ||
| exit 1 |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exit 1 statement on line 1189 is unreachable because fatal terminates the script. This line should be removed as it serves no purpose and adds confusion.
| exit 1 |
|
Hello @Ferroin , Please, take a look in copilot suggestions. |
Summary
The current check is relatively naive and only compares the installed version of Netdata against the latest published release and the version that was reported prior to the update. Long term we should probably improve it, but for now this is good enough to clearly report the inability to update.
Test Plan
n/a