Habitat 3rd party application manager not working

Support forums for the Habitat Automate plugin
User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat 3rd party application manager not working

Post by Cubert »

No problems, I have the same issues from time to time. Take as long as you need.


OK,

Have a quick read over the following support doc for Application Manager

viewtopic.php?t=5891

I just updated it to include the latest screenshot of client console and added in the new info about caching, standalone and normal agent switches.


In your particular issue you want to look at the bottom where it says
"To Cache or Not to Cache"

In this section it describes setting up the cache and how it works. You will find out how to set cache and where the location of that cache should be. Once you have your locations and cache share location from the location consoles you can then look at that cache to see what versions are there, what the last file dates where and if needed dump the files and see if caching agents replaces them.

If so it would be getting files directly from Chocolatey public repo so they would be as fresh as possible. Then see what the APP manager reports as current version (after 24 hours as version states are staged over 24 hours periods.)

Once you have a know good cache then watch for that to make it out to all the agents. If agents are not updating then you can look at the command logs for the agent in the agents console during the maintenance run of the Habitat Application script .

It should log failures in script log and command outputs can be seen in commands log for the same time stamps.

eurgello
Posts: 20
Joined: Thu May 26, 2022 4:02 pm
1

Re: Habitat 3rd party application manager not working

Post by eurgello »

Thank you for all the help on this.

I've found that we had a caching agent assigned but the share folder for the cache wasn't setup. I've set that up and have changed schedule to daily so I can check on the progress on Monday.

Would it cause an issue if a caching agent was setup but then that WS was offline? Or would the other agents just continue to get the updates through either the cache folder(if it has been setup) or directly from chocolatey?

Also, any way for us to not enable servers but still set a server to be a caching agent?

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat 3rd party application manager not working

Post by Cubert »

In a caching setup,

Normal agents will continue to use cache if the caching agent is offline. Just the cache and cache versioning will not update until caching agent is able to run successfully.

Stand Alone agents will always work but maybe subject to throttles or bands if repository is over worked from a single location.

If the share for cache is offline then the agents will fail out during the updates with logs that cache was not available.

eurgello
Posts: 20
Joined: Thu May 26, 2022 4:02 pm
1

Re: Habitat 3rd party application manager not working

Post by eurgello »

Thanks for this. I just checked and what's weird is that the caching agent's apps got updated but the cache folder I setup is showing as blank. I have the cache folder set on a server and servers aren't enabled on Habitat Application Manager, would that be the cause of this?

Or could it be that we have a domain and the cache agent we use is not joined to the domain? If that is so, how can I have the current agent not be set as the caching agent? As I want to try out if the agents are able to update directly from the community repo.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat 3rd party application manager not working

Post by Cubert »

Thanks for this. I just checked and what's weird is that the caching agent's apps got updated but the cache folder I setup is showing as blank.
This is caused when the caching agent permissions or network is preventing it from accessing the share provided for the location. So the caching agent downloads the packages but can not push them to network share. It uses those packages for its own updates but all other agents see a blank directory for updates.

Server does not need to be enable to be used as a share. Only the caching agent needs to be available and enabled for caching systems to function.

Check your permissions , We use POSH to access the network shares. Here is an example code snipplet that you can modify to test access to network shares from any agent.

To test Network shares access permissions from any agent.

The below code will copy the Chocolatey Installer script to the local agents c:\windows\ltsvc\Habitat\packages directory. Then tests package and returns True or False if successful. Script assumes that files exist on share and that local directory is available on agent. You must run this in a POSH ISE terminal as Administrator. The reason is that on the agent C:\windows\ltsvc is a protected directory and you can not write files as a standard user to this directory. Edit code and set directories to c:\temp\ if you want to run script as normal user.

Code: Select all

$locationdrive = '\\myserver\myshare'
$cacheuser = 'myUser'
$cachepass = 'myPassword'
net use $locationdrive /user:$cacheuser $cachepass
Copy-Item $locationdrive\Habitat\packages\install.ps1 -Destination c:\windows\ltsvc\Habitat\packages\install.ps1 -PassThru
Test-Path c:\windows\ltsvc\Habitat\packages\install.ps1


When you can execute the code above successfully on agent then agents permissions on network share will be correct to allow access.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat 3rd party application manager not working

Post by Cubert »

If you are on version 1.0.1.26 then you should have a "Set to Normal" menu item available to you on the agent menus. This will remove the caching agent duties from an agent. You can also select a different agent at same location and it will take over and auto remove the original agent from this duty.

So 2 ways to change or remove caching agent.




Screenshot 2022-06-28 095128.PNG.jpg
Screenshot 2022-06-28 095128.PNG.jpg (97.37 KiB) Viewed 5019 times

eurgello
Posts: 20
Joined: Thu May 26, 2022 4:02 pm
1

Re: Habitat 3rd party application manager not working

Post by eurgello »

Thanks. We are still on version 24. I've enabled the servers and have made the server with the cache folder as the caching agent but the other is still showing as a caching agent even though they are on the same location?

As I don't think the non-domain WS is able to access it. I just ran the commands you provided and there wasn't a response. Tried to remotely access the shared folder through there but still failed.

I will update again once I confirm if still getting an issue with the caching agent that is the server.

eurgello
Posts: 20
Joined: Thu May 26, 2022 4:02 pm
1

Re: Habitat 3rd party application manager not working

Post by eurgello »

I just checked and even though script history for the Update Repo Cache shows as successful, I checked the cache folder I setup in the server and configured in Automate, and it still doesn't have any of the app packages. I don't think it is the permissions as I have confirmed that the account is correct as well as the share folder location.

Also, the previous caching agent still shows that it is so there are 2 caching agents now. For now, I've set it as a stand alone agent.
Attachments
5.jpg
5.jpg (4.47 KiB) Viewed 5011 times
4.jpg
4.jpg (27.48 KiB) Viewed 5011 times
3.jpg
3.jpg (51.63 KiB) Viewed 5011 times
2.jpg
2.jpg (17.88 KiB) Viewed 5011 times
1.jpg
1.jpg (209.51 KiB) Viewed 5011 times

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat 3rd party application manager not working

Post by Cubert »

in the cache root should be a folder called habitat with a sub folder called packages


\\dc1\cache\habitat\packages\packagename.xyz


all packages should end up here as a result. The script should attempt to create this directory on cache so I wonder why it would not of failed out there first?

Folder does not exist?

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Habitat 3rd party application manager not working

Post by Cubert »

as for changing agents, get updated to 1.0.1.26 and that feature will present itself in menu.

Post Reply

Return to “Habitat”