Framework not installing

Support and questions for using and managing Chocolatey NuGet inside of Labtech
mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Framework not installing

Post by mmoyse »

The maintenance script runs the Powershell which results in

Code: Select all

WARNING: An existing Chocolatey installation was detected. Installation will not continue.
For security reasons, this script will not overwrite existing installations.
Please use choco upgrade chocolatey to handle upgrades of Chocolatey itself.
However when the script then checks for the presence of choco.exe it can't find it

Code: Select all

Chocolatey EXE not found- Install failed
The script then gives up and exits.

Any subsequent attempts to install apps fail with choco.exe not being found.

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

Re: Framework not installing

Post by Cubert »

Can you verify where the Choco.exe is located on that agent. Unless something has changed the default directory for Choco.exe should be (C:\ProgramData\chocolatey)

mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Re: Framework not installing

Post by mmoyse »

The folder "C:\ProgramData\chocolatey" is empty apart from an empty folder called "lib"

I guess the Chocolatey script sees the folder and assumes it's all OK but your script looks for the .exe

Just confirmed that theory. I ran the Chocolatey default install script and got the same error that it was already installed.
I removed C:\ProgramData\chocolatey and ran the script again and choco.exe is now there.

Seems that there needs to be another test, if "C:\ProgramData\chocolatey" exists but choco.exe doesn't, then delete the directory and try again.

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

Re: Framework not installing

Post by Cubert »

I can add in a test like that if needed...

mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Re: Framework not installing

Post by mmoyse »

Looks to me like it is needed!

I'm in the process of writing an Automate script to do this but if the plugin can be made more robust and self healing then that would be the sensible option.

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

Re: Framework not installing

Post by Cubert »

I will be happy to put in a test like this, might need to link it to a on / off switch so you can chooses whether or not it removes directory. There could be things in that directory that may be blown away that shouldn't be. Like in the BIN directory it likes to store portable apps.

See image, 7Zip is there along with several others I have on my install list. By blowing away this root directory the end user will loose those files as well. So adding a control that will toggle this feature on and off would be in the interest of the MSP.

Mesa thinks...

Capture.PNG
Capture.PNG (34.69 KiB) Viewed 3991 times

mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Re: Framework not installing

Post by mmoyse »

That's a pain then. If choco.exe goes walkabout, the Chocolatey script won't fix it and none of the apps will ever update!

Are you *sure* that's where portable apps go? I've not got any portable apps but I do have 7zip in there but 7zip itself is installed in C:\Program Files\7-Zip.

<Later> Looks like they are shims

https://docs.chocolatey.org/en-us/features/shim

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

Re: Framework not installing

Post by Cubert »

Doh, I knew about shims.. just didn't connect when I went looking into deleting cause and effect would be. You absolutely correct, these are just simlinks placed here to keep from adding a bunch of installs to the $PATH variable. That maybe a effect that some of these apps may loose the ability to be called from command line indirectly. Not that's a big game changer but may cause other scripts and such that you created that call (7zip.exe instead of C:\someSubsetOfDirectories\7zip.exe) to suddenly fail until Choco is reinstalled and managing apps again.

mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Re: Framework not installing

Post by mmoyse »

OK, just found another one with the same empty structure and failing to install Chocolatey. There's around 200 machines on a site I'm trying to roll this out on now with around 70 that are failing and I'm having to go through them manually now to determine why.

I deleted the empty structure and asked the plugin to install the app, I sort of expected it to realise that the framework wasn't there and to run the maintenance script to install but it didn't.

Feature request anyone?

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

Re: Framework not installing

Post by Cubert »

We have released build 3.0.0.43 today which does several things including possible fixes for items in this post. I will be posting this in several of the C4A posts currently active as this update has several fixes in it.


We have added in a new control variable to assist in setting the Excessive Running Commands test when running automation to do framework installs, App installs and App update. To view the properties for C4A run the following SQL

Code: Select all

SELECT * FROM plugin_p4l_chocolatey_properties;
Should Produce the following:

Capture.PNG
Capture.PNG (6.3 KiB) Viewed 3955 times

The setting is called EXCESSIVECMDS with a default value of 3. To adjust value run the following SQL command

Code: Select all

REPLACE INTO plugin_p4l_chocolatey_properties(`Name`,`Value`) Values('EXCESSIVECMDS','5');
This will set the EXCESSIVECMDS value to 5. You can set it any where from 0 to 99 but 99 would be really excessive!

You will now see the Automation log on the Automate server reporting when skipping agents who exceed the excessive commands setting.
Skipping applications installs for agentID [JTI-W10PC02] To many commands currently running [5]:::

We have also added to the Automation Script functions for framework installs that if we are in a install event to remove any old Chocolatey directory before install attempt. Should help reduce install failures do to remints of elder installs of chocolatey.

We have added to the Automation Script functions for App installs and App Updates a loop sleeper which slows down the install and or updates of multiple applications to help in preventing public repo lockout for excessive connections from location. We added a control in the Global Manager to set the number of seconds the script is to sleep between every (5) application installs or updates. This control changes the LOOPSLEEPCOUNT property value in the "plugin_p4l_chocolatey_properties" table.


This is the first half of major update set to improve application delivery when on the public repo. Anyone using private repos or using Chocolatey licensing will not be affected by public repo lockouts.

The next update will be out soon and will be adding a new scheduling function and staggering of Automation across agents per Client which will further assist in preventing public repo lockout by staggering installs and updates across the agents of a client so not everyone attempts access to public repo at the same time. This will have a control setting to adjust as needed. The update will also allow for weekly and monthly updates instead of daily install and updates as an optional setting per client. The default Automation will still be daily.
Top

Post Reply

Return to “Chocolatey For Labtech”