Thread: Re: [GENERAL] Fwd: getting error while parsing log file using pgbadger
On Wed, Jul 26, 2017 at 3:18 PM, PAWAN SHARMA <er.pawanshr0963@gmail.com> wrote: > > On Wed, Jul 26, 2017 at 2:42 PM, Michael Paquier <michael.paquier@gmail.com> wrote: > On Wed, Jul 26, 2017 at 10:59 AM, PAWAN SHARMA > <er.pawanshr0963@gmail.com> wrote: > > > > Hi All, > > > > I am facing below error while parsing log file. > > > > [postgres@abc pgaudit]$ pgbadger -f stderr postgres-2017-07-25_121445.csv > > Can't locate Text/CSV_XS.pm in @INC (@INC contains: /usr/local/lib64/perl5 > > /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl > > /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at > > /bin/pgbadger line 2620. > ... > Running make install > "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CSV_XS.bs blib/arch/auto/Text/CSV_XS/CSV_XS.bs 644 > Manifying 1 pod document > Files found in blib/arch: installing files in blib/lib into architecture dependent library tree > Installing /root/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so > Installing /root/perl5/lib/perl5/x86_64-linux-thread-multi/Text/CSV_XS.pm > Installing /root/perl5/man/man3/Text::CSV_XS.3pm > Appending installation info to /root/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod > HMBRAND/Text-CSV_XS-1.31.tgz > /bin/make install -- OK ... > [postgres@abc pgaudit]$ pgbadger -f stderr postgres-2017-07-26_000000.csv -o abc.html > Can't locate Text/CSV_XS.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl/usr/share/perl5/vendor_perl /usr/lib64/ perl5 /usr/share/perl5 .) at /bin/pgbadger line 2620. You have an environment problem in that the 2 different users have a different PATH and you're getting 2 different perl executables, or at least that's what it looks like to me. Please note that where you installed the module to is not listed in the @INC of the other command. I saw in another post that you have it fixed, but all you've done (from what I can see) is that you've only put a band-aide on the problem not fixed the root issue because you've installed the module into 2 different places. The root problem should still exist. You can run with a custom perl, we do; but that also means you must make sure that all apps use it by setting PATH and PERLLIB appropriately, usually by changing a system file and making sure all environments source it. If you do that, then PgBadger will work just fine -and- use the same perl as all of your other programs. HTH, Kevin
On Wed, Jul 26, 2017 at 11:36 PM, <kbrannen@pwhome.com> wrote:
On Wed, Jul 26, 2017 at 3:18 PM, PAWAN SHARMA <er.pawanshr0963@gmail.com> wrote:
>
> On Wed, Jul 26, 2017 at 2:42 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
> On Wed, Jul 26, 2017 at 10:59 AM, PAWAN SHARMA
> <er.pawanshr0963@gmail.com> wrote:
> >
> > Hi All,
> >
> > I am facing below error while parsing log file.
> >
> > [postgres@abc pgaudit]$ pgbadger -f stderr postgres-2017-07-25_121445.csv
> > Can't locate Text/CSV_XS.pm in @INC (@INC contains: /usr/local/lib64/perl5
> > /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
> > /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at
> > /bin/pgbadger line 2620.
>
...
> Running make install
> "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- CSV_XS.bs blib/arch/auto/Text/CSV_XS/CSV_XS.bs 644
> Manifying 1 pod document
> Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
> Installing /root/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Text/ CSV_XS/CSV_XS.so
> Installing /root/perl5/lib/perl5/x86_64-linux-thread-multi/Text/CSV_ XS.pm
> Installing /root/perl5/man/man3/Text::CSV_XS.3pm
> Appending installation info to /root/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal. pod
> HMBRAND/Text-CSV_XS-1.31.tgz
> /bin/make install -- OK
...
> [postgres@abc pgaudit]$ pgbadger -f stderr postgres-2017-07-26_000000.csv -o abc.html
> Can't locate Text/CSV_XS.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/ perl5 /usr/share/perl5 .) at /bin/pgbadger line 2620.
You have an environment problem in that the 2 different users have a different
PATH and you're getting 2 different perl executables, or at least that's what
it looks like to me. Please note that where you installed the module to is not
listed in the @INC of the other command.
I saw in another post that you have it fixed, but all you've done (from what I
can see) is that you've only put a band-aide on the problem not fixed the root issue
because you've installed the module into 2 different places. The root problem should
still exist.
You can run with a custom perl, we do; but that also means you must make sure
that all apps use it by setting PATH and PERLLIB appropriately, usually by
changing a system file and making sure all environments source it. If you do that,
then PgBadger will work just fine -and- use the same perl as all of your other programs.
HTH,
Kevin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi Kevin,
Thanks for Response.
Can you please help me, how can I run this using custom, Perl.
> On Wed, Jul 27, 2017, PAWAN SHARMA <er.pawanshr0963@gmail.com> wrote: > > On Wed, Jul 26, 2017, <kbrannen@pwhome.com> wrote: > > > > You have an environment problem in that the 2 different users have a different > > PATH and you're getting 2 different perl executables, or at least that's what > > it looks like to me. Please note that where you installed the module to is not > > listed in the @INC of the other command. > > ... > > You can run with a custom perl, we do; but that also means you must make sure > > that all apps use it by setting PATH and PERLLIB appropriately, usually by > > changing a system file and making sure all environments source it. If you do that, > > then PgBadger will work just fine -and- use the same perl as all of your other programs. > > > Hi Kevin, > > Thanks for Response. > > Can you please help me, how can I run this using custom, Perl. This is really beyond the scope of this list, but I'll give it 1 try to helpful. Note: I can only answer for Linux type systems, and what you need to do is probably distro specific. The basics are to leave what was installed with the system there so the OS installed tools will continue to work when they reference /usr/bin/perl. Install your custom perl. Change a system file to reference it, which normally means adding the new dir to PATH and PERLLIB; this might be /etc/bashrc or /etc/profile.d/perl.sh (yours as it won't be from the distro) or perhaps something else. Make sure all processes get these new values (the shotgun approach is to reboot the server). Make sure any of your applications reference the new perl specifically (full path) or only say "perl" to get it from PATH. Those are the concepts; if you need more help beyond that, you should ask a good system administrator who knows your server. HTH, Kevin