Enable Agents Checkboxes not applying to EDF's

Automate Package Manager is a robust solution for MSPs seeking an efficient and streamlined approach to software management across diverse operating systems. With its cross-platform compatibility, integration with popular package managers like Chocolatey, Apt-get, Yum, and Homebrew makes it the go to choice for software update management.
bmartindcs
Posts: 11
Joined: Fri Aug 09, 2024 9:54 am

Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

Gone through setup and forcing singular package installs is working but scans and policies are not. Doing some checking and I may have found something related. The EDF's which ultimately are what triggers stuff I believe, are not reflecting what the APM GUI shows.

When enabling agents, I have clicked the Desktop/Laptop and Server checkboxes under the Windows section. Then picking a client and hit save. It then appears in the box down below as "enabled" and has Desktop AND Server checkboxes in them. However, looking at the EDF's for those client locations and the EDF for workstation is checked but server is NOT checked. This behavior is seen on ALL clients/sites.
Zight 2024-08-10 at 4.04.50 AM.jpg
Zight 2024-08-10 at 4.04.50 AM.jpg (145.81 KiB) Viewed 6182 times

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

Looks like a bug, let me go look and see if I can recreate that issue, I'll get back to you once completed.

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

Yeap, A typo. I reference the EDF by name and I forgot to make servers plural when setting EDFs.

I will have a fix out today for this, Will also look at the edit policy issue while im here...

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

It took a little while but we have Build 1.0.0.16 released and ready. You now have a right click menu on the policy list that provides a set of menu items (Edit and Delete). Edit wil load a form with content so you can make changes to policy. I fixed the issue with Windows Server check box not checking when settings a policy.

I also added a function to reset chocolatey sources to default if you deselect to use sources after applying a source policy.

Plugin will auto update tonight or you can manual update using the following link.

https://delivery.shopifyapps.com/-/52d2 ... bc3e60f434

bmartindcs
Posts: 11
Joined: Fri Aug 09, 2024 9:54 am

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

Cool! Thanks

Still running into other issues.

The first is the "install package manager" script was not installing choco and the "deploy package manager" group was completely full of all systems and never went down - and that group appears to be populated by the fact Choco exists or not. I used debug and stepped through the script and see that it was failing at the first powershell script. The code was missing a closing "}" after the "return" code in the IF block. Once I added that and saved, the script installed Choco correctly.

I noticed while Stepping through the install and update packages scripts and saw that the call to Choco did not have any mention of the --source option specifying the source repo. Is that intentional ? I didn't see where that was done, but maybe it is setting the source within Choco policies itself vs per-install? I ask because I am not seeing my private repo being used. I hard set the repo --source option with my URL/creds in the call to Choco and it was pulling from my repo properly. Not sure if I need to somehow reset the source settings or something. Like maybe my deployments are messed up from the previous issues.

The Deploy Source Policy group has no Scheduled scripts on it. Is that intentional?

Finally, dunno if this is relevant but I am seeing this in the logs:
Zight 2024-08-14 at 1.24.44 AM.jpg
Zight 2024-08-14 at 1.24.44 AM.jpg (131.32 KiB) Viewed 5984 times

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

Oh thats no good, Sure enough build 1.0.0.14 shows this change showing up in code. I have corrected this in build 1.0.0.17 now available for download. APM plugin should auto update later tonight.


I noticed while Stepping through the install and update packages scripts and saw that the call to Choco did not have any mention of the --source option specifying the source repo. Is that intentional ? I didn't see where that was done, but maybe it is setting the source within Choco policies itself vs per-install? I ask because I am not seeing my private repo being used. I hard set the repo --source option with my URL/creds in the call to Choco and it was pulling from my repo properly. Not sure if I need to somehow reset the source settings or something. Like maybe my deployments are messed up from the previous issues.

The Deploy Source Policy group has no Scheduled scripts on it. Is that intentional?
Sources are applied to each agent as a pre set Choco prameter. This means that we do not need to include the source with every package update or install call. The new sources should be added to the choco's source list and multiple sources can exist at once and are based on priority values set with source.

This command will list all the currently configured sources on an agent. To troubleshoot, run command to see if source exists and has priority over default repo.

Code: Select all

~/Choco.exe sources list -r

So, how do we deploy the sources and how can you validate or reset sources if needed?

All deployment operations are managed by group/search/script, this includes installing package managers, updating sources or UNC caching, New agent onboarding, Scanning agent for package data, and installing approved packages.

EDFs are used to initiate these operations and EDFs are used to force agents in and out of the different groups. Let me explain further.


When you configure an agent to be managed by APM, the EDF "Enable Agent" is set to true. This cause agent to join the Automate Package Manager master group. This main group has no script functions but will show you all enabled agents.

We have a sub group called "Deploy Package Managers" that agents with the EDF "Enabled Agent" is true and "Deployed Package Manager" is false wil auto join. They will remain in this group until the Deploy Package Managers script has successfully completed towhich it will have set the EDF "Deployed Package Manager" to true. This invalidates the agent for the "Deploy Package Manager" sub group and the agent leaves this sub group.

