Skip to content

Cannot deserialize the reponse as array with Content-Type: text/plain #1218

@stayallive

Description

@stayallive

Summary of problem or feature request

When trying to get aliases from Elastic I get the following error:

Cannot deserialize the reponse as array with Content-Type: text/plain; charset=UTF-8
./vendor/elasticsearch/elasticsearch/src/Response/Elasticsearch.php:116 { …}
./vendor/elasticsearch/elasticsearch/src/Response/Elasticsearch.php:190 { …}

This worked on 7.x and I cannot figure out why it would fail now all of a sudden since I don't think this method is deprecated on 8.x or there is a better way to retrieve this. Probably missing something obvious so any help is appreciated!

Code snippet of problem

$aliases = $this->esClient->cat()->aliases([
    'name' => 'some-name',
]);

return $aliases[0] ?? null;

System details

  • Operating System: Alpine Linux 3.15
  • PHP Version: PHP 7.4.29
  • ES-PHP client version: 8.1.0
  • Elasticsearch version: 8.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions