-
Notifications
You must be signed in to change notification settings - Fork 981
Error: Cannot use object of type Elasticsearch\Common\Exceptions\Missing404Exception as array #831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you paste the full exception stack, so I can see where it's originating from? |
|
I am also facing this type of issue. Please any help? |
I hope , This will helps, @hazrat84 and @yochanan-gurovich I find out temporary solution, go to this file
|
I have the same problem here, is a patch available? |
@yochanan-gurovich, @Thomblin, @ERajkumar, @hazrat84 I just tested the following code with require 'vendor/autoload.php';
use Elasticsearch\ClientBuilder;
try {
$hosts = [
'https://elastic:password@xxx.europe-west1.gcp.cloud.es.io:9243'
];
$client = ClientBuilder::create()->setHosts($hosts)->build();
$params = [
'index' => 'products',
'type' => 'default',
'id' => 'non_existant_id'
];
$response = $client->get($params);
var_dump($response);
} catch (\Exception $e) {
echo $e->getMessage();
} I have this message output from the catch: {
"error": {
"root_cause": [
{
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_expression",
"resource.id": "products",
"index_uuid": "_na_",
"index": "products"
}
],
"type": "index_not_found_exception",
"reason": "no such index",
"resource.type": "index_expression",
"resource.id": "products",
"index_uuid": "_na_",
"index": "products"
},
"status": 404
} Can you try on your side and let me know? Thanks! |
Closing due to inactivity. I'll reopen it if needed |
It seems the bug is not fixed
I also ran into this error today |
I'm facing this error after upgrading to 7.8 from 5.6:
Temporarily fixed using this patch: //onFailure
function ($response) {
// Ignore 400 level errors, as that means the server responded just fine
if ($response instanceof Exceptions\Missing404Exception) {
if ($response->getCode() >= 400 && $response->getCode() < 500) {
// Otherwise schedule a check
$this->connectionPool->scheduleCheck();
}
} else {
if (!(isset($response['code']) && $response['code'] >= 400 && $response['code'] < 500)) {
// Otherwise schedule a check
$this->connectionPool->scheduleCheck();
}
}
} Looks like this is a regression of #676. |
Trying to get a document by an ID that does not exist.
Code is in a try / catch block, and is caught.
The above error is thrown still.
Code snippet (username, password and host are masked):
The text was updated successfully, but these errors were encountered: