Make Server connection status more useful

Created on 28 July 2025, about 2 months ago

Problem/Motivation

When you go to /admin/config/search/search-api/server/your_server_machine_name, the Search API Server Summary table has a Connection row which displays:

  • "The ElasticSearch cluster was reached successfully" if the server is available and can be pinged, xor,
  • "The ElasticSearch cluster could not be reached. Further data is therefore unavailable." if the server is available, but cannot be pinged

This is okay, but it would be more useful if:

  1. If the server is available and can be pinged, it would be good to know...
    1. What the cluster thinks that it is named
    2. What versions that the Elasticsearch Nodes in the cluster are is running
    3. What the cluster thinks that its overall status is

    ...as this information would help a site administrator know if they connected to the correct cluster.

  2. If the server is available but cannot be pinged, it would be good to know...
    1. If there was an error establishing the connection
    2. What HTTP status code the ping responded with

    ...as this information would help a site administrator know if they made a mistake in the URL (i.e.: connection error), with their credentials (i.e.: 400 error), or if the server is having some sort of issue (i.e.: 500 error).

Proposed resolution

Update the displayed messages. Update internal APIs to make it easier to get the information we need.

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit
  5. Release

User interface changes

Likely only changes to the text in the UI. This will affect translations.

API changes

To be determined: likely only API additions.

Data model changes

To be determined: likely none.

Feature request
Status

Active

Version

8.0

Component

Code

Created by

🇨🇦Canada mparker17 UTC-4

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mparker17
    • mparker17 committed 6f9d4fd2 on 3538452-server-status-msg-more-useful
      Issue #3538452: Make Server connection status more useful
      
  • 🇮🇳India pooja saraah Chennai

    Patch proposal suggestion:

    Update the Search API server connection routine to retrieve and expose Elasticsearch cluster details: cluster name, node version, and health status.
    On connection failure, capture and display the HTTP response code and error message.
    Modify the admin UI rendering (Controller + Twig) to conditionally display the enriched status or failure details.
    Ensure all added strings are translatable and update the .pot/.po translations accordingly.

  • 🇨🇦Canada mparker17 UTC-4

    I had apparently pushed to the wrong issue fork in #2... I've now created a merge request in the correct issue fork: I apologize for the confusion.

    I had been hesitating on this patch because it requires additional permissions...

    1. additional cluster-level permission: monitor
    2. additional index-level permissions: maintenance, monitor

    That being said, when I was writing the guide on setting up an API key with a role descriptor , I included these permissions, so it's probably okay for now.

    Probably a better solution would be to test whether or not we have these permissions before trying to access data that requires it (i.e.: because we could selectively display information based on what the API key we're connecting with has permission to view). Ideally, Elasticsearch has a has-privileges API and a get application privileges API we could use to query this; another option could be to try getting the data and catching 403 errors, but the Elasticsearch Connector module doesn't yet have infrastructure to support either of those approaches.

Production build 0.71.5 2024