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

Unable to load the service index for source https://community.chocolatey.org/api /v2/. Unable to connect to source 'https://community.chocolatey.org/api/v2/': Object reference not set to an instance of an object. #3265

Closed
4 tasks done
brandilton opened this issue Jul 13, 2023 · 4 comments
Labels

Comments

@brandilton
Copy link

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.

What You Are Seeing?

If I run choco outdated on a system without a proxy, I get the following errors:

choco outdated
Chocolatey v2.1.0
Outdated Packages
Output is package name | current version | available version | pinned?

Unable to load the service index for source https://community.chocolatey.org/api
/v2/.
Unable to connect to source 'https://community.chocolatey.org/api/v2/':
Object reference not set to an instance of an object.
chocolatey|2.1.0|2.1.0|false

Chocolatey has determined 0 package(s) are outdated.
1 package(s) had warnings.
Warnings:

chocolatey

What is Expected?

Expect to see a list of outdated packages

How Did You Get This To Happen?

  1. Ran choco outdated
  2. Saw errors noted
  3. Fully removed chocolatey by deleting the $env:SYSTEMDRIVE\ProgramData\Chocolatey folder
  4. Reinstalled by running Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')).
  5. re-ran choco outdated and got same result

System Details

  • Operating System: Windows 10 Pro
  • Windows PowerShell version: 5.1.19041.3031
  • Chocolatey CLI Version: 2.1.0
  • Chocolatey Licensed Extension version: choco list chocolatey.extension --exact
  • Chocolatey License type: free
  • Terminal/Emulator: windows powershell

Installed Packages

chocolatey 2.1.0

Output Log

PS C:\WINDOWS\system32> choco outdated --debug --verbose
Chocolatey v2.1.0
Chocolatey is running on Windows v 10.0.19044.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" outdated --debug --verbose
Received arguments: outdated --debug --verbose
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.
..
Performing validation checks.
Global Configuration Validation Checks:
 - Package Exit Code / Exit On Reboot = Checked
System State Validation Checks:
 Reboot Requirement Checks:
 - Pending Computer Rename = Checked
 - Pending Component Based Servicing = Checked
 - Pending Windows Auto Update = Checked
 - Pending File Rename Operations = Ignored
 - Pending Windows Package Installer = Checked
 - Pending Windows Package Installer SysWow64 = Checked
The source 'https://community.chocolatey.org/api/v2/' evaluated to a 'normal' so
urce 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='outdated'|CacheLocation='C:\WINDOWS\TEMP\chocolatey'
|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://community.chocolatey.org/api/v2/'|SourceType='normal'|
ShowOnlineHelp='False'|Debug='True'|Verbose='True'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|DisableCompatibilityChecks='False'|
AcceptLicense='False'|AllowUnofficialBuild='False'|AllVersions='False'|
SkipPackageInstallProvider='False'|SkipHookScripts='False'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
CacheExpirationInMinutes='30'|AllowDowngrade='False'|
ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.19044.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='2.1.0.0'|
Information.ChocolateyProductVersion='2.1.0'|
Information.FullName='choco, Version=2.1.0.0, Culture=neutral, PublicKeyToken=79
d02ea9cad655eb'|
Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='False'|
Information.UserName='SYSTEM'|Information.UserDomainName='TROMMETER'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='True'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|
Information.IsLicensedAssemblyLoaded='False'|
Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\WINDOWS\system32'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
ListCommand.ExplicitPageSize='False'|
ListCommand.ExplicitSource='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='Unknown'|
ApiKeyCommand.Command='Unknown'|PinCommand.Command='Unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|CacheCommand.Command='Unknown'|
CacheCommand.RemoveExpiredItemsOnly='False'|
_ Chocolatey:ChocolateyOutdatedCommand - Normal Run Mode _
Outdated Packages
 Output is package name | current version | available version | pinned?
Resolving resource PackageSearchResource for source C:\ProgramData\chocolatey\li
b
chocolatey 2.1.0
Resolving resource ListResource for source https://community.chocolatey.org/api/
v2/
Unable to load the service index for source https://community.chocolatey.org/api
/v2/.
Resolving resource PackageMetadataResource for source https://community.chocolat
ey.org/api/v2/
Unable to connect to source 'https://community.chocolatey.org/api/v2/':
 System.NullReferenceException: Object reference not set to an instance of an ob
ject.
   at chocolatey.infrastructure.app.nuget.NugetList.<>c__DisplayClass19_1.<FindP
ackage>b__2()
   at chocolatey.infrastructure.tolerance.FaultTolerance.TryCatchWithLoggingExce
ption[T](Func`1 function, String errorMessage, Boolean throwError, Boolean logWa
rningInsteadOfError, Boolean logDebugInsteadOfError, Boolean isSilent)
chocolatey|2.1.0|2.1.0|false
Chocolatey has determined 0 package(s) are outdated.
 1 package(s) had warnings.
Warnings:
 - chocolatey
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 0

Additional Context

I do not use any proxy servers

@brandilton brandilton added the Bug label Jul 13, 2023
@corbob
Copy link
Member

corbob commented Jul 13, 2023

🤔 The log isn't giving too much information about what could be causing the error. Would you mind running the same command again with the --trace flag and provide the output in a gist?

@brandilton
Copy link
Author

🤔 The log isn't giving too much information about what could be causing the error. Would you mind running the same command again with the --trace flag and provide the output in a gist?

New to gist, hopefully this is correct: https://gist.github.com/brandilton/8c66b4fed8839149ac9ebd7d7a5a813f

@corbob
Copy link
Member

corbob commented Jul 13, 2023

It looks like you might somehow have TLS 1.2 disabled. You might want to take a look at #3250 (comment) with some suggestions to ensure the correct TLS is enabled.

@brandilton
Copy link
Author

It looks like you might somehow have TLS 1.2 disabled. You might want to take a look at #3250 (comment) with some suggestions to ensure the correct TLS is enabled.

That did the trick! I was able to script it in with & iiscryptocli.exe /template best and a reboot was not required.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants