-
Notifications
You must be signed in to change notification settings - Fork 964
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
connection Error #1088
Comments
@JulieVelghe can you paste the PHP code for the connection to Elasticsearch that you are using? Thanks. |
Hi,
where our host is like this: https://elastic:xxxxxxx@60724656c51546f09a55d9db65a2a127.eu-central-1.aws.cloud.es.io:9243 Then the first thing we do when we get to the page in our craft admin is a ping:
I do want to note, this code works on other machines. |
Is there perhaps some other program I need to have to be able to run this? Or any special php dll's? Or something to that extend? |
@JulieVelghe can you try to use the following configuration? use Elasticsearch\ClientBuilder;
$client = ClientBuilder::create()
->setHosts(['https://60724656c51546f09a55d9db65a2a127.eu-central-1.aws.cloud.es.io:9243'])
->setBasicAuthentication('elastic','xxxxxxx')
->build(); Moreover, are you sure the port is |
Try this if you are running on localhost. #1101 |
I'm sorry for the late answer.
Just tried both solutions, each on it's own and together. Neither worked.
As to why the port is 9243, it is the endpoint i've copied from my cloud
elastic configuration.
Op za 30 jan. 2021 om 23:02 schreef Özgür Can KARAGÖZ <
[email protected]>:
… Try this if you are running on localhost. #1101
<#1101>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1088 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALC6NKRRKJFFKXWPNR7MZPTS4R6WPANCNFSM4UZWLFWQ>
.
--
<[email protected]> *Julie Velghe*
Web Developer
Tondelierlaan 5 • 9000 Gent
t 09 310 20 70
[email protected] • www.cabinetc.be
|
Hello, any new views on this? It is still an issue.
Op vr 5 feb. 2021 om 12:28 schreef Julie Velghe ***@***.***>:
… I'm sorry for the late answer.
Just tried both solutions, each on it's own and together. Neither worked.
As to why the port is 9243, it is the endpoint i've copied from my cloud
elastic configuration.
Op za 30 jan. 2021 om 23:02 schreef Özgür Can KARAGÖZ <
***@***.***>:
> Try this if you are running on localhost. #1101
> <#1101>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1088 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ALC6NKRRKJFFKXWPNR7MZPTS4R6WPANCNFSM4UZWLFWQ>
> .
>
--
***@***.***> *Julie Velghe*
Web Developer
Tondelierlaan 5 • 9000 Gent
t 09 310 20 70
***@***.*** • www.cabinetc.be
--
***@***.***> *Julie Velghe*
Web Developer
Tondelierlaan 5 • 9000 Gent
t 09 310 20 70
***@***.*** • www.cabinetc.be
|
In ElasticSearchPhpHandler.php we have this: private function createPsr7Request(array $ringPhpRequest)
{
// fix for uppercase 'Host' array key in elasticsearch-php 5.3.1 and backward compatible
// https://github.com/aws/aws-sdk-php/issues/1225
$hostKey = isset($ringPhpRequest['headers']['Host'])? 'Host' : 'host';
// Amazon ES listens on standard ports (443 for HTTPS, 80 for HTTP).
// Consequently, the port should be stripped from the host header.
$parsedUrl = parse_url($ringPhpRequest['headers'][$hostKey][0]);
if (isset($parsedUrl['host'])) {
$ringPhpRequest['headers'][$hostKey][0] = $parsedUrl['host'];
} it also appears as if any client options (like skip SSL Verify) are dropped at this point as well (the reside in $request['client'] which is removed by the above method. |
Summary of problem or feature request
I've used this client to use elasticsearch in a craft cms website. To develop, I use mamp pro 4 for windows and github desktop to get my repo. I now got an error in my code, when trying to ping: no alive nodes in cluster. However, when calling my endpoint in lets say postman, I get an ok response. Also, getting the repo on my mac tower, again with mamp pro as local webhost, and sourcetree to fetch the repo, all seems well, no errors, nothing broken. Does anyone have a clue where to look for the issue?
Code snippet of problem
System details
os: windows 10
mamp 4.2.0
php 7.3.7
ES-PHP : ^7.6
The text was updated successfully, but these errors were encountered: