Collectd: curl_json plugin: curl_easy_perform failed with status 23: Failed writing body

Created on 17 Feb 2013  Â·  6Comments  Â·  Source: collectd/collectd

When using curl_json plugin and the respons received is "big", the following error occures :

curl_json plugin: yajl_parse failed: parse error: premature EOF#012
curl_json plugin: curl_easy_perform failed with status 23: Failed writing body

I guess it is the same problem as the one reported for the Apache plugin long ago : "Failed writing body"
Please see
http://collectd.org/faq.shtml
and
collectd commit 5c3efb12ed19f99017b8b13943d4a983de040050

May be the buffer size should be increased dynamically for curl_json as well.

Being pretty bad at c, I have not been able to locate the portion of code that relates to this response buffer size.
Being able make it bigger (even statically in source and then re compile) would be great for us -> Any clue any one ?

(The purpose for us is to monitor couchbase metrics that are exposed thru REST but that are "pretty" verbose)

Regards

Bug

Most helpful comment

I am seeing the same symptom on colectd 5.1

All 6 comments

Hi,

I believe the problem is that the code calls yajl_complete_parse() signaling to YAJL that all data has been read. I assume that, given that not all data is available, YAJL will assume a syntax error.

Can you remove the calls to yajl_complete_parse() / yajl_parse_complete() in cj_curl_callback() (lines 117–121) and see if that solves the issue?

Thanks and regards,
—octo

Hi,

I commented out from line 117 to 121 as you said and re compiled -> It now works !!

Many thanks for this quick hack

This should be fixed by 59c22282427eb6c38d6651cdaa205533752284cb. It's in the _collectd-4.10_ branch now and will be merged to 5.x soon.

Best regards,
—octo

Hi just wonder, which version now have this fix? We got the same problem in 4.10.1

Hi @jeffpeiyt

this fix has not yet been released as a source code tarball.

Best regards,
—octo

I am seeing the same symptom on colectd 5.1

Was this page helpful?
0 / 5 - 0 ratings