Skip to content

Magento2 & Elasticsearch 8.13.4 install: Could not validate a connection to Elasticsearch. Unknown 401 error from Elasticsearch null

Installing locally using

php bin/magento setup:install –base-url=http://127.0.0.1/magento2/
–db-host=localhost –db-name=magento2 –admin-firstname=admin –admin-lastname=admin –[email protected] –admin-user=admin –admin-password=admin123 –language=en_US –currency=USD –timezone=America/Chicago –use-rewrites=1 –backend-frontname=admin –search-engine=elasticsearch8 –elasticsearch-host=”https://localhost” –elasticsearch-port=9200 –elasticsearch-enable-auth=true –elasticsearch-username=”elastic” –elasticsearch-password=”[my password]”

localhost:9200 returns

{
  "name" : "DULLAHAN",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "XA24SRmzTgaeIMbASp64rg",
  "version" : {
    "number" : "8.13.4",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "da95df118650b55a500dcc181889ac35c6d8da7c",
    "build_date" : "2024-05-06T22:04:45.107454559Z",
    "build_snapshot" : false,
    "lucene_version" : "9.10.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

so elasticsearch 8 should be running…

I could not find examples of this error occuring on these versions of Magento & Elasticsearch. How do I troubleshoot this one?