darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.49k stars 349 forks source link

"Max. recursion depth with nested structures exceeded" with a tar.xz archive #751

Closed OrioQuezac closed 1 year ago

OrioQuezac commented 1 year ago

Hi darold,

We have an issue when generating a report with a tar.xz archive.

$ pgbadger -j 4 -f stderr -p '%t:%r:%u@%d:[%p]:' logs.tar.gz -o /tmp/out.html
Max. recursion depth with nested structures exceeded at /usr/lib64/perl5/vendor_perl/Storable.pm line 328, at /bin/pgbadger line 15537.

can not load incompatible binary data, binary file is from version < 4.0.
LOG: Ok, generating html report...

The generated report is blank. The archive contains 31 log files (~ 100MB per file). The system was updated (Rocky Linux 8).

$ perl -v 

This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
(with 57 registered patches, see perl -V for more detail)

$ perl -E 'use Storable qw(dclone); say "version=",$Storable::VERSION; say "limit=",$Storable::recursion_limit; my @tt; for (1..1_000_000) { my $t = [[[]]]; push @tt, $t } dclone @tt' 

version=3.11
limit=14271

If I extract the archive and generate a report with all 31 files, we have no errors.

Kind Regards.

darold commented 1 year ago

This is normal, there is no place where it is said that pgBadger supports tar archives. pgBadger is able to parse any log compressed single file but not an archive, compressed or not. You must untar your archive.