chocolatey / chocolatey-licensed-issues

Issues for Licensed Editions of Chocolatey
19 stars 13 forks source link

An unsupported argument is passed to the Chocolatey Agent when using the API #380

Closed sync-by-unito[bot] closed 4 months ago

sync-by-unito[bot] commented 4 months ago

What You Are Seeing?

When logged in as a standard user and trying to install a package using background mode, the install fails due to attempting to pass newly restricted options in Chocolatey Agent and Chocolatey Licensed Extension. This occurs when using Chocolatey GUI, with or without the Chocolatey GUI Licensed Extension, but in a regular (non-admin) PowerShell session it does not.

What is Expected?

Packages should be installed through Chocolatey GUI background mode without automatically passing the newly restricted options set in the Chocolatey Licensed Extension and Chocolatey Agent.

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

  1. Install Chocolatey, Chocolatey Licensed Extension, Chocolatey Agent, Chocolatey GUI (and Chocolatey GUI Licensed Extension but this isn't required)
  2. Configure background service with defaults from Quick Start Guide:
  1. Define source(s) for use with Self Service (I used ChocolateyInternal repository from Quick Start Guide and the CCR)
  2. Open Chocolatey GUI as a standard user
  3. Attempt to install package with either Install button or Install Advanced button

NOTE: Clicking the Install button fails the installation but the Error field is blank. Clicking the Install Advanced button fails the installation and provides the error output under Additional Details.

System Details

Output Log

chocolatey-agent.log

~~~sh // 2024-02-14 12:04:29,895 9 [WARN ] - User 'Fred' attempted to use an option that cannot be used with Self-Service. Command passed: [C:\ProgramData\chocolatey\choco.exe install greenshot --accept-license --execution-timeout="'14400'" --version="'1.2.10.6'" --ignore-package-exit-codes --use-download-cache --skip-virus-check] ~~~

ChocolateyGui.20240214.log

~~~sh // 2024-02-14 12:04:29.758 -05:00 [Information] --- start of agent --- 2024-02-14 12:04:29.896 -05:00 [Fatal] Usage of invalid option detected when running Self-Service. Invalid options are `--cache-location`, `--install-arguments`, `--not-silent`, `--install-args-global`, `install-arguments-sensitive`, `install-directory`, 'allow-empty-checksums', 'allow-empty-checksums-secure', 'download-checksum', 'download-checksum-x64', 'from-programs-and-features', 'ignore-checksums', 'override-arguments', 'proxy', 'proxy-bypass-list', 'proxy-bypass-on-local', 'skip-virus-check', 'uninstall-arguments', 'uninstall-arguments-sensitive', 'use-system-powershell', and 'virus-positives-minimum'. Please remove the option and try again. 2024-02-14 12:04:29.898 -05:00 [Information] --- end of agent --- ~~~

Additional Details

image

Workarounds

Install through a standard PowerShell session with commands or install as admin.

Proposed Solution

Related Issues and Tickets

Zendesk Ticket 21210

Done Checklist

┆Issue is synchronized with this Gitlab issue by Unito