-
Notifications
You must be signed in to change notification settings - Fork 213
Description
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
- Clone https://github.com/Sitecore/docker-examples
- Switch to master branch
- Initialize environment .\init.ps1 -LicenseXmlFile c:\license\license.xml
- cd custom-images\docker
- Run .\clean.ps1 to make sure that there are no artifacts from previous times
- cd custom-images
- 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)
}