Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type header [] is not supported, status:406 #177

Closed
latundetoks opened this issue Jan 17, 2018 · 7 comments
Closed

Content-Type header [] is not supported, status:406 #177

latundetoks opened this issue Jan 17, 2018 · 7 comments

Comments

@latundetoks
Copy link

I have encountered a content-type header [] not supported error while using 411 on Elasticsearch 6.0.0

Does the lastest version of 411 work on this version of elasticsearch? Could you advise how this can be resolved.

[:error] [pid 8976] PHP Fatal error: Uncaught exception 'Elasticsearch\\Common\\Exceptions\\BadRequest400Exception' with message '{"error":"Content-Type header [] is not supported","status":406}' in /var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:669\nStack trace:\n#0 /var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(640): Elasticsearch\\Connections\\Connection->tryDeserializeError(Array, 'Elasticsearch\\\\C...')\n#1 /var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(561): Elasticsearch\\Connections\\Connection->tryDeserialize400Error(Array)\n#2 /var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(262): Elasticsearch\\Connections\\Connection->process4xxError(Array, Array, Array)\n#3 /var/www/411/vendor/react/promise/src/FulfilledPromise.php(25): Elasticsearch\\Connections\\Connection->Elasticsearch\\Connections\\{closure}(Array)\n#4 /var/www/411/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureVa in /var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php on line 671, referer: http://fouroneone/alerts?query=state:(0+1)

Also PHP Parsing Error is seen in the httpd error logs

[:error] [pid 8978] PHP Parse error: syntax error, unexpected '?' in /var/www/411/phplib/REST/Dashboard.php on line 90

Configuration file for alerts.

# Configuration for the 411 Alerts index. 'alerts' => [ 'hosts' => ['https://username:p@ssword@elas01:9200'], 'index_hosts' => [], 'ssl_cert' => '/var/www/411/cert.pem', 'index' => null, 'date_based' => false, 'date_interval' => null, 'date_field' => 'alert_date', 'date_type' => null, 'src_url' => null, ],

@latundetoks
Copy link
Author

There seem to be some changes within ES6.0 regarding strict content-type checking and it does not allow any other content-type except application/json charset=utf-8.
https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

Request Header:
application/json, text/javascript, /; q=0.01

Response Header:
application/json charset=utf-8

Looked through source code to see if content-type is hardcoded.

@thasler
Copy link

thasler commented Jan 23, 2018

Experienced the same issue with ES6.1.1

EDIT: We have an ELK stack with version 6.1.1 running in production and want to do alerting. When do you think will 411 be working with ES6.1.1?

@rpelissi
Copy link

Hi,
Great piece of software but it works only on ELK 5.x, could be so cool to have it working on 6.x

Thanks!

@Sh4d0w-3xPl0iT
Copy link

+1 i have similar issues :(

@tomdoherty
Copy link

tomdoherty commented Mar 23, 2018 via email

@kiwiz
Copy link
Contributor

kiwiz commented Mar 23, 2018

Tracking ES6.0 support in #179.

@tarun072
Copy link

I got this error..

Fatal error: Uncaught Elasticsearch\Common\Exceptions\BadRequest400Exception: {"error":"Content-Type header [] is not supported","status":406} in C:\xampp\htdocs\esearch\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php:669 Stack trace: #0 C:\xampp\htdocs\esearch\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(640): Elasticsearch\Connections\Connection->tryDeserializeError(Array, 'Elasticsearch\C...') #1 C:\xampp\htdocs\esearch\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(561): Elasticsearch\Connections\Connection->tryDeserialize400Error(Array) #2 C:\xampp\htdocs\esearch\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(262): Elasticsearch\Connections\Connection->process4xxError(Array, Array, Array) #3 C:\xampp\htdocs\esearch\vendor\react\promise\src\FulfilledPromise.php(25): Elasticsearch\Connections\Connection->Elasticsearch\Connections{closure}(Array) #4 C:\xampp\htdocs\esearch\vendor\guzzleh in C:\xampp\htdocs\esearch\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php on line 671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants