rrdtool-1.x icon indicating copy to clipboard operation
rrdtool-1.x copied to clipboard

rrdcached client truncate 'rrdtool info' output

Open DeHackEd opened this issue 4 years ago • 2 comments

Describe the bug When an rrdfile has a DS whose last_ds value is an empty string the rrdc_client errors out during network protocol parsing and truncates the output of the protocol.

When last_ds is the empty string the protocol parser interprets the empty string as an error and aborts processing the result. The incomplete output is then returned to the client. I'm not sure how this situation specifically came about.

To Reproduce 0. Have a working rrdcached service

  1. Via whatever means produce an .rrd file where a DS has a last_ds value of the empty string.
  2. Run rrdtool info -d /tmp/rrdcached.sock thisfile.rrd

Expected behavior Output of rrdtool info thisfile.rrd with and without daemon parameter is identical (or close enough)

Instead the output is truncated where the first ds[DSNAME].last_ds value should be, and last_ds is missing.

Screenshots

# rrdtool info -d /tmp/rrdcached.sock [filename]
filename = "[filename]"
rrd_version = "0003"
step = 300
last_update = 1586092083
header_size = 7376
ds[ifHCInOctets].index = 0
ds[ifHCInOctets].type = "COUNTER"
ds[ifHCInOctets].minimal_heartbeat = 500
ds[ifHCInOctets].min = 0.0000000000e+00
ds[ifHCInOctets].max = 1.0000000000e+15

Actual truncated output from testing. RRDfile actualy has 8 DS and 7 RRA entries

System

  • OS: CentOS 6.x
  • RRDtool version: 1.7.2 (built from source)

Additional context Commenting out these two lines is a functional, if ugly, workaround.

DeHackEd avatar Apr 06 '20 21:04 DeHackEd

the interesting bit in my eyes is to figure out how last_ds can become an empty value ...

oetiker avatar Apr 07 '20 06:04 oetiker

I don't know, but I swear this did happen.

The only oddity I can think of is that, since it's a custom build of rrdtool, there may have been something left over from the old version. The app is Perl based so if RRDs were out of date... That is the only thing that comes to mind.

DeHackEd avatar Apr 07 '20 10:04 DeHackEd