Skip to content

solr-init Image Should Be Updated for Usage with Solr 8.8.2 #746

@Antonytm

Description

@Antonytm

solr-init container doesn't initialize Solr cores

  • I have tried with the latest version of Docker for Windows (Stable or Edge) or Docker Enterprise.
  • Windows version is at least 1809 / ltsc2019.
  • Windows has the latest updates installed.

Expected behavior

sitecore-xp0-solr-init 10.2.0-ltsc2019 (sitecore-xm1-solr-init as well) should initialize Solr cores.

Actual behavior

sitecore-xp0-solr-init 10.2.0-ltsc2019 doesn't initialize Solr cores.
And throw exception to logs:

Downloading '_default' SOLR config set

Downloading '' file

C:\Download-SolrConfig.ps1 : Exception calling "WriteAllLines" with "2" 

argument(s): "Value cannot be null.

Parameter name: contents"

At C:\Start.ps1:68 char:1

+ .\Download-SolrConfig.ps1 -SolrEndpoint $SolrEndpoint -OutPath $solrB ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Download-SolrConfig.ps1], Met 

   hodInvocationException

    + FullyQualifiedErrorId : ArgumentNullException,Download-SolrConfig.ps1

Additional information

Tested on
10.2.0-ltsc2019 | 10.0.17763.2452 | ltsc2019 | amd64 | windows | sha256:4428959a3f23e959aa5e99441116816f4644656d3036a54c2c51f36226b4953c | 11/04/2021 08:34:49 | 01/19/2022 15:14:35|

Initially, I opened an issue in https://github.com/Sitecore/docker-examples repository.
Sitecore/docker-examples#46

But after digging, I figured out that Solr ZooKeeper response was changed from 8.4.0 to 8.8.2 version. It causes requests from solr-init to solr container fail because another format of data is expected.

That is why I duplicate an issue here.

Steps to reproduce the behavior

  1. Clone https://github.com/Sitecore/docker-examples
  2. Switch to master branch
  3. Initialize environment .\init.ps1 -LicenseXmlFile c:\license\license.xml
  4. cd custom-images\docker
  5. Run .\clean.ps1 to make sure that there are no artifacts from previous times
  6. cd custom-images
  7. run docker-compose up -d

Suggested fix

Change Download-SolrConfig.ps1 file, update Download-FileItem function:

function Download-FileItem {
    param(
        [string]$SolrEndpoint,
        $FileItem,
        [string]$OutPath
    )
    Write-Host "Downloading '$($FileItem.title)' file"
    $fileContent = (Invoke-RestMethod -Uri "$SolrEndpoint/$($FileItem.attr.href)" -Credential (Get-SolrCredential)).znode.data
    #File content should have "UTF-8 without BOM" encoding
    [System.IO.File]::WriteAllLines("$OutPath\$($FileItem.title)", $fileContent)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions