3rd Party Application Management

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

Re: 3rd Party Application Management

Post by Cubert »

I would test the actual agent to see what it launches when you use App.


The above version is what Chocolatey has installed or updated and the Software is what the last inventory returned to Automate.

You can execute on a command line the following

Code: Select all

choco list /local
And it will spit out the list and versions of all installed software it able to update. (I.E. it knows of the package on repo needed to manage app).

Sometimes some apps install outside of Windows Applications and Installs. Apps that are portable and apps designed not to do full installs.

A good example of this is on Chocolatey.org site.


Searching for Putty on the Chocolatey.org site returns several Putty packages. Some at different versions then others and some that are not installable but portable. Also check the repo for mention of installer. This will add some insurance that its going to report to Windows that its installed.
Capture.PNG
Capture.PNG (61.71 KiB) Viewed 1814 times

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

Re: 3rd Party Application Management

Post by Cubert »

P.s

You should now have Habitat build 1.0.1.15. Please have a look at the added extras in Application Manager.

dbitters
Posts: 58
Joined: Tue May 18, 2021 8:11 pm
2

Re: 3rd Party Application Management

Post by dbitters »

The issue with older versions being displayed in the installed application version list is a Chocolatey issue and not a Habitat issue. That's an issue that's been going on since the origination of chocolatey where the packages update the underlining software but it doesn't bother to update the application installation data. That's a massive annoyance that throws a huge wrench into auditing old application versions and applications showing up on audit reports which trigger audit failures. That's an issue that is plaguing my rollout trying to convince auditors that we are up to date on everything when the reports say we aren't.

I was hoping that Cubert could find a way around this, but that's essentially trying to find a workaround for a massive oversight caused by Chocolatey that has been going on for so many years and would be a monumental task. Whoever finds out how to fix that would get a gold star though.

lblokland
Posts: 32
Joined: Wed Nov 17, 2021 1:29 pm
2

Re: 3rd Party Application Management

Post by lblokland »

I have the newest version. And it looks like the script is filing the location drive with all packages except the chocolatey files....
So a new client machine that is trying to download it from the location drive fails with the following:

Can this be repaired, or am I doing anything wrong?

Cheers,
Leon

The Script(5932) failed in the Else section at step 35. The reason: Label not found: :FAILEDLOCALFILECOPY

Script: S5932 - Starting at Server Time: Friday, January 7, 2022 3:18:06 PM
IF F5 ValueOne (P1): MYCMD Comparer (P2): 2 ValueTwo (P3): AGENTSYNC T: 1.2501745
L2 F31 Control (P1): 1 T: 1.2501745
L3 F20 SetType(P1):1 Parameter(P2):'C:\ProgramData\chocolatey\choc...' VariableName(P3):CHOCOEXE T: 9.2782413
L4 F70 Value (P1): MYCMD Comparer (P2): 2 To (P3): INSTALLCHOCO Jump (P4): :INSTALLCHOCO T: 9.2782413
L11 F139 Note (P1): :INSTALLCHOCO T: 9.2782413
L12 F114 File (P1): 'C:\ProgramData\chocolatey\choc...' Check (P2): 0 Jump (P3): :CHOCOINSTALLSUCCESS T: 9.2782413
L13 F70 Value (P1): cachedir Comparer (P2): 2 To (P3): Jump (P4): :MISSINGCACHEINFO T: 11.2852429
L14 F70 Value (P1): cacheuser Comparer (P2): 2 To (P3): Jump (P4): :MISSINGCACHEINFO T: 11.2852429
L15 F154 Folder (P1): %ltsvcdir%\Habitat\packages T: 11.2852429
L16 F235 T: 13.2951413
L17 F70 Value (P1): INSTALLFILEAVAILABLE Comparer (P2): 8 To (P3): True Jump (P4): :STARTINSTALL T: 19.3196093
L18 F19 URL (P1): 'https://chocolatey.org/install...' LocalFile (P2): '%ltsvcdir%\Habitat\packages\in...' Wait (P3): 0 T: 19.3196093
L19 F235 T: 21.3198547
L20 F70 Value (P1): INSTALLFILEAVAILABLE Comparer (P2): 8 To (P3): False Jump (P4): :FAILNETWORKFILECOPY T: 25.3397968
L33 F139 Note (P1): :FAILNETWORKFILECOPY T: 25.3397968
L34 F29 Message (P1): 'Failed to copy chocolatey installer file to [\\SOL-S01\SiteCache], continue with local ins...' T: 25.3397968
L35 F114 File (P1): ''%ltsvcdir%\Habitat\packages\i...' Check (P2): 1 Jump (P3): :FAILEDLOCALFILECOPY T: 25.3397968
Failed to copy chocolatey installer file to [\\SOL-S01\SiteCache], continue with local install

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

Re: 3rd Party Application Management

Post by Cubert »

Ok so what happens is the agent checks the Cache folder to see if Choco install script is there. If not it downloads it from Chocolatey.org, installs the framework then attempts to copy the installer to the cache directory for the next agent to find.

