darold / pgbadger

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

Max. recursion depth with nested structures exceeded at /usr/lib64/perl5/vendor_perl/Storable.pm #683

Closed mgogala closed 3 years ago

mgogala commented 3 years ago

[postgres@perf-psql13vm log]$ /usr/local/bin/pgbadger postgresql-Fri.log -j 4 -o /tmp/pg-13-AUG-21.html I am receiving an error while trying to analyze large log file:

Max. recursion depth with nested structures exceeded at /usr/lib64/perl5/vendor_perl/Storable.pm line 328, at /usr/lo cal/bin/pgbadger line 15114.

can not load incompatible binary data, binary file is from version < 4.0. LOG: Ok, generating html report... [postgres@perf-psql13vm log]$ [postgres@perf-psql13vm log]$ /usr/local/bin/pgbadger --version pgBadger version 11.5

mgogala commented 3 years ago

OK, I have solved my problem. I re-installed the Storable module using CPAN and added the following 2 lines to the pgbadger script:

$Storable::recursion_limit=-1; $Storable::recursion_limit_hash=-1;

The error is still thrown but the HTML report is usable.

[postgres@perf-psql13vm log]$ /usr/local/bin/pgbadger postgresql-Fri.log -j 4 -o /tmp/pg-13-AUG-21.html Max. recursion depth with nested structures exceeded at /usr/lib64/perl5/vendor_perl/Storable.pm line 328, at /usr/local/bin/pgbadger line 15115. Max. recursion depth with nested structures exceeded at /usr/lib64/perl5/vendor_perl/Storable.pm line 328, at /usr/local/bin/pgbadger line 15115.

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

mgogala commented 3 years ago

Here is the final file which no longer throws errors. pgbadger.txt

[postgres@perf-psql13vm log]$ /usr/local/bin/pgbadger postgresql-Fri.log -j 4 -o /tmp/pg-13-AUG-21.html [========================>] Parsed 4518813261 bytes of 4518813261 (100.00%), queries: 3878876796, events: 22 LOG: Ok, generating html report... [postgres@perf-psql13vm log]$

darold commented 3 years ago

What does 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' returns?

mgogala commented 3 years ago

[postgres@perf-psql13vm log]$ 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.15 limit=512 Not a reference at -e line 1. [postgres@perf-psql13vm log]$

darold commented 3 years ago

hum, you should not have the error message, I have the same result. If you can give me a link on my private email [ gilles AT darold DOT net ] to download your log file so that I can try to reproduce the issue this will be helpful. If you can't, no problem I understand.

mgogala commented 3 years ago

Sorry Giles, the file is already gone. I would have uploaded it, there is no confidential information in there, but it was cleaned up after I upgraded to 13.4.

darold commented 3 years ago

Ok, if you have the same error again do not hesitate to send me the log file. Thanks.