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

The remote server returned an error: (406) Not Acceptable. #51

Closed
gaguerre opened this issue Jun 27, 2018 · 5 comments
Closed

The remote server returned an error: (406) Not Acceptable. #51

gaguerre opened this issue Jun 27, 2018 · 5 comments

Comments

@gaguerre
Copy link

Hi. I am trying to log to our ElasticSearch, but i get the following error:

log4net: Loading Appender [ElasticSearchAppender] type: [log4stash.ElasticSearchAppender, log4stash]
log4net: Setting Property [Server] to String value [192.168.240.199]
log4net: Setting Property [Port] to Int32 value [9200]
log4net: Setting Property [IndexName] to String value [bbvanet]
log4net: Setting Property [IndexAsync] to Boolean value [True]
log4net: Setting Collection Property [AddKv] to object [log4stash.Filters.KvFilter]
log4net: Setting Property [ElasticFilters] to object [log4stash.ElasticAppenderFilters]
log4net: Created Appender [ElasticSearchAppender]
log4net: Adding appender named [ElasticSearchAppender] to logger [root].
log4net: Hierarchy Threshold []
log4net:ERROR Got error while reading response from ElasticSearch
System.Net.WebException: The remote server returned an error: (406) Not Acceptable.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at log4stash.WebElasticClient.SafeGetAndCheckResponse(Func`1 getResponse) in c:\github\log4stash\src\log4stash\ElasticClient\ElasticClient.cs:line 189

My config is as your example

192.168.240.199
9200




what could be?

@eran-gil
Copy link
Collaborator

Please attach the complete configuration in order for us to be able to help you

@urielha
Copy link
Owner

urielha commented Jun 29, 2018

In addition, please specify:

  • log4stash version you use.
  • Do you have access to the elasticsearch log files? if so, can you share the error that is written there?
  • At last, please try setting SerializeObjects to false as you can see in the configuration example here and see if anything changes.

@gaguerre
Copy link
Author

Log4Net Version 1.2.15.0
Log4Stash Version 2.0.0.0

SerializeObjects set to False but got same error

App.config.txt

ElasticSearch.log does not register new entries

@urielha
Copy link
Owner

urielha commented Jul 5, 2018

I guess you are using ElasticSearch 6.0 RC 2?
Try to upgrade log4stash to 2.1.0 or higher .
You can read the release notes for each version here: Releases

Furthermore, because you are using version 2.0.0 there are few breaking changes you need to be aware of which are listed here: Breaking Changes
Edit: From your configuration it seems you don't have any updates to do (due to breaking changes)

@urielha
Copy link
Owner

urielha commented Apr 10, 2020

Closing since no activity

@urielha urielha closed this as completed Apr 10, 2020
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

3 participants