Skip to content

[FEATURE] Healthcheck fails when admin interface credentials are enabled #4587

@tmthn

Description

@tmthn

Describe the bug
The container's healthcheck script does not support authentication. When basic auth credentials are configured for Solr's admin interface, the healthcheck endpoint receives a 401 Unauthorized response, causing the container to be marked as unhealthy.

To Reproduce

  1. Pull and run typo3solr/ext-solr:13.1.1
  2. Enable basic authentication for the Solr admin interface*
  3. Restart the container
  4. Observe the container health status via docker inspect --format='{{.State.Health.Status}}'

*To enable authentication for the Solr admin interface follow these steps:

Create security.json on your host

{
  "authentication": {
    "blockUnknown": true,
    "class": "solr.BasicAuthPlugin",
    "credentials": {
      "solr": "<YOUR ENCODED PASSWORD>"
    },
    "realm": "My Solr users",
    "forwardCredentials": false
  },
  "authorization": {
    "class": "solr.RuleBasedAuthorizationPlugin",
    "permissions": [
      { "name": "security-edit", "role": "admin" }
    ],
    "user-role": {
      "solr": "admin"
    }
  }
}

To create the password you can use this tool.

Mount via docker-compose.yaml

services:
  solr:
    container_name: typo3s-solr-server
    image: typo3solr/ext-solr:<VERSION>
    ports:
      - "8983:8983"
    volumes:
      - typo3s-solr-server-data:/var/solr
      - ./security.json:/var/solr/data/security.json
 
volumes:
  typo3s-solr-server-data:
    driver: local
    driver_opts:
      type: none
      device: $PWD/.solrdata
      o: bind

Make sure the file is readable by UID 8983 (the Solr user inside the container):

chmod 644 security.json

Expected behavior
The healthcheck should succeed even when admin credentials are enabled. Possible approaches:

  • Support passing credentials to the healthcheck script via environment variables (e.g., SOLR_HEALTH_USER, SOLR_HEALTH_PASS)
  • Use an unauthenticated health endpoint that bypasses admin auth

Used versions (please complete the following information):

  • Container image: typo3solr/ext-solr:13.1.1

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