Populating Solr managed schema... 'index' was not matched. Did you mean 'init'? Required command was not provided. Unrecognized command or argument 'index' Unrecognized command or argument 'schema-populate'

Although this note covers the Indexing plugin, this issue occurs if your nuget package cache doesn't have the necessary Sitecore CLI plugin!

A high-level diagram of Sitecore CLI / plugin relationship:


Context and Solution:

On executing up.ps1 in my local instance of Sitecore Demo Edge, the dotnet sitecore index schema-populate line threw the error.


Although the sitecore.json in github looked good, the following line was missing  in my local sitecore.json:


"Sitecore.DevEx.Extensibility.Indexing@4.1.0"

As a result, nuget cache was missing Indexing plugin:



I put back the Indexing plugin in sitecore.json (with the necessary version), deleted the .sitecore folder, ensured .env file and dotnet-tools.json reflected the same version as in sitecore.json , re-executed .\up.ps1 to see the package-cache get re-generated!


Proof that nuget packages were downloaded and cached successfully:


Indexing worked fine then:


Error:



Your login is complete. You can close the browser tab now.

Login information has been saved.

Populating Solr managed schema...

'index' was not matched. Did you mean 'init'?

Required command was not provided.

Unrecognized command or argument 'index'

Unrecognized command or argument 'schema-populate'


sitecore.cli:

  Sitecore command line tool


Usage:

  sitecore.cli [options] [command]


Options:

  --version         Show version information

  -?, -h, --help    Show help and usage information


Commands:

  login                 Authenticates the CLI to a Sitecore instance

  plugin                Manage plugins commands

  init                  Creates Sitecore configurations in current directory

  ser, serialization    Item serialization commands

  publish               Performs a publish operation on all content


C:\Sitecore.Demo.Edge\up.ps1 : An error occurred while attempting to log into Sitecore, populate the Solr managed

schema, or pushing website items to Sitecore: Populating Solr managed schema failed, see errors above.

At line:1 char:1

+ .\up.ps1

+ ~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,up.ps1

Comments

Popular Posts