-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
jolokia returns "Error handling response: Not expected status value in response body: 403" #1628
Comments
it might be a permissions issue for the telegraf user, what happens when you use curl as telegraf?
|
Thanks @sparrc ! I Did a top to see who telegraf is running as and found it running as root. I ran the curl as root as you suggested and it comes back fine: PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
{"request":{"mbean":"java.lang:type=Memory","type":"read"},"value":{"ObjectPendingFinalizationCount":0,"Verbose":true,"HeapMemoryUsage":{"init":247463936,"committed":239271936,"max":4260102144,"used":87624168},"NonHeapMemoryUsage":{"init":2555904,"committed":94519296,"max":1593835520,"used":93247816},"ObjectName":{"objectName":"java.lang:type=Memory"}},"timestamp":1471020559,"status":200} |
any ideas @saiello ? |
Looking at the plugin code I noticed that a POST request was being used. I simulated this with CURL and found the issue. It would be very very helpful if this error was output.
|
I went to fix this, but we are actually already reporting any HTTP errors more fully in the code. Jolokia has a very strange behavior where it returns an HTTP 200 status code, but then returns a 403 status code in the JSON response body. I'm going to add a note about it in the config. I'm not sure how to handle the error message because this is a very non-standard way of returning an http error...not to mention that I don't really understand why the jolokia maintainers think that a POST request is somehow less secure than a GET 😖 . |
Bug report
Relevant telegraf.conf:
System info:
[Include Telegraf version, operating system name, and other relevant details]
.13 and 1.0.0-beta3 result in same thing.
curl http://localhost:8080/jmx/jolokia/:
{"request":{"type":"version"},"value":{"agent":"1.3.2","protocol":"7.2","config":{"agentId":"10.244.1.14-13-510a39c3-servlet","agentType":"servlet"},"info":{"product":"jetty","vendor":"Eclipse","version":"9.3.z-SNAPSHOT"}},"timestamp":1470962452,"status":200}
Steps to reproduce:
Actual behavior:
2016/08/12 00:22:20 Attempting connection to output: influxdb
2016/08/12 00:22:20 Successfully connected to output: influxdb
2016/08/12 00:22:20 Starting Telegraf (version 1.0.0-beta3)
2016/08/12 00:22:20 Loaded outputs: influxdb
2016/08/12 00:22:20 Loaded inputs: jolokia
2016/08/12 00:22:20 Tags enabled: host=dev-60ern
2016/08/12 00:22:20 Agent Config: Interval:10s, Debug:true, Quiet:false, Hostname:"dev-60ern", Flush Interval:10s
Error handling response: Not expected status value in response body: 403
Error handling response: Not expected status value in response body: 403
Additional info:
Executing CURL seems to work and return a 200 response code
http://localhost:8080/jmx/jolokia/read/java.laang:type=Memory
{"request":{"mbean":"java.lang:type=Memory","type":"read"},"value":{"ObjectPendingFinalizationCount":0,"Verbose":true,"HeapMemoryUsage":{"init":247463936,"committed":239271936,"max":4260102144,"used":37482112},"NonHeapMemoryUsage":{"init":2555904,"committed":98787328,"max":1593835520,"used":97617856},"ObjectName":{"objectName":"java.lang:type=Memory"}},"timestamp":1470961302,"status":200}
The text was updated successfully, but these errors were encountered: