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

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

I appreciate the fast responses.

Still having problems. While that script now exists and is configured to run every 4 hours on the group in question (it already was after the update somehow, I didn't have to do anything to the script or the group settings). I did restart the DB Agent.

Policies not applying or not applying completely.

Sources not applying.

Screenshots of the policies are in previous messages.

I am only testing for my own company internally and see a weird variety of inconsistent EDF's despite all being covered by same Policy and same Source policy. Some are missing auto-install and auto-update, some only auto-install. Some missing the source enabled checkbox, others missing the policy itself.

Zight 2024-08-20 at 1.23.22 AM.jpg
Zight 2024-08-20 at 1.23.22 AM.jpg (80.94 KiB) Viewed 4753 times
Zight 2024-08-20 at 1.22.07 AM.jpg
Zight 2024-08-20 at 1.22.07 AM.jpg (126.21 KiB) Viewed 4753 times
Last edited by bmartindcs on Wed Aug 28, 2024 3:48 am, edited 2 times in total.

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 »

Ok lets fix your sources first.

I am making some assumptions here so correct me if I am wrong.

The DCS client has 8 systems, all 8 systems need to use an already configured Soruce from in the plugin. Currently do to all the issues, they failed to take the original source policy as we can see this in the EDFs you provided.

If the policy was applied correctly, each agent EDF would look like the following (change the name of policy).


Screenshot 2024-08-20 172336.png
Screenshot 2024-08-20 172336.png (14.96 KiB) Viewed 4741 times


So what we need to do reapply the source policy at the client level. First, delete the "assigned" source policy by double clicking the source policy in the "Assigned Sources" list for the client in question.


Screenshot 2024-08-20 172614.png
Screenshot 2024-08-20 172614.png (59.75 KiB) Viewed 4741 times

Now, reselect your client from client list and select policy from policy list and reassign the policy.


Screenshot 2024-08-20 172742.png
Screenshot 2024-08-20 172742.png (59.75 KiB) Viewed 4741 times


Afterwards, go and check an agent or two's EDF data to verify that it indeed get set and now looks like so.

Screenshot 2024-08-20 172336.png
Screenshot 2024-08-20 172336.png (14.96 KiB) Viewed 4741 times

This should now (allow a few minutes) cause the agent to join the Deploy Sources group, the scripts will run on agent causing the EDFs to be updated. Once updated and the check box "APM - Sources Enabled" is checked. Your new sources policy is now applied. The Chocolatey Default Repository should now be unchecked. This part may take 4 hours to get scheduled so allow a little time to get the group script to schedule on the agent(s).

Screenshot 2024-08-20 173113.png
Screenshot 2024-08-20 173113.png (14.78 KiB) Viewed 4741 times

You can then test this by launching the command on agent "choco sources list -r" to get the current list of sources from agent.

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

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

Did that. Saw them rejoin the Deploy Source Policy group, and the script FAILED AND some of the machine left the group afterwards but the source policy did not get applied. Others did not leave the group at all. No idea what is going on.

The Deploy Sources script is failing on step 48.

Step 48, is it missing the SQL Dataset Variable?

When I asked about the difference between the 3 Choco management products, this was the newest and best version. Are other people using it yet or am I just unlucky here?

Zight 2024-08-20 at 11.35.56 PM.jpg
Zight 2024-08-20 at 11.35.56 PM.jpg (57.05 KiB) Viewed 4719 times
Zight 2024-08-20 at 11.44.19 PM.jpg
Zight 2024-08-20 at 11.44.19 PM.jpg (121.29 KiB) Viewed 4719 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 »

You are failing SQL because there is no Source Policy name in the EDF for your source.


This is how your EDFs must look before automation will work to set source. In your example provided, you have the Set Source EDF but not a Source to set. This should be filled out when the plugin is assigning a source to agent. You can manually add in the correct name of source policy here and save. The next schedule run of group will then set these agents.

Screenshot 2024-08-20 172336.png
Screenshot 2024-08-20 172336.png (14.96 KiB) Viewed 4703 times

You said some agents joined and left group? This is the expected behavior, once an agent has successfully set it's source it will no longer qualify for this group and will leave group. Those agents must of had a source policy name in the Source Policy field.

You can update agent policies quickly by selecting one or more agents from the agent list and selecting a policy to apply.
This should set the Source Policy name field and set the APM - Enable Sources to true. Please report back if this does not do this for you.

Screenshot 2024-08-21 095542.png
Screenshot 2024-08-21 095542.png (63.2 KiB) Viewed 4703 times


I had a chance to review the Source Deployment Script to see why you received a SQL error at line 48. Your issues from the images provided show you don't have a Source Policy name for the agent in question. In the very first lines of the script (1,2,3) we query for this name in the EDF fields, then test to see if the return exists and if not we exit script. This should of caught the missing value and exited via line 3 but in your case did not. I believe that you maybe getting a value of NULL returned that is getting by this validity test.

Am releasing 1.0.0.20 today that will address this with an update to script adding another test for a value of null which does exist, but doesn't. This was good timing, I was about to release this build with the additions of a new Source Editor and was able to slip this update in there this morning.


Source Editor is available via the Sources list.
editsource-list.png
editsource-list.png (47.95 KiB) Viewed 4703 times

Build 1.0.0.20
https://delivery.shopifyapps.com/-/8e26 ... c29e6018ff

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

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

My plugin is 1.0.0.21. Closed, and re-opened. EDF's still showing no source and not enabled. I re-ran the deploy source script, which did not error out anymore, but EDF still not changed. The source policy is, and already was previously, assigned to the client properly - even with my previous reply which I did not send a screenshot of (but was set).

[Screenshot removed for security]

I then removed the source policy, then re-applied it and the source policy name was listed in the right box and the checkbox for Enable Source was set - but not Source Enabled. An improvement for the EDF's I suppose. I manually ran the Deploy Sources script to avoid waiting and then the script failed with same SQL error. EDF's not changed of course.


[Screenshot removed for security]
[Screenshot removed for security]
Last edited by bmartindcs on Wed Aug 28, 2024 3:49 am, edited 1 time in total.

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 »

Sounds like we now have the correct set of actions working.

Applying a Source Policy sets the following EDFs.

Screenshot 2024-08-26 162308.png
Screenshot 2024-08-26 162308.png (21.92 KiB) Viewed 4550 times

The group will add the agent to the deploy source group because the EDF "APM - Enable Sources" was checked and the EDF "APM - Source Enabled" is not checked. This is the state needed to have agent in this group.


Once the group executes the Deploy Sources script, The script will set "APM - Sources Enabled", if the source was actually added to Chocolatey. If not it will leave the EDF unset. Troubleshooting issues starts with checking this EDF after the deploy source script runs, if this is not checked have a look at the agent script logs for that time period.


Screenshot 2024-08-26 163151.png
Screenshot 2024-08-26 163151.png (21.82 KiB) Viewed 4550 times


A script line failure or a chocolatey failure can occure to cause this not to set as entended. The script was not setup to log the details of any given failure, which we have now fixed in Build 1.0.0.22. We added several log outputs and adjusted several variables for better operation.

Script Logs
Screenshot 2024-08-26 163458.png
Screenshot 2024-08-26 163458.png (14.45 KiB) Viewed 4550 times


Script log Messages
Screenshot 2024-08-26 163601.png
Screenshot 2024-08-26 163601.png (12.89 KiB) Viewed 4550 times


Script log error message
Screenshot 2024-08-26 163700.png
Screenshot 2024-08-26 163700.png (10.08 KiB) Viewed 4550 times
Try build 22 and see what logs are produced.

Build 1.0.0.22 available here or will auto update tonight.
https://delivery.shopifyapps.com/-/7c21 ... 4ce1c5f8da

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

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

Updated the plugin to 1.22. No change, script fails with same SQL error. I unapplied the source policy then reapplied it just in case, no change.

You mentioned updating scripts for debug code. The Deploy Source Policy script description says version 1.20, not sure if it actually updated when I updated the plugin.


Zight 2024-08-27 at 12.58.09 AM.jpg
Zight 2024-08-27 at 12.58.09 AM.jpg (137.48 KiB) Viewed 4542 times
Zight 2024-08-27 at 12.57.41 AM.jpg
Zight 2024-08-27 at 12.57.41 AM.jpg (38.73 KiB) Viewed 4542 times
Zight 2024-08-27 at 1.18.15 AM.jpg
Zight 2024-08-27 at 1.18.15 AM.jpg (291.21 KiB) Viewed 4542 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 »

After a manual update you will need to restart the dbagent for it to replace script. Script version should be 1.0.0.22



Here are some of the changes in the new script version.

Screenshot 2024-08-27 095712.png
Screenshot 2024-08-27 095712.png (106.85 KiB) Viewed 4532 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 »

Just as a side note.

Deploy Sources script does not remove other sources other than testing to see if the current source name exists. If there is already a source with the same name, we will delete that source first before adding the new source.

So it is key to assign a priority that overrides any existing sources.

We are looking to add a feature to the source policy management area that sets a flag if you want the source policy to be exclusive. If so we will remove all sources from agent before applying the new source. This would always leave agent with just the source configured.

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

Re: Enable Agents Checkboxes not applying to EDF's

Post by bmartindcs »

Ok, after the script updated the source policy applied properly when I ran the Deploy Sources script.

However, I noticed that they then joined the "Reset Choco to default repo" group, which then triggered the script to reset the repo's on choco and wiped out the EDF's related to the source policy.

I disabled that script on the group temporarily, and redeployed the sources again and left them to sit to run the other normal scheduled stuff - the scanner, and the updating of packages. I checked my ProGet repo and there was no activity on it however.

---

Then secondly, after the Agent Scanning and Update Packages ran, I noticed the source policy box was empty now, but the "APM Sources Enabled" checkbox stayed checked. Unclear if that is supposed to be that way.

1Zight 2024-08-27 at 11.06.01 PM.jpg
1Zight 2024-08-27 at 11.06.01 PM.jpg (206.7 KiB) Viewed 4500 times
1Zight 2024-08-27 at 10.54.08 PM.jpg
1Zight 2024-08-27 at 10.54.08 PM.jpg (124.18 KiB) Viewed 4500 times
1Zight 2024-08-27 at 11.17.51 PM.jpg
1Zight 2024-08-27 at 11.17.51 PM.jpg (78.73 KiB) Viewed 4500 times

Post Reply

Return to “Automate Package Manager”