Skip to content

Need better error message when the chocolatey agent is not running #1093

@opoplawski

Description

@opoplawski

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When trying to upgrade a package as a normal user via the agent / self-service feature I got the error in the attached image.

Image

The problem turned out to be that the agent was not running - but the GUI output gave no indication of that.

What is Expected?

The choco cli reported:

[Background] Chocolatey is configured for background service, but there is no
 background service available and running. Please ensure you have
 installed the service - 'choco install chocolatey-agent' (or upgraded
 to at least 0.5.0 - earlier versions are not compatible). If you have
 mistakenly turned on the background service, please run
 'choco feature disable -n useBackgroundService'.
 There was no endpoint listening at net.pipe://localhost/ChocolateyAgentService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

If that had been displayed it would have been apparent what the issue was.

How Did You Get This To Happen?

  1. Stop the chocolatey agent
  2. run chocolatey gui as normal user
  3. try to do a package operation

System Details

  • Operating System: 10.0.26100.0
  • Windows PowerShell version:5.1.26100.6584
  • Chocolatey CLI Version:2.5.1
  • Chocolatey Licensed Extension version:chocolatey.extension 6.3.1
  • Chocolatey License type:Business
  • Terminal/Emulator:

Installed Packages

Chocolatey v2.5.1 Business
7zip.install 25.1.0
adobereader 2025.1.20577
airtame 4.12.0
choco-cleaner 1.1.1
chocolatey 2.5.1
chocolatey.extension 6.3.1
chocolatey-agent 2.3.0
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-dotnetfx.extension 1.0.1
chocolateygui 2.1.1
chocolateygui.extension 2.0.0
chocolatey-license 2026.9.4
chocolatey-windowsupdate.extension 1.0.5
cmake.install 4.1.1
DotNet4.5 4.5.20120822
dotnetfx 4.8.1.20250219-rtw
Firefox 142.0.1
git.install 2.51.0
GoogleChrome 140.0.7339.81
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
KB3118401 1.0.5
keepass.install 2.59.0
microsoft-teams.install 1.8.0.21151
miniconda3 4.12.0
netfx-4.8 4.8.0.20220524
nxlog 3.2.2329
openssl 3.5.2
powershell-core 7.5.2
putty-cac 0.83.0.1
slack 4.46.96
thunderbird 142.0.0
ungoogled-chromium 137.0.7151.681
vcredist140 14.44.35211
vcredist2015 14.0.24215.20170201
Wget 1.21.4
winlogbeat-oss 7.12.1
wireshark 4.4.9
yubico-authenticator 7.2.3
yubikey-manager 1.2.6
zoom 6.5.12.14128

Output Log

2025-09-10 15:45:07,514 11736 [DEBUG] - Running beforeModify step for 'slack'
2025-09-10 15:45:07,523 11736 [DEBUG] - Backing up package files for 'slack'
2025-09-10 15:45:07,641 11736 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bkp\slack".
2025-09-10 15:45:07,645 11736 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib-bkp\slack' is denied.
2025-09-10 15:45:07,948 11736 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib-bkp\slack' is denied.
2025-09-10 15:45:08,360 11736 [ERROR] - Maximum tries of 3 reached. Throwing error.
2025-09-10 15:45:08,377 11736 [ERROR] - Cannot create directory "C:\ProgramData\chocolatey\lib-bkp\slack". Error was:
System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\lib-bkp\slack' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.<>c__DisplayClass63_0.<CreateDirectory>b__1()
   at chocolatey.infrastructure.tolerance.FaultTolerance.<>c__DisplayClass1_0.<Retry>b__0()
   at chocolatey.infrastructure.tolerance.FaultTolerance.Retry[T](Int32 numberOfTries, Func`1 function, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.tolerance.FaultTolerance.Retry(Int32 numberOfTries, Action action, Int32 waitDurationMilliseconds, Int32 increaseRetryByMilliseconds, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.CreateDirectory(String directoryPath, Boolean isSilent)
   at chocolatey.infrastructure.filesystem.DotNetFileSystem.EnsureDirectoryExists(String directoryPath, Boolean ignoreError, Boolean isSilent)
2025-09-10 15:45:08,382 11736 [ERROR] - Failed to run backup or beforeModify steps for package 'slack': Access to the path 'C:\ProgramData\chocolatey\lib-bkp\slack' is denied.
2025-09-10 15:45:08,386 11736 [DEBUG] - Ensuring removal of installation files.
2025-09-10 15:45:08,389 11736 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\slack\slack.nupkg'
  with checksum '0D3B6881E0D9AD60C27DB953B55C3826AB517570DFCD95485A86483C9E527580'
2025-09-10 15:45:08,392 11736 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\slack\slack.nuspec'
  with checksum 'FFE11407DEB9E70EB25FCDCCF0273476A279D2A6E5E62D46EB3F8CFDB1EE22FD'
2025-09-10 15:45:08,397 11736 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\slack\slack.nuspec".
2025-09-10 15:45:08,399 11736 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\slack.nuspec' is denied.
2025-09-10 15:45:08,702 11736 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\slack.nuspec' is denied.
2025-09-10 15:45:09,110 11736 [ERROR] - Maximum tries of 3 reached. Throwing error.
2025-09-10 15:45:09,131 11736 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\slack\tools\chocolateyInstall.ps1'
  with checksum 'B46C8016EC63D565649D4107042E66F8AF451A1A2060C287B03E912CCA638B7A'
2025-09-10 15:45:09,137 11736 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\slack\tools\chocolateyInstall.ps1".
2025-09-10 15:45:09,143 11736 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\tools\chocolateyInstall.ps1' is denied.
2025-09-10 15:45:09,451 11736 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\tools\chocolateyInstall.ps1' is denied.
2025-09-10 15:45:09,859 11736 [ERROR] - Maximum tries of 3 reached. Throwing error.
2025-09-10 15:45:09,868 11736 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\slack\tools\files\slack-standalone-4.45.69.0.msi.ignore'
  with checksum 'F1945CD6C19E56B3C1C78943EF5EC18116907A4CA1EFC40A57D48AB1DB7ADFC5'
2025-09-10 15:45:09,874 11736 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\slack\tools\files\slack-standalone-4.45.69.0.msi.ignore".
2025-09-10 15:45:09,880 11736 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\tools\files\slack-standalone-4.45.69.0.msi.ignore' is denied.
2025-09-10 15:45:10,188 11736 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\tools\files\slack-standalone-4.45.69.0.msi.ignore' is denied.
2025-09-10 15:45:10,596 11736 [ERROR] - Maximum tries of 3 reached. Throwing error.
2025-09-10 15:45:10,607 11736 [WARN ] - Unable to remove existing package prior to upgrade:
 One or more errors occurred.
2025-09-10 15:45:10,622 11736 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\.chocolateyPending' is denied.
2025-09-10 15:45:10,927 11736 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\.chocolateyPending' is denied.
2025-09-10 15:45:11,335 11736 [ERROR] - Maximum tries of 3 reached. Throwing error.
2025-09-10 15:45:11,343 11736 [ERROR] - slack not upgraded. An error occurred during installation:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\.chocolateyPending' is denied.
2025-09-10 15:45:11,352 11736 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\.chocolateyPending' is denied.
2025-09-10 15:45:11,665 11736 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 Access to the path 'C:\ProgramData\chocolatey\lib\slack\.chocolateyPending' is denied.
2025-09-10 15:45:12,075 11736 [ERROR] - Maximum tries of 3 reached. Throwing error.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues where something has happened which was not expected or intended.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions