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 #967

Closed
pauby opened this issue Nov 14, 2022 · 4 comments · Fixed by #1042
Assignees
Labels
5 - Released The issue has been resolved, and released to the public for consumption Bug Issues where something has happened which was not expected or intended Customer Bug reported or feature requested by a licensed customer of Chocolatey
Milestone

Comments

@pauby
Copy link
Member

pauby commented Nov 14, 2022

NOTE: This issue is a duplicate of chocolatey/chocolatey-licensed-issues#327 - adding this here as it potentially needs fixed in multiple places.

What You Are Seeing?

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.

What is Expected?

It would help in 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.

How Did You Get This To Happen? (Steps to Reproduce)

  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

Related Tickets and Issues

@pauby pauby added Bug Issues where something has happened which was not expected or intended 0 - Backlog Issue is accepted, but is not ready to be worked on or not in current sprint labels Nov 14, 2022
@JPRuskin
Copy link
Member

JPRuskin commented Jan 29, 2024

@pauby We've another customer who's come across this issue. I've added a link to your list of tickets, above.

@ryanrichter94 ryanrichter94 added the Customer Bug reported or feature requested by a licensed customer of Chocolatey label Jan 29, 2024
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Apr 3, 2024
Chocolatey Agent runs Chocolatey CLI and reports the results back to
Chocolatey GUI. As a result, all of the messages come back as "Info"
messages. This adds handling to the GrabErrors method to check Info
messages for clues that they're actually `Error`, `Warning`, or `Fatal`
messages.
@corbob corbob self-assigned this Apr 3, 2024
@corbob corbob added the 2 - Working A user or team member has started working on the issue label Apr 3, 2024
@corbob corbob removed the 0 - Backlog Issue is accepted, but is not ready to be worked on or not in current sprint label Apr 3, 2024
@corbob corbob linked a pull request Apr 3, 2024 that will close this issue
10 tasks
@corbob corbob added 3 - Review Code has been added, and is available for review as a pull request and removed 2 - Working A user or team member has started working on the issue labels Apr 3, 2024
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Apr 3, 2024
Chocolatey Agent runs Chocolatey CLI and reports the results back to
Chocolatey GUI. As a result, all of the messages come back as "Info"
messages. This adds handling to the GrabErrors method to check Info
messages for clues that they're actually `Error`, `Warning`, or `Fatal`
messages.
@corbob
Copy link
Member

corbob commented Apr 4, 2024

I have put up a PR for this issue to handle that the messages coming from Chocolatey Agent are different than a normal Chocolatey installation. However, I encountered issue #998 which is that after one Install attempt, subsequent installs do not have any log information getting intercepted by Chocolatey GUI, and so failures do not have information to report to the user.

gep13 added a commit that referenced this issue Apr 5, 2024
@gep13 gep13 added 4 - Done Code has been added to the repository, and has been reviewed by a team member and removed 3 - Review Code has been added, and is available for review as a pull request labels Apr 5, 2024
@gep13
Copy link
Member

gep13 commented Apr 5, 2024

@corbob thanks for digging into this, and fixing up the problem!

@gep13 gep13 closed this as completed Apr 5, 2024
@gep13 gep13 added this to the 2.1.1 milestone Apr 22, 2024
corbob added a commit that referenced this issue Apr 29, 2024
* hotfix/2.1.1:
  (build) Switch to a PowerShell step
  (maint) synced local '.templates/' with remote '.github/GitReleaseManager/.templates/'
  (build) Bump Recipe package to latest version
  (maint) Remove unnecessary whitespace
  (#996) Create config directory if it doesn't exist
  (maint) Remove unused pragmas
  (#967) Parse Info for Error, Warn, and Fatal
@corbob corbob changed the title Chocolatey GUI Not Displaying Error Output When Running as Non-Admin Through Background Service Chocolatey GUI not displaying error output when running as non-admin through Background Service Apr 29, 2024
@corbob corbob added 5 - Released The issue has been resolved, and released to the public for consumption and removed 4 - Done Code has been added to the repository, and has been reviewed by a team member labels Apr 29, 2024
@corbob
Copy link
Member

corbob commented Apr 29, 2024

🎉 This issue has been resolved in version 2.1.1 🎉

The release is available on:

Your GitReleaseManager bot 📦 🚀

corbob added a commit that referenced this issue Apr 29, 2024
* master:
  (build) Switch to a PowerShell step
  (maint) synced local '.templates/' with remote '.github/GitReleaseManager/.templates/'
  (build) Bump Recipe package to latest version
  (maint) Remove unnecessary whitespace
  (#996) Create config directory if it doesn't exist
  (maint) Remove unused pragmas
  (#967) Parse Info for Error, Warn, and Fatal
  (maint) Remove mention of services no longer used
  (tests) Update Pester tests to be consistent
  (tests) Move the Pester tests to be consistent
  (maint) synced local '.templates/' with remote '.github/GitReleaseManager/.templates/'
  (maint) Update GRM configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released The issue has been resolved, and released to the public for consumption Bug Issues where something has happened which was not expected or intended Customer Bug reported or feature requested by a licensed customer of Chocolatey
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants