php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70495 Failed to parse 500 error response when it lacks msg JSON RW
Submitted: 2015-09-15 00:52 UTC Modified: 2015-09-26 00:55 UTC
From: omars@php.net Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: omars@php.net
New email:
PHP Version: OS:

 

 [2015-09-15 00:52 UTC] omars@php.net
Description:
------------
Failed to parse solr response on 500 responses from Solr Server using JSON or PHPS response writer.
Throwing SolrClientException with raw response instead of SolrServerException

Test script:
---------------
require_once "bootstrap.inc";
$options = array
(
        'hostname' => SOLR_SERVER_HOSTNAME,
        'login'    => SOLR_SERVER_USERNAME,
        'password' => SOLR_SERVER_PASSWORD,
        'port'     => SOLR_SERVER_PORT,
        'path'     => SOLR_SERVER_PATH,
        'wt'       => 'json'
);

$client = new SolrClient($options);

$query = new SolrQuery('*:*');

$func = new SolrCollapseFunction('manu_id_s');

$func->setMax('sum(cscore(),field(manu_id_s))');
$func->setSize(100);
$func->setNullPolicy(SolrCollapseFunction::NULLPOLICY_EXPAND);

$query->collapse($func);
try {
    $queryResponse = $client->query($query);
} catch (SolrServerException $e) {
    printf("Exception code %d", $e->getCode());
    assert(strlen($e->getMessage()) > 0, 'Exception message is empty');
}

Expected result:
----------------
Exception code 500

Actual result:
--------------
Notice: SolrClient::query(): Unable to find message in error response zval
Uncaught SolrClientException with raw response

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-15 00:54 UTC] omars@php.net
-Summary: Failed to parse 500 error response when Solr it lacks msg JSON/PHPS RW +Summary: Failed to parse 500 error response when Solr it lacks msg JSON RW -Assigned To: +Assigned To: omars
 [2015-09-15 01:42 UTC] omars@php.net
-Summary: Failed to parse 500 error response when Solr it lacks msg JSON RW +Summary: Failed to parse 500 error response when it lacks msg JSON RW
 [2015-09-26 00:55 UTC] omars@php.net
-Status: Assigned +Status: Closed
 [2015-09-26 00:55 UTC] omars@php.net
fixed on master, to be released on version 2.2.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC