Skip to content
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

Windows updates not getting installed on most clients #1270

Closed
af7567 opened this issue Aug 31, 2022 · 3 comments · Fixed by #1277
Closed

Windows updates not getting installed on most clients #1270

af7567 opened this issue Aug 31, 2022 · 3 comments · Fixed by #1277

Comments

@af7567
Copy link
Contributor

af7567 commented Aug 31, 2022

Server Info (please complete the following information):

  • OS: Ubuntu 22.04
  • Browser: chrome
  • RMM Version (as shown in top left of web UI): v0.14.7

Installation Method:

  • [*] Standard

Agent Info (please complete the following information):
All agents v2.3.0

Describe the bug
I noticed that windows updates were not getting installed on most clients even after changing the patch policy to install every day. The debug log only shows the "Installing windows updates on ......." message for 1 or 2 PCs when ~30 of them are online.

I added a DebugLog to winupdate/tasks.py to print a log message for every online_agent, even if it wasn't time for an update, and that also only shows a couple of PCs online when there are lots more.

I then removed the *ONLINE_AGENTS from the return value of online_agents in agents/models.py so I have

return [
            i
            for i in cls.objects.only()
            if i.status == AGENT_STATUS_ONLINE
        ]

and now it seems to actually be checking if updates need installing on all my online clients.

(I know that cls.objects.only() must be wrong, but I couldn't figure out how to just get all objects and this seemed to work :) )

@af7567
Copy link
Contributor Author

af7567 commented Sep 1, 2022

I just checked again this afternoon and it has gone back to only detecting 3 PCs online in the windows updates check, even though the GUI is showing 35 online. So I have no idea what's going on :)
Maybe it was a combination of changing the code and restarting the TRMM services that made it start showing all the online agents, but after it's been running a while it forgot about most of them.

@BMTTeam
Copy link

BMTTeam commented Sep 1, 2022

I just want to jump on this ride (yeah, I think it's related) as well - since TRMM is managing the updates (it's been confirmed on Discord that if the update was executed outside the TRMM patching process, the date of the installation is not going to be documented, no matter it can be obtained from Windows. I hope that for NX based the dpkg.log file will be used as a base point at least) some of the updates are without dates when they were installed. No matter if it installed (well approved via server/workstation policy) via TRMM.
We had a case with several Windows machines (virtual and physical) that TRMM was indicating pending patches, even if you check on the system manually that there are not pending installation patches. I need to install the latest version 0.14.7 (at the moment running 0.14.6 and agents are v2.3.0).

P.S.: I really hope that soon we well be able to test/use (even beta) the reporting module.

Cheers,
-Tiho

@af7567
Copy link
Contributor Author

af7567 commented Sep 3, 2022

I have done a bit more playing around, still not sure what "*ONLINE_AGENTS" does, but I think it's just something to do with the fields fetched from the database and wouldn't change the number of online agents returned.

Anyway, I think the reason only 1 or 2 agents get checked for updates when lots more are online isn't because the list being returned is too small but because check_agent_update_schedule_task() is exiting after finding any agent which had patches installed the same day (that is why my tests after midnight before seemed to have fixed something)

Should this line be a continue and not a return? :

edit:
The return could be intentional, assuming all agents will be patched at the same time and are all online at the same time.
If not all agents are online though for the first patch install, then they would only get updates installed if they are lucky enough to be at the start of the list (which changes order all the time) when the next patch run comes around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants