laravel-scout-elasticsearch
laravel-scout-elasticsearch copied to clipboard
[BUG] php artisan scout:import not importing
Describe the bug I have an ElasticSearchServiceProvider in my app/Providers directory.
The client build is made as follow:
$client = ClientBuilder::create()
->setHosts([ 'http://'.env('ELASTICSEARCH_HOST').':'.env('ELASTICSEARCH_PORT') ])
->setBasicAuthentication(env('ELASTICSEARCH_USER'), env('ELASTICSEARCH_PASS'))
->build();
If I add the following code to my provider:
$response = $client->info();
dd($response->getStatusCode());
I get 200
, so I think the elascticSearch server is totally OK.
But when I use php artisan scout:import "App\Models\MyModel"
in my console, I have the following error:
In SimpleNodePool.php line 77:
No alive nodes. All the 1 nodes seem to be down.
Do you know why? Am I missing something?
Thanks for your help, again.
Could you share your elasticsearch provider?
i am having same issue.
i can curl and get a repsonse but thorugh php it does not work
% curl https://localhost:8081/_search -k
{"took":9,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":1.0,"hits":[{"_index":".kibana_1","_type":"_doc","_id":"config:7.10.2","_score":1.0,"_source":{"config":{"buildNum":36156},"type":"config","references":[],"migrationVersion":{"config":"7.9.0"},"updated_at":"2022-09-30T08:31:02.869Z"}}]}}%
Elasticsearch\Common\Exceptions\NoNodesAvailableException
No alive nodes found in your cluster
at vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:64
60▕ return $connection;
61▕ }
62▕ }
63▕
➜ 64▕ throw new NoNodesAvailableException("No alive nodes found in your cluster");
65▕ }
66▕
67▕ public function scheduleCheck(): void
68▕ {
+53 vendor frames
54 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Did you add your Provider to the provider's list on the config file?
it was problem with https. I had to switch to http