• Getting false OS update notice


    dlandon
    • 6.5.1-rc3 Solved Minor



    User Feedback

    Recommended Comments



    Running the update assistant on a 6.5.0 version and checking against 'next' changes the /tmp/plugins/unRAIDServer.plg to 'next'.  This seems to be confusing @bonienl's code.

     

    I guess you two will have to sort out the best solution.

    Link to comment
    41 minutes ago, dlandon said:

    I guess you two will have to sort out the best solution

    lol  We all know who's going to have to fix this.  I'll make backups of the existing file(s) first and then restore.

     

    Edited by Squid
    Link to comment
    30 minutes ago, Squid said:

    lol  We all know who's going to have to fix this.  I'll make backups of the existing file(s) first and then restore.

     

    Probably the best way to handle it.

     

    Don't you know it's always your fault, and if it's not, it ought to be.

    Link to comment
    4 hours ago, Squid said:

    You bastard.  Perfect response LOL

    I'm taking that back @bonienl   :D

     

    Here's how to replicate @dlandon's problem without involving UA at all and in a perfectly acceptable manner:

     

    • Fresh boot running 6.5.0 / 6.5.1-rc2
    • Plugins - Check For Updates (or wait for a scheduled plugin check to happen) - Probably not necessary step though
    • Tools - Update OS.  Switch from Stable To Next  (when running 6.5.0) or Next to Stable (when running 6.5.1-rc2)
    • User decides to not install and carries on with their life
    • Next time a scheduled plugin check happens (and on all subsequent ones) (/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck), a notification will be given for an update being available, even though they remained on stable

     

    Problem is that plugincheck assumes that any .plg in /tmp/plugins is installed, and nothing is ever deleting unRAIDServer-.plg

     

    dlandon running Update Assistant against the Next branch replicated the same steps as above, and simply accelerated the problem.  Problem will only appear though during scheduled plugin checks.  I'll pop in a PR tomorrow night...

    Edited by Squid
    Link to comment

    I can't replicate. To follow your footsteps

    • Fresh system boot with 6.5.0
    • Peform a "Check for Updates" manually
      • This creates the file unRAIDServer.plg (with "Stable" reference) in /tmp/plugins folder
    • Switch to Next, this will initiate an immediate check
      • This creates an additional file unRAIDServer-.plg (with "Next" reference) in /tmp/plugins folder
    • I carry on with my life (drink coffee)
    • Perform a "scheduled" check (this is the script "unraidcheck")
      • Verify the files in /tmp/plugins folder: (1) unRAIDServer.plg still refers to "stable" and (2) unRAIDServer-.plg is present but not used
    • Take more coffee and wait
    • No notifications as should be, in other words it works as expected

     

    Image result for dilbert work

     

    Ps. The "plugincheck" script only checks the user plugins, and doesn't touch the OS checks.

    Edited by bonienl
    Link to comment
    4 minutes ago, dlandon said:

    I'll re-open this because it seems we haven't found the solution yet.

     

    I haven't found the problem yet :D

    Link to comment
    1 minute ago, dlandon said:

    I understand.  How can I help you find it?

     

    If somehow you can make this in repeatable steps to reproduce, I am all ears.

     

    May I ask you to start with a fresh rebooted system and ensure no left-over files are there to begin with.

     

    Link to comment
    Just now, bonienl said:

     

    If somehow you can make this in repeatable steps to reproduce, I am all ears.

     

    May I ask you to start with a fresh rebooted system and ensure no left-over files are there to begin with.

     

    Which version of unRAID do you want me to start with?  Any preference?

    Link to comment
    11 minutes ago, dlandon said:

    @bonienl I can reproduce the notice with @Squid's procedure.

     

    It's strange because for me it works as expected. Do you see anything different in the steps I described in my test and your tests?

     

    The files in the folder /tmp/plugins are the ones which indicate what (new) version is available. If you delete these files, they will be redownloaded a next time when a check is done, either manually (check for updates) or scheduled (script: unraidcheck).

    Edited by bonienl
    Link to comment
    1 minute ago, dlandon said:

    Which version of unRAID do you want me to start with?  Any preference?

     

    1 minute ago, dlandon said:

    Which version of unRAID do you want me to start with?  Any preference?

     

    My test system is on 6.5.0. If we could keep that equal, gives less equations to ponder about.

    Link to comment
    17 minutes ago, bonienl said:

     

     

    My test system is on 6.5.0. If we could keep that equal, gives less equations to ponder about.

    Steps to reproduce:

    - Fresh boot into 6.5.0.

    - Switch OS from stable to next.

    - Switch OS from next back to stable.

    - Run '/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck'

     

    Notice of update appears:

    5abcc6f786eaa_OSUpdateNotice.thumb.png.d2942e6a70128466a4918a4189392f49.png

    Keep in mind the OS selection is on stable and notification shows next installed and next available for update.

    Link to comment
    plugin('checkall');
    foreach (glob("/tmp/plugins/*.plg", GLOB_NOSORT) as $file) {
      $name = basename($file, '.plg');
      $old = plugin('version', "/var/log/plugins/$name.plg");
      $new = plugin('version', $file);
      // silently suppress bad download of PLG file
      if (strcmp($new, $old) > 0) {
        exec("$notify -e ".escapeshellarg("Plugin - $name [$new]")." -s ".escapeshellarg("Notice [$server] - Version update $new")." -d ".escapeshellarg("A new version of $name is available")." -i ".escapeshellarg("normal $output")." -x");
      }
    }

    plugincheck (not oscheck) checks every .plg in /tmp/plugins.  It doesn't care if its actually installed or not, and unRAIDServer-.plg is not installed

     

    It then compares the new version (in this case, 6.5.1rc-1 to a non existent old version).  Since the version string is > null the notification is sent out.

     

    And you can also see this in any of dlandon's screenshots as they all state A new version of unRAIDServer- is available.

     

    I think my procedure is more akin to what a user would actually do.  Check for next, then go on and do nothing or start switching tabs etc.  There is no need to switch the branch back to "normal".  And I did this on both 6.5.0 and 6.5.1rc-2

    Edited by Squid
    Link to comment
    4 minutes ago, Squid said:

    And you can also see this in any of dlandon's screenshots as they all state A new version of unRAIDServer- is available.

    Good catch.  I didn't even notice that.

    Link to comment
    14 minutes ago, Squid said:

    plugincheck checks every .plg in /tmp/plugins.  It doesn't care if its actually installed or not, and unRAIDServer-.plg is not installed

     

    It is a little more intelligent.

    // plugin checkall
    // check all installed plugins, except built-in
    //
    if ($method == "checkall") {
      foreach (glob("/var/log/plugins/*", GLOB_NOSORT) as $link) {
        // skip OS related plugins
        if (in_array(basename($link,'.plg'),$builtin)) continue;
        // only consider symlinks
        $installed_plugin_file = @readlink($link);
        if ($installed_plugin_file === false) continue;
        if (plugin("pluginURL", $installed_plugin_file, $error) === false) continue;
        $plugin = basename($installed_plugin_file);
        echo "plugin: checking $plugin ...\n";
        exec(realpath($argv[0]) . " check $plugin", $output, $retval);
      }
      exit(0);
    }

    It does skip OS (built-in) related plugins. Currently there is only one 'unRAIDServer.plg' (there used to be "dynamix.plg as well)

     

    Replying my own words, unRAIDSserver-.plg should be added in the list of built-in plugins.

     

    Thanks guys. I made a PR.

    Edited by bonienl
    Link to comment
    1 hour ago, bonienl said:

     

    It is a little more intelligent.

    
    // plugin checkall
    // check all installed plugins, except built-in
    //
    if ($method == "checkall") {
      foreach (glob("/var/log/plugins/*", GLOB_NOSORT) as $link) {
        // skip OS related plugins
        if (in_array(basename($link,'.plg'),$builtin)) continue;
        // only consider symlinks
        $installed_plugin_file = @readlink($link);
        if ($installed_plugin_file === false) continue;
        if (plugin("pluginURL", $installed_plugin_file, $error) === false) continue;
        $plugin = basename($installed_plugin_file);
        echo "plugin: checking $plugin ...\n";
        exec(realpath($argv[0]) . " check $plugin", $output, $retval);
      }
      exit(0);
    }

    It does skip OS (built-in) related plugins. Currently there is only one 'unRAIDServer.plg' (there used to be "dynamix.plg as well)

     

    Replying my own words, unRAIDSserver-.plg should be added in the list of built-in plugins.

     

    Thanks guys. I made a PR.

    At work so can't test, but I don't think that will work properly.  Sure, plugin checkall won't look for updates against unRAIDServer-, but the perfectly normal chain of events I listed will still result in that file getting created and plugincheck will still look at all *.plg in /tmp/plugins and pop out the notification in the steps I've detailed.  You need to check against /var/log/plugins/*.plg

    Link to comment



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.