When a license is updated, the licensed feed is re-enabled
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
### What You Are Seeing?
If a user disables the Licensed feed (`choco source disable -n chocolatey.licensed`), and updates their license, the feed gets re-enabled.
### What is Expected?
The feed should stay disabled.
### How Did You Get This To Happen? (Steps to Reproduce)
1. Install Chocolatey License
2. Disable Licensed Feed (`choco source disable -n chocolatey.licensed`)
3. Update license
4. Run a chocolatey command (`choco` is sufficient)
5. Note that the licensed feed is re-enabled.

### Output Log
Below is the full unredacted log from `choco --trace --debug`. My guess is we'll want to look at what's happening when it says it's trying to replace the config file 🤷
Full Log Output
~~~sh
2022-06-07 09:50:22,716 5128 [DEBUG] - XmlConfiguration is now operational
2022-06-07 09:50:22,732 5128 [DEBUG] - Evaluating license file found at 'C:\ProgramData\chocolatey\license\chocolatey.license.xml'
2022-06-07 09:50:22,779 5128 [ERROR] - A valid Chocolatey license was found, but the chocolatey.licensed.dll assembly could not be loaded:
Could not find file 'C:\ProgramData\chocolatey\extensions\chocolatey\chocolatey.licensed.dll'.
Ensure that the chocolatey.licensed.dll exists at the following path:
'C:\ProgramData\chocolatey\extensions\chocolatey\chocolatey.licensed.dll'
2022-06-07 09:50:22,795 5128 [WARN ] - To resolve this, install the Chocolatey Licensed Extension package with
`choco install chocolatey.extension`
2022-06-07 09:50:22,810 5128 [INFO ] - ============================================================
2022-06-07 09:50:22,951 5128 [DEBUG] - Attempting to replace "C:\ProgramData\chocolatey\config\chocolatey.config"
with "C:\ProgramData\chocolatey\config\chocolatey.config.5128.update".
Backup placed at "C:\ProgramData\chocolatey\config\chocolatey.config.backup".
2022-06-07 09:50:22,951 5128 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.backup".
2022-06-07 09:50:22,966 5128 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\config\chocolatey.config.5128.update"
to "C:\ProgramData\chocolatey\config\chocolatey.config".
2022-06-07 09:50:22,966 5128 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.5128.update".
2022-06-07 09:50:22,966 5128 [INFO ] - Chocolatey v1.1.0 Business
2022-06-07 09:50:22,982 5128:1 [DEBUG] - Chocolatey is running on Windows v 10.0.19043.0 - :Main:0
2022-06-07 09:50:22,998 5128:1 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old". - :delete_file:0
2022-06-07 09:50:22,998 5128:1 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old". - :delete_file:0
2022-06-07 09:50:23,013 5128:1 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" --trace --debug - :run:0
2022-06-07 09:50:23,013 5128:1 [DEBUG] - Received arguments: --trace --debug - :run:0
2022-06-07 09:50:23,076 5128:1 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage. - :run:0
2022-06-07 09:50:23,076 5128:1 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers... - :publish:0
2022-06-07 09:50:23,076 5128:1 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed... - :handle_message:0
2022-06-07 09:50:23,123 5128:1 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers... - :publish:0
2022-06-07 09:50:23,138 5128:1 [DEBUG] - Exiting with 1 - :Main:0
~~~
Contributor guide
Research direction
Start by tracing the license-update path and the replacement of C:\ProgramData\chocolatey\config\chocolatey.config described in the trace. Reproduce the steps with `choco source disable -n chocolatey.licensed`, update the license, and run `choco`; done means the chocolatey.licensed feed remains disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100