whatever host i input in the settings, the plugin doesn't like it.
i've tried numerous elasticsearch hosts, such as elastic.co , searchly.com
all i see is "There is a problem with connecting to your Elasticsearch host. You will need to fix it for ElasticPress to work."
for example:
https://site:[email protected]

you can see that the URL is correct.. but i'm unable to connect. any idea why? do you have a working URL that i can input to see if it's somehow just my setup that's not working (maybe a conflicting plugin?)
thanks
@ivankristianto can you test?
It return error 500: Requested resource only accessible by admin or system users
This is because the url have the basic authentication.
In wp_remote_request, we need to pass the Basic Authentication in $args, not in url.
This need patch.
I'm not replicating this issue and I've been using a URL with basic auth in it for months now. Perhaps the URL is otherwise malformed or contains incorrect credentials?
Are you using the latest .Zip from GitHub?
@brunocrosier Yes, I'm on latest (literally just ran git pull). Saved settings, worked fine. Ran an index, works great. Running wp elasticpress stats from CLI works, too.
@mattonomics do you use basic auth in the url as well?
@brunocrosier
Found out that searchly.com doesn't allow the plugin to query the Elasticsearch plugins:
GET /_nodes/plugins
{
"error": {
"root_cause": [
{
"type": "exception",
"reason": "Requested resource only accessible by admin or system users"
}
],
"type": "exception",
"reason": "Requested resource only accessible by admin or system users"
},
"status": 500
}
Please contact searchly.com administrator to allow your account to access the _nodes/plugins
And to use Basic Auth, you can define it from the wp-config.php
refer to: https://github.com/10up/ElasticPress#security
Hmmm, maybe we need to provide a way to check the ES connection aside from the plugin check. I wonder how common this setup is?
@tlovett1
I did create a fix for this issue where the username and password is in the url:
https://github.com/ivankristianto/ElasticPress/blob/fix/url-basic-auth/classes/class-ep-api.php#L2070-L2078
But i realize that we are using ES_SHIELD settings to use Basic Auth.
I don't know what other provider use this kind of settings, but searchly.com is one of them.
Let me know if you are interest to make this as a PR
I have issues too, since the last ElasticPress upgrade. I use SearchBox Elasticsearch on heroku, which also uses a searchly.com URL.
Edit: Tried @ivankristianto鈥檚 fix, but it did not work. Still the 500. Also tried it with the ES_SHIELD constant, but no success.
This has nothing to do with Basic Auth.
@FlorianBrinkmann @brunocrosier I'm going to push a patch for you to test.
Try that out ^
Still get an error 500. This is the endpoint URL from Heroku:
https://paas:[email protected]
Screenshot from Query Monitor:
Should work now. Just pushed a fix.
This works, thanks! I still get the 500 in the admin, but EP does not show an error message and I can sync.
Right. It's basically seeing the 500 and trying a different URL to check the ES version.
Hello, I have a similar problem.
I have a WP multisite environment with Woocommerce and has 3 sites. The dev environment (URL 1) had been running fine for months. Yesterday however I deactivated and archived a site and the ElasticPress plugin started returning, "An error occured while syncing". Many hours of reinstalling, deactiviating plugins did not fix the problem.
Attached is the debug output from, "EP Troubleshooting"
I then created another search space (URL 2) and thats working fine. When I switch back to URL 1 most of the time it will index once successfully but will return the "An error occured while syncing" if I click sync again. There is no isssue like this in URL 2.
Below are the credentials from my dev environment,
URL 1: https://site:[email protected]
URL 2: https://site:[email protected]
The number of documents being index is around 300 (in total for all sites), all which are small (less than 100kb in size).
Thanks
Regards,
Sumudu
Most helpful comment
Try that out ^