Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chocolatey GUI Not Displaying Error Output When Running as Non-Admin Through Background Service #327

Open
sync-by-unito bot opened this issue Nov 8, 2022 · 0 comments
Labels
0 - Backlog Where tickets start after being triaged. This means the ticket has targeted milestone/labels. Bug Tickets that represent defects/bugs. LicensedExtension Issues affecting the Chocolatey Licensed Extension (chocolatey.extension)

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Nov 8, 2022

Is Your Feature Request Related To A Problem? Please describe.

When installing a package through Chocolatey GUI. With the background service enabled and logged into the PC as a non-admin user. Chocolatey GUI says their is an error but does not give you the full content of the error message.

Describe The Solution. Why is it needed?

This would help in easier troubleshooting if the full error was emitted within Chocolatey GUI instead of having to dig into the chocolatey log to ascertain the contents of the actual error that occurred.

Steps to Reproduce Behavior

  1. Run choco new throw-message --version 1.0.0
  2. Edit the chocolateyinstall.ps1 file of the package to contain the following code
$ErrorActionPreference = 'Stop'; # stop on all errors
throw "Fails check immediately"
  1. Compile the package using choco pack against the .nuspec file to generate the throw-message.1.0.0.nupkg
  2. Add where this file lives as a local source. In my case i did the following choco source add -n Local -s C:\temp --allow-self-service the self-service will be needed for non-admin testing of the package.
  3. Ensure you have the Background Service feature enabled choco feature enable -n useBackgroundService, the chocolatey-agent package installed, and the useBackgroundServiceWithNonAdministratorsOnly feature enabled.
  4. Logged in as an administrative user to the PC, run choco install throw-message -y. You should get the following output:
    image
  5. Open chocolateygui. Logged in as that same admin user to the PC. Attempt to install the throw-message package. You should get the following output:
    image
  6. Now log into the PC as a non-admin user.
  7. Open powershell and run the same choco install throw-message -y now being logged in to the PC as a non-admin user. The output from this:
    image
  8. Open chocolateygui while logged into the PC as the non-admin user and attempt to install the throw-message package. the output from this:
    image

As you can see the GUI output from the 2 users is different. One shows the complete error where as the non-admin does not. Also if you look into the CLI output more you can notice the admin user's is highlighted red to indicate an error. Where the non-admin's same output is in white text, usually indicating standard/info output.

Reproduction Enviornment

OS Version: Windows 10 V 10.0.19045.0 Powershell Version: 5.1.19041.1682 Chocolatey Version: 1.1.0

Choco list -lo output from system:

chocolatey 1.1.0
chocolatey-agent 1.1.1
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-dotnetfx.extension 1.0.1
chocolatey-misc-helpers.extension 0.0.4
chocolatey-windowsupdate.extension 1.0.5
chocolatey.extension 4.2.0
chocolateygui 1.1.0
chocolateygui.extension 1.0.1
DotNet4.5.2 4.5.2.20140902
dotnetfx 4.8.0.20220524
GoogleChrome 107.0.5304.88
KB2919355 1.0.20160915
KB2919442 1.0.20160915
KB2999226 1.0.20181019
KB3033929 1.0.5
KB3035131 1.0.3
microsoft-windows-terminal 1.15.2874.0
notepadplusplus 8.4.5
notepadplusplus.install 8.4.5
vcredist140 14.32.31332
vcredist2015 14.0.24215.20170201
vscode 1.72.2
vscode.install 1.72.2

Additional Context.

Related Issues

┆Issue is synchronized with this Gitlab issue by Unito

@sync-by-unito sync-by-unito bot added 0 - Backlog Where tickets start after being triaged. This means the ticket has targeted milestone/labels. Bug Tickets that represent defects/bugs. LicensedExtension Issues affecting the Chocolatey Licensed Extension (chocolatey.extension) labels Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog Where tickets start after being triaged. This means the ticket has targeted milestone/labels. Bug Tickets that represent defects/bugs. LicensedExtension Issues affecting the Chocolatey Licensed Extension (chocolatey.extension)
Projects
None yet
Development

No branches or pull requests

0 participants