Subject: | Apache::Solr 0.97 blows up with most recent version of LWP |
Date: | Tue, 26 Nov 2013 12:47:07 -0800 (PST) |
To: | "bug-Apache-Solr [...] rt.cpan.org" <bug-Apache-Solr [...] rt.cpan.org> |
From: | Simon Rosenthal <simon.rosenthal [...] yahoo.com> |
Hello:
I have found a bug (or possibly an incompatibility) in Apache::Solr 0.97 when used with the most recent version of LWP (6.05, GAAS/libwww-perl-6.05.tar.gz ). My application reports an error (which I should be checking for, I know...)
my $res = $solr->select(@r);
>>> return \@ids if ($res->nrSelected() == 0);
The error message returned is
Can't use an undefined value as a HASH reference at /opt/perl5/perls/perl-5.16.3 /lib/site_perl/5.16.3/Apache/Solr/Result.pm line 144,
When i run under the debugger and dump the $res object after the return from select I see
...
'ASR_response' => HTTP::Response=HASH(0x57718d0)
'_content' => 'Can\'t locate object method "can_read" via package "LWP::Protocol::http::Socket" at /opt/perl5/perls/perl-5.16.3/lib/site_perl/5.16.3/LWP/Protocol/http.pm line 22, <STDIN> line 2.
A little googling for that message came up with a bug reported in
http://stackoverflow.com/questions/15444184/undefined-subroutine-
lwpprotocolhttpssocketcan-read-called
which was resolved by downgrading to LWP 6.03. This also fixed the Apache::Solr problem.
Might be worth adding a check for the buggy LWP version at either module install timeor in the Apache::Solr constructor.
best
-Simon