Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Support and questions for using and managing Chocolatey NuGet inside of Labtech
aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

C:\ProgramData\chocolatey\lib\DotNet3.5 never showed up during the auto-install cycle. I verified I can manually push the 7-zip package to the PC and it installs correctly, but when the auto-install cycle runs it never shows up in the C:\ProgramData\chocolatey\lib\ folder either. We have other programs (Google, Adobe Reader) also set to auto-install and they are not showing up in the C:\ProgramData\chocolatey\lib\ as well.

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

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by Cubert »

On one agent fully uninstall Chocolatey framework and then push a Chocolatey install from plugin again. See if that resets the permissions and allows packages to install.

aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

I did that, and we're still getting the same permissions errors when the plug-in tries to do the auto-install during its bi-hourly cycle.

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

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by Cubert »

I wonder if passing "--use-system-powershell" along with package name would resolve your issue?

Are you able to try this on an agent that has issue?


So in your package approval area type in "package name --use-system-powershell" instead of package name by its self. Then have it attempt a install of that package.

aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

I'm no longer getting "Failed to log in user" in my script logs and they show it is downloading the package to the PC, but the log file on the PC shows failure:

2021-03-12 14:09:16,504 520 [INFO ] - [NuGet] Installing 'adobe-acrobat-standard 17.11.30156'.
2021-03-12 14:09:16,520 520 [ERROR] - adobe-acrobat-standard not installed. An error occurred during installation:
Access to the path 'C:\ProgramData\chocolatey\lib\adobe-acrobat-standard\tools' is denied.
2021-03-12 14:09:16,520 520 [INFO ] - adobe-acrobat-standard package files install completed. Performing other installation steps.
2021-03-12 14:09:16,520 520 [DEBUG] - No package information as package is null.
2021-03-12 14:09:16,536 520 [DEBUG] - No package information to save as package is null.
2021-03-12 14:09:16,536 520 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2021-03-12 14:09:16,536 520 [ERROR] - The install of adobe-acrobat-standard was NOT successful.
2021-03-12 14:09:16,551 520 [ERROR] - adobe-acrobat-standard not installed. An error occurred during installation:
Access to the path 'C:\ProgramData\chocolatey\lib\adobe-acrobat-standard\tools' is denied.
2021-03-12 14:09:16,551 520 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bad".
2021-03-12 14:09:16,551 520 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
Error converted to warning:
Access to the path 'C:\ProgramData\chocolatey\lib-bad' is denied.
2021-03-12 14:09:16,863 520 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
Error converted to warning:

aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

Also, the script logs in Automate are showing the installer is still not running from an elevated command shell:

"Chocolatey v0.10.15
Chocolatey detected you are not running from an elevated command shell
(cmd/powershell).

You may experience errors - many functions/packages
require admin rights. Only advanced users should run choco w/out an
elevated shell. When you open the command shell, you should ensure
that you do so with "Run as Administrator" selected. If you are
attempting to use Chocolatey in a non-administrator setting, you
must select a different location other than the default install
location. See
https://chocolatey.org/install#non-admi ... ve-install for details."

aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

In this log where it says "Failed to Login as User", what user is it talking about?

The Script(6409) was successful in the Then section.

Script: S6409 - Starting at Server Time: Thursday, March 18, 2021 4:08:36 PM
IF F5 ValueOne (P1): APPCMD Comparer (P2): 3 ValueTwo (P3): T: 0.7426084
L1 F20 SetType(P1):1 Parameter(P2):0 VariableName(P3):TICKETING T: 0.7426084
L2 F172 SqlStatement (P1): 'Select count(ClientID) FROM plugin_sw_chocolateyii_client_config where ClientID = '55' and...' T: 0.7426084
L3 F20 SetType(P1):1 Parameter(P2):0 VariableName(P3):TICKETING T: 0.758206
L4 F70 Value (P1): TICKETING Comparer (P2): 2 To (P3): 1 Jump (P4): :STARTTICKET T: 0.758206
L5 F139 Note (P1): :CONTINUE T: 0.758206
L6 F114 File (P1): 'C:\ProgramData\chocolatey\choc...' Check (P2): 0 Jump (P3): :PROGRAMDATA T: 0.7738063
L9 F139 Note (P1): :PROGRAMDATA T: 9.5019409
L10 F126 T: 9.5029385
L11 F29 Message (P1): Failed to Login as User T: 27.5764607
L12 F54 T: 27.5764607
L13 F129 Jump (P1): T: 41.5881029

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

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by Cubert »

Thats a good question,

It says line 11, here is line 11 for both the then and else statements. What's your script look like here?


Capture.PNG
Capture.PNG (61.19 KiB) Viewed 7625 times
in script.

aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

Line 11 of Then:
SHELL: @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object system.net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin and save results to @ChocoResults@

Line 11 of Else:
Exit Script

aaroncampbell72
Posts: 33
Joined: Tue Mar 24, 2020 6:59 pm
4

Re: Auto-Install failing. "Access to the path 'C:\ProgramData\chocolatey\lib\"

Post by aaroncampbell72 »

I set the execution policy on the test PC to "Bypass" and I updated the Plugin script to "run as admin" but we're still getting "Failed to Login as User" being logged in LabTech (Manage).

Post Reply

Return to “Chocolatey For Labtech”