#1111416 rrdtool: 64-bit time_t transition requires a dump/restore of existing files

#1111416#5
Date:
2025-05-04 18:33:23 UTC
From:
To:
Dear Maintainer,

* What led up to the situation?
Upgrading a 32-Bit ARM system from Bookworm to Trixie
* What was the outcome of this action?
RRD files created in Bookworm are not readable in Trixie:
$ rrdtool info test.rrd
ERROR: 'test.rrd' is too small (should be 2986716 bytes)
* What outcome did you expect instead?
$ rrdtool info test.rrd
filename = "test.rrd"
...

This is somewhat expected behaviour, since RRD files are platform
dependent, but it might still be surprising to users.

IMHO, this behaviour, as well as the workaround, should be mentioned in
the release notes.

Workaround:
1. Stop writers and dump RRD to XML *before* upgrading:
$ rrdtool dump test.rrd > test.xml
2. Restore RRD from XML *after* upgrading:
$ rrdtool restore -f test.xml test.rrd

Regards,
Marc

#1111416#10
Date:
2025-08-10 18:49:59 UTC
From:
To:
I think it's a > minor severity bug for a package that is all about
historical data sequences to break access to such sequences without any
user-level documentation of why or what to do about it.

rrdtool should have a NEWS.Debian documenting it.

#1111416#23
Date:
2025-10-12 23:09:05 UTC
From:
To:
---

For those who already upgraded to Trixie unaware of this issue, and everything RRD-related broke, and do not want to setup old Bookworm
just to dump databases, this quick and dirty trick (temporarily using old Bookworm library to dump data on Trixie system) worked for me:


mkdir /tmp/oldrrd && cd /tmp/oldrrd && wget http://deb.debian.org/debian/pool/main/r/rrdtool/librrd8_1.7.2-4+b8_armhf.deb && dpkg-deb -x *.deb .
fixrrd() { cp -ai "$1" "$1.bak" && LD_PRELOAD=/tmp/oldrrd/usr/lib/arm-linux-gnueabihf/librrd.so.8.2.1 rrdtool dump "$1" > "$1.xml" && rrdtool restore -f "$1.xml" "$1"; }

...and then you can do "fixrrd /path/to/example.rrd" to fix some specific RRD file, or automate it with something like:

# find /var/www/db -type f -name "*.rrd" | while read rrd; do echo "Fixing $rrd"; fixrrd "$rrd"; done

(worked fine for me, but as with any advice from random people on the 'net, do your homework and make sure you have working backups)

If/when you are happy with result, you may also want to delete old "*.rrd.bak" copying and/or "*.rrd.xml" backups left behind (as well
as cleanup /tmp/oldrrd or wherever you unpacked that library)