The same thing takes place for Sources. Once you have created a source and applied it to an agent via the plugin interface, the agents EDF "Enable Sources" is now set to true along with the Source policy name. This causes agent to join the Deploy Sources sub group where the script "Deploy Sources" get run against agent. If successful, the script will set the EDF "Sources Enabled" which will cause the agent to leave the deploy sources sub group.

At any time you can uncheck the validaion EDFs and force the agent to re join the sub group for that function and reapply its current configured settings.


We just added to build 1.0.0.16 a new set of functions, new sub group and new search that will look for agents that were configured for either sources or UNC and then were unconfigured for both. There was no operation to convert them back to a default repository. "APM Chocolatey Default Repository" EDF shows that agent is using the default repository. If unchecked along with both sources enabled and UNC enable are uncheked, the agent will join the Reset Chocolatey Default Repository sub group, agent will then execute the reset chocolatey defaults script which updates the agents EDF, causing agent to leave group once the defaults have been reset.


By adjusting different EDFs under agent you can force agent to reset that function.

Screenshot 2024-08-15 095007.png
Screenshot 2024-08-15 095007.png (34.46 KiB) Viewed 5898 times

It is by design that agents are not permanently part of any subgroups. Agent Update Packages functions work behind the sences and based on scheduling you set for agent policy. Updates are not handled by group management.

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

As for the SQL error,

Please update your plugin to latest build, remove the error file, restart the dbagent.

Afterwards allow a minute or two then have a look to see if new error file exist. If so post the error here.

If it does not show up right away, check back in 24 hours to see if error comes from backend automation.

Post that here if so.

This will help me track down your issue. I am not seeing any error logs on our test system currently.

bmartindcs
Posts: 11
Joined: Fri Aug 09, 2024 9:54 am

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

The latest update improved things, absolutely and I have moved forward only to encounter the Auto Update and Auto Install flags set in the policy is not impacting the actual agent. The Policy shows being assigned to the agent in the EDF. Source policy also shows assigned in the EDF but the checkboxes/text for Choco Default Repo is still checked.
Zight 2024-08-18 at 4.29.40 AM.jpg
Zight 2024-08-18 at 4.29.40 AM.jpg (84.59 KiB) Viewed 5741 times
Zight 2024-08-18 at 4.30.17 AM.jpg
Zight 2024-08-18 at 4.30.17 AM.jpg (106 KiB) Viewed 5741 times
The same thing takes place for Sources. Once you have created a source and applied it to an agent via the plugin interface, the agents EDF "Enable Sources" is now set to true along with the Source policy name. This causes agent to join the Deploy Sources sub group where the script "Deploy Sources" get run against agent. If successful, the script will set the EDF "Sources Enabled" which will cause the agent to leave the deploy sources sub group.
Zight 2024-08-18 at 4.26.47 AM.jpg
Zight 2024-08-18 at 4.26.47 AM.jpg (128.98 KiB) Viewed 5743 times
I have said Deploy Source Policy group, but no scripts are assigned to the group. Also, I do not see a script called "Deploy Sources" at all.

Policy Screenshot I am testing with is below. Only one policy is applied to the Client-ALL Locations.
2Zight 2024-08-18 at 4.01.57 AM.jpg
2Zight 2024-08-18 at 4.01.57 AM.jpg (78.08 KiB) Viewed 5744 times

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

Ah,

Your missing the sources script, I bet that will cause confussion. That cause the issues your seeing where checkboxes are not set for sources. This solves the reason you were having SQL errors with script ID, The script was missing so there was no ID to query.


Build 1.0.0.18 should resolve that issue.

https://delivery.shopifyapps.com/-/3152 ... 5738baef53

Update your plugin, restart the DBagent and allow a few minutes for the DBagent to complete it's tasks. Verify that this script now exists.

Also make sure that script is assigned in the group. Seeing that script was missing I bet that the group could not find "scriptID" which was the SQL error you were getting before. The group is already created, so the DBagent will not modify it now.

After plugin update and DBagent restart,

Open the Groups in Automate, Find the Deploy Source Policy group and edit it. Under the Scheduled Scripts section, verify that the following script is listed and scheduled for group. I suppect it will not be as it was created before script exisited. Use the Script selection box to locate the APM Deploy Agent Sources script and schedule it to run "Daily" every 4 hours. This will correct your issues and will allow sources to be set as expected. During source configurations the Chocolatey Default Repository will be unchecked by the source management script.

Screenshot 2024-08-19 114339.png
Screenshot 2024-08-19 114339.png (205 KiB) Viewed 5662 times

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: Enable Agents Checkboxes not applying to EDF's

Post by Cubert »

On a side note, I will apply a credit to your account for the next billing cycle for the troubles you had. I appreciate your patients as we resolve your issues. There are a plethra of things with Automate that could cause varying issues with plugins that we sometimes can not fully recreate in a development environment. It takes a customer to apply it to a particular seneriao before the problem arises.

Thank you for assisting us in identifing these issues.

Post Reply

Return to “Automate Package Manager”