-
Notifications
You must be signed in to change notification settings - Fork 1
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
Reported updates includes a list of all root directories #9
Comments
Out of all issues migrated over, I can confirm that this is still an active issue that needs to be resolved. |
Using 'set -u' and 'set -e', both of which appear to be best practice flags for Bash scripting. Setting these now in an effort to help troubleshoot why the script occasionally returns a directory listing in place of available updates. refs WhyAskWhy#9
Ran the script on one of my Ubuntu 14.04 VPS boxes (2c53bec) and got this:
Might not be related, but it's a start. |
Using the 'set -u' flag triggers 'unbound variable' errors in cases where the array length may be empty. I have reworked the checks to use what appears to be an arcane construct for handling empty arrays properly. refs WhyAskWhy#9
The unbound variable error should be resolved as of db0cf4d. |
This is to force early exit if any command in a pipeline fails instead of allowing the last exit code in the pipeline from determining overall success/failure. Not directly related, but this should prove useful in helping to narrow down the specific cause of invalid patch reports as noted on the related ticket. refs WhyAskWhy#9
In some cases I added guards even on code that is no longer used refs WhyAskWhy#9
Such is optimism. |
Not that it means a whole lot, but I manually ran the latest copy of the script on two production CentOS 6 nodes without issue. I dropped the latest version in place and will wait some time to see how things shake out. If I'm unable to reproduce the issue in a few months time I will close this out. |
I deployed the current version on an Ubuntu 16.04 box and for the most part it went well enough, but I forced an update check today and got this back:
I actually saw it happen several times, but I think the repeated values are likely due to something else (the wrapper that I was using to mass execute the command). |
Relevant code: email-updates/email_updates.sh Line 280 in 2569ef1
Full code block: previously_reported_updates=($(sqlite3 "${DB_FILE}" "${sql_query_match_first_field}" | cut -d '|' -f 2))
for previously_reported_update in ${previously_reported_updates[@]}
do
if [[ "${VERBOSE_DEBUG_ON}" -ne 0 ]]; then
echoerr "[I] SQL QUERY MATCH:" $previously_reported_update
fi
# Assume that old database entries may need multiple spaces
# stripped from strings so we can accurately compare them
stripped_prev_reported_update=$(sanitize_string ${previously_reported_update})
# See if the selected patch has already been reported
if [[ "${stripped_prev_reported_update}" == "${patch_to_check}" ]]; then
# Report a match, and exit loop
return 0
fi
done |
Another case of "unbound variable" errors refs WhyAskWhy#9
I've not been able to reproduce the problem since the changes in c10a604. Closing now. |
I encountered the issue a few more times on some CentOS 6 boxes, but they were not running the latest version of the script so at present those results are inconclusive. |
Repeat issue today from a CentOS 6 VM. |
Still seeing this on CentOS 6 VMs. Somewhere I'm making use of an uninitialized variable or some such programming mistake. The good news is that I should be able to work around the issue by looking for exit code 100 from
|
Prior to this commit, only the filtered output from 'yum check-update' was used to determine whether there were available updates to report. This commit looks for the specific exit code indicated available updates as published in the man page. refs WhyAskWhy#9
https://www.cyberciti.biz/tips/bash-shell-parameter-substitution-2.html Not sure if using the approach of setting default values is the answer, but it's worth considering. I still can't help but feel I'm missing something obvious here. Note: The changes in fec3fce / #24 seem to be working, but I'm still interested in fixing the root cause which that set of changes works around. |
Example:
I've not dug into the code yet to see where the problem lies.
Sampling of items in the SQLite database (
/var/cache/email_updates/reported_updates.db
):sqlite> select * from reported_updates order by id desc limit 10;
Not only is the logic flawed that filters out applicable updates, but so is the logic that checks for previously reported updates. Entries 607 and 606 (ignoring all others) appear to be identical at first glance.
The text was updated successfully, but these errors were encountered: