docker-examples icon indicating copy to clipboard operation
docker-examples copied to clipboard

docker-compose up -d doesn't work

Open Antonytm opened this issue 4 years ago • 3 comments

Steps to reproduce:

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

Expected result: containers up and running Actual result:

Creating docker-examples_solr_1  ... done
Creating docker-examples_mssql_1 ... done
Creating docker-examples_mssql-init_1 ... done
Creating docker-examples_solr-init_1  ... done
Creating docker-examples_xconnect_1   ... done
Creating docker-examples_id_1         ... done
Creating docker-examples_cm_1         ... done
Creating docker-examples_hrz_1        ... done

ERROR: for traefik  Container "a544e3fe3ff7" is unhealthy.

ERROR: for xdbsearchworker  Container "6b2cc5dcc865" is unhealthy.

ERROR: for cortexprocessingworker  Container "6b2cc5dcc865" is unhealthy.

ERROR: for xdbautomationworker  Container "6b2cc5dcc865" is unhealthy.
ERROR: Encountered errors while bringing up the project.

I ignore traefik as it will be unhealthy if at least one container is unhealthy

Investigations:

  1. run docker logs 6b2cc5dcc865 (xdbsearchworker)

Error present in logs:

2022-01-18 10:30:59.886 +02:00 [Error] Health check "XConnect SolrCloud cluster live collection health check" completed after 26.9359ms with status Unhealthy and '"SolrCloud Cluster health check failed."
2022-01-18 10:32:00.534 +02:00 [Error] Health check "XConnect SolrCloud cluster live collection health check" completed after 1.8999ms with status Unhealthy and '"SolrCloud Cluster health check failed."'

Antonytm avatar Jan 18 '22 08:01 Antonytm

It looks like there is an issue with solr-init image configuration on master branch. Folder custom-images\docker\data\solr is not populated with Solr cores. However, I expect that it should be populated. I expect that there should be present Solr cores configurations, e.g.: sitecore_marketingdefinitions_master_shard1_replica_n1, sitecore_marketingdefinitions_web_shard1_replica_n1, sitecore_web_index_shard1_replica_n1, etc.

I have switched to v10.1.0.1 tag and everything works there. Solr cores folder is populated. Containers start with no errors. Sitecore is up and running.

Antonytm avatar Jan 20 '22 07:01 Antonytm

solr-init container log:

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

Antonytm avatar Jan 20 '22 09:01 Antonytm

I dug into Strart.ps1>Download-SolrConfig.ps1

There is an function Download-FileItem

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

It downloads files from ZooKeeper response: The problem is that the ZooKeeper response from 8.4.0 to 8.8.2 was changed! http://localhost:8984/solr/admin/zookeeper?detail=true&path=/configs/_default&jwt=json

image

It means that for solr-init images for 10.2.0-ltsc2019 for XP and XM Download-FileItem function should be changed to:

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)
}

Antonytm avatar Jan 20 '22 10:01 Antonytm