Open pauby opened 3 months ago
This is caused by the permissions in the $env:ChocolateyInstall\logs
folder not having write permissions for non-admin users. There isn't anything we can around this. As the logs are continuing to grow, there is nothing being lost. When Chocolatey CLI is next run as an admin user, the logs will rotate as normal.
We should document this error, what it means, that it only happens at log rotation time, and that running once as admin user will resolve it for that rotation.
Checklist
What You Are Seeing?
When the Chocolatey logs reach their configured rotation size, non-admin users will receive a log4net error message:
log4net:ERROR RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile [C:\ProgramData\chocolatey\logs\chocolatey.log] already exists.
What is Expected?
Log file rotation to happen.
How Did You Get This To Happen?
chocolatey.log
andchoco.summary.log
files.choco list | Out-Null
(TheOut-Null
is to drop the standard output stream as it's not necessary for this.)ls c:\programdata\chocolatey\logs
) to see they're about 15 MBchoco.summary.1.log
andchocolatey.1.log
file that are ~15 MB in size.System Details
Installed Packages
Output Log
The logs do not contain anything about the log4net error. Just the list command that was run.
Additional Context
N/A