Your error is Failed to copy chocolatey installer file to [\\SOL-S01\SiteCache], continue with local install
This means it was not able to access that share to place file there.

99% of the time this is a permissions issue with the share or the user account used to access it.

So what I would do is log on to agent and use file manager to browse that share and try to place a text file on share as user used in the share permissions settings. See if you can copy file freely or is you get permission denied.

lblokland
Posts: 32
Joined: Wed Nov 17, 2021 1:29 pm
2

Re: 3rd Party Application Management

Post by lblokland »

Yup, I did.
The agent that is setup as the cache agent is accessing that share just fine.
I also already logged on to the workstation I'm currently testing on with the service account that I have setup for location drive setup. With that user it's perfectly fine to access the share, and read and write files and folders.
So for that service account there is plenty of access.

lblokland
Posts: 32
Joined: Wed Nov 17, 2021 1:29 pm
2

Re: 3rd Party Application Management

Post by lblokland »

Waited a few days, but I'm still not able to install the framework on the agents
Error in the script log: Failed to copy chocolatey installer file to [\\SOL-S01\SiteCache], continue with local install

I have succesfully logged onto the machine with the domain service account created for that Site Cache share, and was able to read/write/delete folders and files ....

Maybe the script is using another account? Can we verify or verbose the steps what account is being sent over when the script is trying to access that share?

Cheers!

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

Re: 3rd Party Application Management

Post by Cubert »

Sure can!

Open the script

Capture1.PNG
Capture1.PNG (70.79 KiB) Viewed 1701 times


Use AGENTSYNC as the task, it will be the easiest to follow. Select DEBUG Script. Tes it says AGENT CACHE but that is not correct it will be AGENTSYNC.

Capture11.PNG
Capture11.PNG (66.1 KiB) Viewed 1701 times


Place AGENTSYNC (not AGENTCACHE) in the field below and select a online agent to run against.

Capture12.PNG
Capture12.PNG (14.99 KiB) Viewed 1701 times


Start the script running and monitor the side windows for the variables to show up. That will be what the script is using.

Capture13.PNG
Capture13.PNG (97.08 KiB) Viewed 1701 times

lblokland
Posts: 32
Joined: Wed Nov 17, 2021 1:29 pm
2

Re: 3rd Party Application Management

Post by lblokland »

OK, did the debug part..It sails at step 106, please see attachment, the output form the step as it is logged is as follows:

False
System error 1326 has occurred.

The user name or password is incorrect.

Test-Path : Access is denied
At C:\WINDOWS\system32\config\systemprofile\AppData\Local\14912a04a40c48b9bf6a11b26035f1d2.ps1:2 char:6
+ if(!(Test-Path -path '\\SOL-S01\SiteCache\Habitat\packages\')){New-It ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (\\SOL-S01\SiteCache\Habitat\packages\:String) [Test-Path], Unauthoriz
edAccessException
+ FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.TestPathCommand

New-Item : Access is denied
At C:\WINDOWS\system32\config\systemprofile\AppData\Local\14912a04a40c48b9bf6a11b26035f1d2.ps1:2 char:64
+ ... ackages\')){New-Item -ItemType directory -Path '\\SOL-S01\SiteCache\H ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (\\SOL-S01\SiteCache\Habitat\packages\:String) [New-Item], Unauthorize
dAccessException
+ FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.NewItemCommand


I tried to change the password to something simple (it had a lot of symbols in it) but that didn't help, same error.
After a few attempts the account is locked out in AD, so I'm 100% positive the user part is good.
Looking in the CWA database in the locations table, I can see the password for the location account is in clear text, and it is correct, so I'm also sure that it is correct in the database.
After the password change tried to logon to the agent again, and read,write and delete in the sitecache share. No problems here...
Something is going wrong with the password in that test script / step...

Can you help me out to run those test-path commands in powershell? I cannot find the commands that the script is using..

Thanks.
Attachments
error1.png
error1.png (68.73 KiB) Viewed 1691 times

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

Re: 3rd Party Application Management

Post by Cubert »

Here is your log and your problem... You are getting permission denied on the share. This is typical with domain environments where you are under privileged or the share is overly protected. Figure out what name and password combo your using.
+ CategoryInfo : PermissionDenied: (\\SOL-S01\SiteCache\Habitat\packages\:String) [Test-Path], Unauthoriz
edAccessException
+ FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.TestPathCommand

New-Item : Access is denied

Here is a good test to see if the username and pass you are using is good.

Copy the code below to a powershell ISE and edit the four main variables then execute to see if you get a (True) or (False) for the package name provided. If you get powershell errors then you are failing to connect to network share with that user. Adjust permissions as needed....

Code: Select all

#---edit these variables------
$username = "Myuser"
$password = "mypassword"
#--->location drive example \\192.168.1.12\myshare
$myLocationDrive = "YourLocationDriveHere"
$myPackage = "PlacePackageNameHere"

#--Stop Edits----------------------

net use $myLocationDrive /user:$username $password
Test-Path $myLocationDrive\Habitat\packages\$myPackage* -pathtype leaf

Post Reply

Return to “Habitat”