-
Notifications
You must be signed in to change notification settings - Fork 905
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
"commandExecutionTimeoutSeconds" always reverts to 2700 when deprecated config setting is 0 #1059
Comments
Also If we change the top key the value reflects globally |
Some discussion at #973 - closed as a duplicate. |
Great thing, @alex3305 has discovered what is causing this issue and has proposed a fix! So this is likely to be fixed for 0.10.4! Sit tight. |
Hey Rob, Glad to hear this, We are getting better! |
commandExecutionTimeoutSeconds was defined twice in the Chocolatey configuration. With this pull request, only the primary key is used. This fixes the incorrect behaviour that choco exhibited when changing this value through `choco config`. Closes chocolatey#1059 chocolatey#973 .
Sometime in Feb (or March) |
Okay, figured out exactly what causes this. <chocolatey xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- this is a deprecated setting, but it wreaks havoc in less than 0.10.4 when it is zero (which it is by default) -->
<commandExecutionTimeoutSeconds>0</commandExecutionTimeoutSeconds>
<config>
<!-- will always be 2700 when the above setting is 0 in less than v0.10.4 -->
<add key="commandExecutionTimeoutSeconds" value="2700" description="Default timeout for command execution." />
<!-- Other settings-->
</config>
<!-- Other settings-->
</chocolatey> When the top-level (deprecated)
WorkaroundAs a workaround, set the toplevel commandExecutionTimeoutSeconds to any number but 0 and then set $executionTimeout = '2800' # pick your number here
$path = 'C:\ProgramData\chocolatey\config\chocolatey.config'
$xml = [xml](Get-Content $path)
$xml.chocolatey.commandExecutionTimeoutSeconds = "$executionTimeout"
$xml.SelectSingleNode('//chocolatey/config/add[@key="commandExecutionTimeoutSeconds"]').value = "$executionTimeout"
$xml.Save($path) |
The top level config settings for chocolatey.config had a couple of elements that were deprecated once configSettings section became availalbe and settings could be set with the choco config command. Mark those settings as deprecated and up for removal.
Clean up the way `commandExecutionTimeout` is gathered and set. Move to capturing the string value and then parsing out the integer format of that as a separate variable.
When determining whether to use the default timeout, use the locally set variable instead of using a deprecated config settings value. Previously, when the deprecated value was set to "0" (the default), it would not allow setting an execution timeout to anything other than the default timeout of 2700. This has caused issues in newer installations of Chocolatey (not upgraded) as the value of 0 would not allow changing the execution timeout. It was looking at the deprecated timeout instead of what was currently set or what was in the actual configuration value. Fix this to look at the locally set variable that has already determined what the setting is and whether it evaluates to 0 (not able to parse or empty). However, also allow for an actual setting of "0", which means never time out (GH-1202) by looking at the string value prior to parsing to see if it was set to zero.
* stable: (GH-1042) Ensure-Permissions fails when run as SYSTEM (build) ensure build is on .NET 4.0 (maint) remove test console logging (maint) rename searchTerm variable (maint) update nuget.core (GH-1059) Fix: Unable to change command execution timeout (GH-1059) Clean up commandExecutionTimeout setting (maint) clean up CacheLocation (GH-1202) Allow 0 for infinite timeout (GH-1059) Deprecate old config elements
Hey Rob, A BIG ThankYou.. |
C:\Windows\system32>choco config set commandExecutionTimeoutSeconds 14400 -dvy
Chocolatey v0.10.3
Chocolatey is running on Windows v 6.1.7601.65536
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line not shown - sensitive arguments may have been passed.
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
The source '' evaluated to a 'normal' source type
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
Configuration: CommandName='config'|
CacheLocation='C:\Users\shikhare_a\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
SourceType='normal'|Debug='True'|Verbose='True'|Force='False'|
Noop='False'|HelpRequested='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='False'|AcceptLicense='True'|
AllowUnofficialBuild='False'|
Input='set commandExecutionTimeoutSeconds 14400'|AllVersions='False'|
SkipPackageInstallProvider='False'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='6.1.7601.65536'|
Information.PlatformName='Windows 7'|
Information.ChocolateyVersion='0.10.3.0'|
Information.ChocolateyProductVersion='0.10.3'|
Information.FullName='choco, Version=0.10.3.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='False'|
Features.AllowEmptyChecksums='True'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Name='commandExecutionTimeoutSeconds'|
ConfigCommand.Command='set'|PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyConfigCommand - Normal Run Mode _
Attempting to copy "C:\ProgramData\chocolatey\config\chocolatey.config.update"
to "C:\ProgramData\chocolatey\config\chocolatey.config".
Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.update".
Updated commandExecutionTimeoutSeconds = 14400
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 0
We see the commandExecutionTimeoutSeconds = 14400 has been set.
The very next moment when we run choco config list we see below.
C:\Windows\system32>choco config list
Chocolatey v0.10.3
Settings
cacheLocation = | Cache location if not TEMP folder.
containsLegacyPackageInstalls = true | Install has packages installed prior to 0.9.9 series.
proxy = | Explicit proxy location.
proxyUser = | Optional proxy user.
proxyPassword = | Optional proxy password. Encrypted.
webRequestTimeoutSeconds = 30 | Default timeout for web requests. Available in 0.9.10+.
timeout = 14400 |
commandExecutionTimeoutSeconds = 2700 | Default timeout for command execution.
This never gets set in the config file. When tried changing the value in Config file, it gets overwritten whenever the next choco command gets run.
choco.summary.log around this time.
2016-11-23 16:12:32,807 [INFO ] - Chocolatey v0.10.3
2016-11-23 16:12:35,212 [WARN ] - Updated commandExecutionTimeoutSeconds = 14400
2016-11-23 17:11:08,109 [INFO ] - ============================================================
2016-11-23 17:11:08,166 [INFO ] - Chocolatey v0.10.3
2016-11-23 17:11:12,554 [INFO ] - Settings
2016-11-23 17:11:12,560 [INFO ] - cacheLocation = | Cache location if not TEMP folder.
2016-11-23 17:11:12,565 [INFO ] - containsLegacyPackageInstalls = true | Install has packages installed prior to 0.9.9 series.
2016-11-23 17:11:12,568 [INFO ] - proxy = | Explicit proxy location.
2016-11-23 17:11:12,581 [INFO ] - proxyUser = | Optional proxy user.
2016-11-23 17:11:12,585 [INFO ] - proxyPassword = | Optional proxy password. Encrypted.
2016-11-23 17:11:12,589 [INFO ] - webRequestTimeoutSeconds = 30 | Default timeout for web requests. Available in 0.9.10+.
2016-11-23 17:11:12,594 [INFO ] - timeout = 14400 |
2016-11-23 17:11:12,599 [INFO ] - commandExecutionTimeoutSeconds = 2700 | Default timeout for command execution.
The text was updated successfully, but these errors were encountered: