You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Brian Robinson <br...@socialsurgemedia.com> on 2013/10/04 02:02:34 UTC

Got error: Filter execution threw an exception

Hello,
Starting a new thread on this problem...

I'm using PHP Pecl to create my index, and am getting an error that I 
can't figure out. I'm using Solr version 4.3.1.

I know I'm supposed to provide the log errors, but strangely, I checked 
solr.log in the apache-tomcat/logs/ directory, and the 
apache-tomcat/logs/logs/ directory, and neither had an entry for the 
errors I saw today. I also checked the catalina.2013-10-03.log, and that 
also showed no errors. Is there another log I should be checking?

The way I'm triggering this is by having my browser hit a PHP page with 
the code. When I do that, a "Filter execution threw an exception" error 
is shown on the page. Please let me know if I need to give further 
information. Any help I can get would be appreciated.
Thanks,
Brian

Re: Got error: Filter execution threw an exception

Posted by Brian Robinson <br...@socialsurgemedia.com>.
Something else strange...I pinged Solr with PHP in my desktop browser 
and didn't get a response back, neither a success nor a failure. But 
when I navigate to /solr/admin/ping on the server, it shows a status of 
"OK".  I can also execute a deleteByQuery command without error, but 
both addDocuments and addDocument produce the error.


On 10/3/2013 7:02 PM, Brian Robinson wrote:
> Hello,
> Starting a new thread on this problem...
>
> I'm using PHP Pecl to create my index, and am getting an error that I 
> can't figure out. I'm using Solr version 4.3.1.
>
> I know I'm supposed to provide the log errors, but strangely, I 
> checked solr.log in the apache-tomcat/logs/ directory, and the 
> apache-tomcat/logs/logs/ directory, and neither had an entry for the 
> errors I saw today. I also checked the catalina.2013-10-03.log, and 
> that also showed no errors. Is there another log I should be checking?
>
> The way I'm triggering this is by having my browser hit a PHP page 
> with the code. When I do that, a "Filter execution threw an exception" 
> error is shown on the page. Please let me know if I need to give 
> further information. Any help I can get would be appreciated.
> Thanks,
> Brian
>


Re: Got error: Filter execution threw an exception

Posted by Brian Robinson <br...@socialsurgemedia.com>.
Also, if it sheds any light, before this error started appearing, I was 
running into some OOM errors with PHP. Before that, I had reloaded Solr 
a couple of times, since I updated schema.xml. All I did in schema.xml 
was remove some fields, though.

On 10/3/2013 9:03 PM, Brian Robinson wrote:
> Hi Shawn,
> Thanks for responding. Just saw this email. I did go to the logging 
> tab in the admin page, but it never finished loading. I'm using 
> collection1, and I'm using the traditional config. Here is my complete 
> code, with $options omitted for security:
>
>
> $options = array
> (
>     'hostname' => 'localhost',
>     'login'    => 'XXXXX',
>     'password' => 'XXXXX',
>     'port'     => '8080',
> );
>
> $client = new SolrClient($options);
>
>    $lastUpdate = '2013-09-31';
>    $prod_result = $db_connect->query("
>        SELECT DISTINCT p.id, p.prodName, p.brand, bi.brandName, 
> p.description, p.lastUpdate
>        FROM product_CJ p
>        INNER JOIN brands_inactive bi ON bi.feedID = p.brand
>        WHERE p.showProd='Y' AND p.lastUpdate > ? LIMIT 0, 1",
>        array($lastUpdate)
>    );
>
>    $docArray = array();
>    while ($prod_row = $prod_result->fetchRow(DB_FETCHMODE_ASSOC)) {
>        $docArray[$prod_row['id']] = $prod_row;
>    }
>
>    $solrDocs = array();
>    foreach ($docArray AS $prod_row) {
>          $tmpProdID = $prod_row['id'];
>          $doc = new SolrInputDocument();
>          $doc->addField('id', $tmpProdID);
>          $doc->addField('prodName', $prod_row['prodName']);
>          $doc->addField('brand', $prod_row['brand']);
>          $doc->addField('brandName', $prod_row['brandName']);
>          $doc->addField('description', $prod_row['description']);
>          $tmpUpdate = $prod_row['lastUpdate']."T00:00:00Z";
>          $doc->addField('lastUpdate', $tmpUpdate);
>          $solrDocs[] = $doc;
>    }
>
>    foreach (array_chunk($solrDocs, 500) AS $solrChunk) {
>         $client->addDocuments($solrChunk);
>    }
>
>
>
> On 10/3/2013 8:46 PM, Shawn Heisey wrote:
>> On 10/3/2013 6:02 PM, Brian Robinson wrote:
>>> I'm using PHP Pecl to create my index, and am getting an error that I
>>> can't figure out. I'm using Solr version 4.3.1.
>>>
>>> I know I'm supposed to provide the log errors, but strangely, I checked
>>> solr.log in the apache-tomcat/logs/ directory, and the
>>> apache-tomcat/logs/logs/ directory, and neither had an entry for the
>>> errors I saw today. I also checked the catalina.2013-10-03.log, and 
>>> that
>>> also showed no errors. Is there another log I should be checking?
>>>
>>> The way I'm triggering this is by having my browser hit a PHP page with
>>> the code. When I do that, a "Filter execution threw an exception" error
>>> is shown on the page. Please let me know if I need to give further
>>> information. Any help I can get would be appreciated.
>> Checking your source code in the previous thread, I do not see how you
>> created your solr client object.  A bunch of questions follow:
>>
>> Can you share your code that creates the client and the base URL that it
>> uses?  Feel free to hide the hostname, but leave the rest of it alone so
>> we can tell what's going on.  Are you using "collection1" or have you
>> created your own?  Is it SolrCloud or a traditional config?
>>
>> Do you see anything in the Logging tab in the Solr UI?  It's not as
>> useful as the actual log, but if you aren't seeing anything elsewhere,
>> you might need to look there.
>>
>> Thanks,
>> Shawn
>>
>>
>
>


Re: Got error: Filter execution threw an exception

Posted by Brian Robinson <br...@socialsurgemedia.com>.
It ended up that I just needed to restart Tomcat. Once you mentioned the 
logging, it sounded like something somewhere just got stuck, so 
rebooting took care of it. I should have just done that in the first place.
Brian

On 10/4/2013 1:43 AM, Shawn Heisey wrote:
> On 10/3/2013 8:03 PM, Brian Robinson wrote:
>> Hi Shawn,
>> Thanks for responding. Just saw this email. I did go to the logging tab
>> in the admin page, but it never finished loading. I'm using collection1,
>> and I'm using the traditional config. Here is my complete code, with
>> $options omitted for security:
> It sounds like the logging for Solr is not set up properly, or that you
> are using a binding that the logging tab doesn't know how to work with.
>   The fact that you're on port 8080 probably means that you're running
> under a servlet container other than the Jetty which ships in the Solr
> example, so logging is not very straightforward.  It's strongly
> recommended that you run Solr under the included Jetty, because all
> these issues have been worked out.
>
> There is a lot of info on the following wiki page on how to get logging
> working correctly with the changes in Solr 4.3.0 and later:
>
> http://wiki.apache.org/solr/SolrLogging
>
> If you already understand how to deal with logging using your servlet
> container, you might want to follow the instructions there for switching
> to java.util.logging, which in many cases will let the container control
> it all.
>
>> $options = array
>> (
>>      'hostname' => 'localhost',
>>      'login'    => 'XXXXX',
>>      'password' => 'XXXXX',
>>      'port'     => '8080',
>> );
>>
>> $client = new SolrClient($options);
>>
>>     $lastUpdate = '2013-09-31';
>>     $prod_result = $db_connect->query("
>>         SELECT DISTINCT p.id, p.prodName, p.brand, bi.brandName,
>> p.description, p.lastUpdate
>>         FROM product_CJ p
>>         INNER JOIN brands_inactive bi ON bi.feedID = p.brand
>>         WHERE p.showProd='Y' AND p.lastUpdate > ? LIMIT 0, 1",
>>         array($lastUpdate)
>>     );
>>
>>     $docArray = array();
>>     while ($prod_row = $prod_result->fetchRow(DB_FETCHMODE_ASSOC)) {
>>         $docArray[$prod_row['id']] = $prod_row;
>>     }
>>
>>     $solrDocs = array();
>>     foreach ($docArray AS $prod_row) {
>>           $tmpProdID = $prod_row['id'];
>>           $doc = new SolrInputDocument();
>>           $doc->addField('id', $tmpProdID);
>>           $doc->addField('prodName', $prod_row['prodName']);
>>           $doc->addField('brand', $prod_row['brand']);
>>           $doc->addField('brandName', $prod_row['brandName']);
>>           $doc->addField('description', $prod_row['description']);
>>           $tmpUpdate = $prod_row['lastUpdate']."T00:00:00Z";
>>           $doc->addField('lastUpdate', $tmpUpdate);
>>           $solrDocs[] = $doc;
>>     }
>>
>>     foreach (array_chunk($solrDocs, 500) AS $solrChunk) {
>>          $client->addDocuments($solrChunk);
>>     }
> I'm a little fuzzy on php code, and I've never used this library.  Yes,
> I provided a patch for a bug, but that was pretty simple, and it was C
> code, not php.
>
> I know perl a whole lot better, but the two languages are pretty similar
> to each other.  If you've stepped through the contents of $solrDocs
> before trying to add it, and verified that it has the correct info, then
> the basic structure seems solid.
>
> One critical question is whether the request is making it to Solr, and
> what Solr is responding with.  You might need to resort to things like
> getting a sniffer trace with tcpdump or wireshark, which might involve
> switching to the actual IP address rather than localhost.
>
> Thanks,
> Shawn
>
>


Re: Got error: Filter execution threw an exception

Posted by Brian Robinson <br...@socialsurgemedia.com>.
Thanks for the guidance, Shawn. I am in fact using Tomcat instead of 
Jetty, but the logging was working OK at one point, so I'm not sure what 
changed to make it not work. I'll have to investigate that. I'll check 
out your other suggestions as well.
Brian

On 10/4/2013 1:43 AM, Shawn Heisey wrote:
> On 10/3/2013 8:03 PM, Brian Robinson wrote:
>> Hi Shawn,
>> Thanks for responding. Just saw this email. I did go to the logging tab
>> in the admin page, but it never finished loading. I'm using collection1,
>> and I'm using the traditional config. Here is my complete code, with
>> $options omitted for security:
> It sounds like the logging for Solr is not set up properly, or that you
> are using a binding that the logging tab doesn't know how to work with.
>   The fact that you're on port 8080 probably means that you're running
> under a servlet container other than the Jetty which ships in the Solr
> example, so logging is not very straightforward.  It's strongly
> recommended that you run Solr under the included Jetty, because all
> these issues have been worked out.
>
> There is a lot of info on the following wiki page on how to get logging
> working correctly with the changes in Solr 4.3.0 and later:
>
> http://wiki.apache.org/solr/SolrLogging
>
> If you already understand how to deal with logging using your servlet
> container, you might want to follow the instructions there for switching
> to java.util.logging, which in many cases will let the container control
> it all.
>
>> $options = array
>> (
>>      'hostname' => 'localhost',
>>      'login'    => 'XXXXX',
>>      'password' => 'XXXXX',
>>      'port'     => '8080',
>> );
>>
>> $client = new SolrClient($options);
>>
>>     $lastUpdate = '2013-09-31';
>>     $prod_result = $db_connect->query("
>>         SELECT DISTINCT p.id, p.prodName, p.brand, bi.brandName,
>> p.description, p.lastUpdate
>>         FROM product_CJ p
>>         INNER JOIN brands_inactive bi ON bi.feedID = p.brand
>>         WHERE p.showProd='Y' AND p.lastUpdate > ? LIMIT 0, 1",
>>         array($lastUpdate)
>>     );
>>
>>     $docArray = array();
>>     while ($prod_row = $prod_result->fetchRow(DB_FETCHMODE_ASSOC)) {
>>         $docArray[$prod_row['id']] = $prod_row;
>>     }
>>
>>     $solrDocs = array();
>>     foreach ($docArray AS $prod_row) {
>>           $tmpProdID = $prod_row['id'];
>>           $doc = new SolrInputDocument();
>>           $doc->addField('id', $tmpProdID);
>>           $doc->addField('prodName', $prod_row['prodName']);
>>           $doc->addField('brand', $prod_row['brand']);
>>           $doc->addField('brandName', $prod_row['brandName']);
>>           $doc->addField('description', $prod_row['description']);
>>           $tmpUpdate = $prod_row['lastUpdate']."T00:00:00Z";
>>           $doc->addField('lastUpdate', $tmpUpdate);
>>           $solrDocs[] = $doc;
>>     }
>>
>>     foreach (array_chunk($solrDocs, 500) AS $solrChunk) {
>>          $client->addDocuments($solrChunk);
>>     }
> I'm a little fuzzy on php code, and I've never used this library.  Yes,
> I provided a patch for a bug, but that was pretty simple, and it was C
> code, not php.
>
> I know perl a whole lot better, but the two languages are pretty similar
> to each other.  If you've stepped through the contents of $solrDocs
> before trying to add it, and verified that it has the correct info, then
> the basic structure seems solid.
>
> One critical question is whether the request is making it to Solr, and
> what Solr is responding with.  You might need to resort to things like
> getting a sniffer trace with tcpdump or wireshark, which might involve
> switching to the actual IP address rather than localhost.
>
> Thanks,
> Shawn
>
>


Re: Got error: Filter execution threw an exception

Posted by Shawn Heisey <so...@elyograg.org>.
On 10/3/2013 8:03 PM, Brian Robinson wrote:
> Hi Shawn,
> Thanks for responding. Just saw this email. I did go to the logging tab
> in the admin page, but it never finished loading. I'm using collection1,
> and I'm using the traditional config. Here is my complete code, with
> $options omitted for security:

It sounds like the logging for Solr is not set up properly, or that you
are using a binding that the logging tab doesn't know how to work with.
 The fact that you're on port 8080 probably means that you're running
under a servlet container other than the Jetty which ships in the Solr
example, so logging is not very straightforward.  It's strongly
recommended that you run Solr under the included Jetty, because all
these issues have been worked out.

There is a lot of info on the following wiki page on how to get logging
working correctly with the changes in Solr 4.3.0 and later:

http://wiki.apache.org/solr/SolrLogging

If you already understand how to deal with logging using your servlet
container, you might want to follow the instructions there for switching
to java.util.logging, which in many cases will let the container control
it all.

> $options = array
> (
>     'hostname' => 'localhost',
>     'login'    => 'XXXXX',
>     'password' => 'XXXXX',
>     'port'     => '8080',
> );
> 
> $client = new SolrClient($options);
> 
>    $lastUpdate = '2013-09-31';
>    $prod_result = $db_connect->query("
>        SELECT DISTINCT p.id, p.prodName, p.brand, bi.brandName,
> p.description, p.lastUpdate
>        FROM product_CJ p
>        INNER JOIN brands_inactive bi ON bi.feedID = p.brand
>        WHERE p.showProd='Y' AND p.lastUpdate > ? LIMIT 0, 1",
>        array($lastUpdate)
>    );
> 
>    $docArray = array();
>    while ($prod_row = $prod_result->fetchRow(DB_FETCHMODE_ASSOC)) {
>        $docArray[$prod_row['id']] = $prod_row;
>    }
> 
>    $solrDocs = array();
>    foreach ($docArray AS $prod_row) {
>          $tmpProdID = $prod_row['id'];
>          $doc = new SolrInputDocument();
>          $doc->addField('id', $tmpProdID);
>          $doc->addField('prodName', $prod_row['prodName']);
>          $doc->addField('brand', $prod_row['brand']);
>          $doc->addField('brandName', $prod_row['brandName']);
>          $doc->addField('description', $prod_row['description']);
>          $tmpUpdate = $prod_row['lastUpdate']."T00:00:00Z";
>          $doc->addField('lastUpdate', $tmpUpdate);
>          $solrDocs[] = $doc;
>    }
> 
>    foreach (array_chunk($solrDocs, 500) AS $solrChunk) {
>         $client->addDocuments($solrChunk);
>    }

I'm a little fuzzy on php code, and I've never used this library.  Yes,
I provided a patch for a bug, but that was pretty simple, and it was C
code, not php.

I know perl a whole lot better, but the two languages are pretty similar
to each other.  If you've stepped through the contents of $solrDocs
before trying to add it, and verified that it has the correct info, then
the basic structure seems solid.

One critical question is whether the request is making it to Solr, and
what Solr is responding with.  You might need to resort to things like
getting a sniffer trace with tcpdump or wireshark, which might involve
switching to the actual IP address rather than localhost.

Thanks,
Shawn


Re: Got error: Filter execution threw an exception

Posted by Brian Robinson <br...@socialsurgemedia.com>.
Hi Shawn,
Thanks for responding. Just saw this email. I did go to the logging tab 
in the admin page, but it never finished loading. I'm using collection1, 
and I'm using the traditional config. Here is my complete code, with 
$options omitted for security:


$options = array
(
     'hostname' => 'localhost',
     'login'    => 'XXXXX',
     'password' => 'XXXXX',
     'port'     => '8080',
);

$client = new SolrClient($options);

    $lastUpdate = '2013-09-31';
    $prod_result = $db_connect->query("
        SELECT DISTINCT p.id, p.prodName, p.brand, bi.brandName, 
p.description, p.lastUpdate
        FROM product_CJ p
        INNER JOIN brands_inactive bi ON bi.feedID = p.brand
        WHERE p.showProd='Y' AND p.lastUpdate > ? LIMIT 0, 1",
        array($lastUpdate)
    );

    $docArray = array();
    while ($prod_row = $prod_result->fetchRow(DB_FETCHMODE_ASSOC)) {
        $docArray[$prod_row['id']] = $prod_row;
    }

    $solrDocs = array();
    foreach ($docArray AS $prod_row) {
          $tmpProdID = $prod_row['id'];
          $doc = new SolrInputDocument();
          $doc->addField('id', $tmpProdID);
          $doc->addField('prodName', $prod_row['prodName']);
          $doc->addField('brand', $prod_row['brand']);
          $doc->addField('brandName', $prod_row['brandName']);
          $doc->addField('description', $prod_row['description']);
          $tmpUpdate = $prod_row['lastUpdate']."T00:00:00Z";
          $doc->addField('lastUpdate', $tmpUpdate);
          $solrDocs[] = $doc;
    }

    foreach (array_chunk($solrDocs, 500) AS $solrChunk) {
         $client->addDocuments($solrChunk);
    }



On 10/3/2013 8:46 PM, Shawn Heisey wrote:
> On 10/3/2013 6:02 PM, Brian Robinson wrote:
>> I'm using PHP Pecl to create my index, and am getting an error that I
>> can't figure out. I'm using Solr version 4.3.1.
>>
>> I know I'm supposed to provide the log errors, but strangely, I checked
>> solr.log in the apache-tomcat/logs/ directory, and the
>> apache-tomcat/logs/logs/ directory, and neither had an entry for the
>> errors I saw today. I also checked the catalina.2013-10-03.log, and that
>> also showed no errors. Is there another log I should be checking?
>>
>> The way I'm triggering this is by having my browser hit a PHP page with
>> the code. When I do that, a "Filter execution threw an exception" error
>> is shown on the page. Please let me know if I need to give further
>> information. Any help I can get would be appreciated.
> Checking your source code in the previous thread, I do not see how you
> created your solr client object.  A bunch of questions follow:
>
> Can you share your code that creates the client and the base URL that it
> uses?  Feel free to hide the hostname, but leave the rest of it alone so
> we can tell what's going on.  Are you using "collection1" or have you
> created your own?  Is it SolrCloud or a traditional config?
>
> Do you see anything in the Logging tab in the Solr UI?  It's not as
> useful as the actual log, but if you aren't seeing anything elsewhere,
> you might need to look there.
>
> Thanks,
> Shawn
>
>


Re: Got error: Filter execution threw an exception

Posted by Shawn Heisey <so...@elyograg.org>.
On 10/3/2013 6:02 PM, Brian Robinson wrote:
> I'm using PHP Pecl to create my index, and am getting an error that I
> can't figure out. I'm using Solr version 4.3.1.
> 
> I know I'm supposed to provide the log errors, but strangely, I checked
> solr.log in the apache-tomcat/logs/ directory, and the
> apache-tomcat/logs/logs/ directory, and neither had an entry for the
> errors I saw today. I also checked the catalina.2013-10-03.log, and that
> also showed no errors. Is there another log I should be checking?
> 
> The way I'm triggering this is by having my browser hit a PHP page with
> the code. When I do that, a "Filter execution threw an exception" error
> is shown on the page. Please let me know if I need to give further
> information. Any help I can get would be appreciated.

Checking your source code in the previous thread, I do not see how you
created your solr client object.  A bunch of questions follow:

Can you share your code that creates the client and the base URL that it
uses?  Feel free to hide the hostname, but leave the rest of it alone so
we can tell what's going on.  Are you using "collection1" or have you
created your own?  Is it SolrCloud or a traditional config?

Do you see anything in the Logging tab in the Solr UI?  It's not as
useful as the actual log, but if you aren't seeing anything elsewhere,
you might need to look there.

Thanks,
Shawn