etsy / 411

An Alert Management Web Application
https://demo.fouroneone.io
MIT License
969 stars 112 forks source link

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

Closed latundetoks closed 6 years ago

latundetoks commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

+1 i have similar issues :(

tomdoherty commented 6 years ago

+2

On 23 Mar 2018, at 11:40, EYMIST notifications@github.com<mailto:notifications@github.com> wrote:

+1 i have similar issues :(

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/etsy/411/issues/177#issuecomment-375632896, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeRZJhTiBU1J-ycVKxc9V5DQBPZk3DkYks5thN8tgaJpZM4RhxjB.

kiwiz commented 6 years ago

Tracking ES6.0 support in #179.

tarun072 commented 5 years ago

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