Akumuli icon indicating copy to clipboard operation
Akumuli copied to clipboard

curl: (18) transfer closed with outstanding read data remaining

Open georgekrueger opened this issue 7 years ago • 2 comments

akumulid is crashes everytime I run the following query:

curl -H "Content-Type: application/json" -X POST -d '{"select":"cpuload","range": {"from":1418224205000000000, "to":1418224505000000000}}' http://blackshirt:8181/api/query curl: (18) transfer closed with outstanding read data remaining

It seems to have started after I accidentally contributed a value without line-endings after the last value: echo "+cpuload host=machine1\r\n:1418224205000000000\r\r+25.0\r\n" | netcat blackshirt.wacker.trdlnk.com 8282

STACK: Program received signal SIGABRT, Aborted. [Switching to Thread 0x7fffed4e1700 (LWP 25064)] 0x00007ffff5935c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 0x00007ffff5935c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007ffff5939028 in __GI_abort () at abort.c:89 #2 0x000000000040fa85 in panic_handler(char const*) () #3 0x00007ffff7af1789 in Akumuli::Exception::Exception(char const*) () from /usr/lib/libakumuli.so #4 0x00007ffff7ab886c in Akumuli::SeriesMatcher::regex_match(char const*, Akumuli::StringPoolOffset*, unsigned long*) const () from /usr/lib/libakumuli.so #5 0x00007ffff7ab8952 in Akumuli::SeriesMatcher::regex_match(char const*) const () from /usr/lib/libakumuli.so #6 0x00007ffff7b5a44d in Akumuli::QP::SeriesRetreiver::extract_ids(Akumuli::SeriesMatcher const&) const () from /usr/lib/libakumuli.so #7 0x00007ffff7b5f251 in Akumuli::QP::parse_where_clause(boost::property_tree::basic_ptree<std::string, std::string, std::lessstd::string > const&, std::vector<std::string, std::allocatorstd::string >, Akumuli::SeriesMatcher const&) () from /usr/lib/libakumuli.so #8 0x00007ffff7b60734 in Akumuli::QP::QueryParser::parse_select_query(boost::property_tree::basic_ptree<std::string, std::string, std::lessstd::string > const&, Akumuli::SeriesMatcher const&) () from /usr/lib/libakumuli.so #9 0x00007ffff7b0098f in Akumuli::Storage::query(Akumuli::StorageSession const*, Akumuli::InternalCursor*, char const*) const () from /usr/lib/libakumuli.so #10 0x00007ffff5f8ea60 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #11 0x00007ffff6400184 in start_thread (arg=0x7fffed4e1700) at pthread_create.c:312 #12 0x00007ffff59fcbed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

georgekrueger avatar Apr 25 '17 14:04 georgekrueger

The exception being thrown was: Akumuli::SeriesMatcher::regex_match: AKU_PANIC("Invalid string-pool.");

I believe this was due to the way I contributed (piping echo with \r\n characters into netcat). It now works using printf command with \n: printf "+cpuload host=machine1\n:1418224205000000000\n+25.0\n" | netcat blackshirt.wacker.trdlnk.com 8282

It may be worth guarding against bad contributions to akumuli that cause the server to crash.

georgekrueger avatar Apr 25 '17 14:04 georgekrueger

Thanks for reporting this, I'll take a closer look.

Lazin avatar Apr 25 '17 15:04 Lazin