opensearch-project / opensearch-php

Official PHP Client for OpenSearch
Other
110 stars 58 forks source link

[BUG] #112

Closed Dgame closed 1 year ago

Dgame commented 1 year ago

What is the bug?

We're hosting an OpenSearch Cluster in AWS and are using this package in an ECS Fargate Task to communicate with OpenSearch. It works for a couple of days but then, for some reason, it starts failing with cURL error 6: Could not resolve host. Here a log message:

{
    "message": "Request Failure:",
    "context": {
        "method": "POST",
        "uri": "https://<host>:443/_all/_search?from=0&size=30",
        "port": 443,
        "headers": {
            "Host": [
                "<host>"
            ],
            "Content-Type": [
                "application/json"
            ],
            "Accept": [
                "application/json"
            ],
            "User-Agent": [
                "opensearch-php/7.10.0 (Linux 4.14.296-222.539.amzn2.x86_64; PHP 8.1.13)"
            ]
        },
        "HTTP code": null,
        "duration": 0.00646,
        "error": "cURL error 6: Could not resolve host: <host>"
    },
    "level": 300,
    "level_name": "WARNING",
    "channel": "App",
    "datetime": "2022-12-23T12:25:22.128682+01:00",
    "extra": {}
}

We have no clue why this is spontaneous failing. Any ideas we could try?

How can one reproduce the bug?

This is still unclear. I happened after a few days where it worked.

What is the expected behavior?

That it works all the time without a curl failure.

What is your host/environment?

An AWS Fargate Task with PHP 8.2 and a AWS OpenSearch Cluster with Version 1.2.4

Do you have any screenshots?

Nope

Do you have any additional context?

Not yet

shyim commented 1 year ago

It can be anything. Looks like network issue

Dgame commented 1 year ago

It can be anything. Looks like network issue

Anything you might know we could try to narrow this down?

shyim commented 1 year ago

Does it work with just curl?

Dgame commented 1 year ago

Does it work with just curl?

We have a bastion host on that environment/region where the curl query works just fine.

shyim commented 1 year ago

Also when you call the curl in the Tasks? Is it in the same network and so

Dgame commented 1 year ago

That's the next thing we want to try but haven't setup the ssh connection yet. I've hoped that in the meantime you might have an idea we could try to gather more informations.

wbeckler commented 1 year ago

@Dgame have you made any progress or do you have any more context to share?

Dgame commented 1 year ago

Yes this can be closed. I'll give a longer explanation what the cause was in the evening. :)