An error occurred when searching for “Zen and the Art of Motorcycle Maintenance”

This error occurs when I click search course

I checked other posts about updating the course index, so I ran tutor local run CMS/ manage. py cms reindex_ Course --all --setup, but this doesn’t work and the command line displays this error

Hi @hijulien-gan,
Looks like the LMS was unable to connect to Elasticsearch. Please check that the Elasticsearch service is up and running, and that it is properly configured.

tutor local status can help. This is normal output for elasticsearch:

$ tutor local status
                 Name                                Command                 State                      Ports                
tutor_local_elasticsearch-permissions_1   setowner 1000 /usr/share/e ...   Exit 0                                            
tutor_local_elasticsearch_1               /tini -- /usr/local/bin/do ...   Up           9200/tcp, 9300/tcp                   

Try also tutor local logs elasticsearch to see if any error shows up.

This is mine. It seems that there is no problem

tutor_local-elasticsearch-1               "/tini -- /usr/local…"   elasticsearch               running             9300/tcp
tutor_local-elasticsearch-permissions-1   "setowner 1000 /usr/…"   elasticsearch-permissions   exited (0)     

I read this post, but I can’t find the file he said which named studio.yml,Elasticsearch Connection Refused - #2 by Zia_Fazal
Please forgive me, I am a Chinese, my English is not good

No worries!

By default ES should run on port 9200. But your service is running in 9300. Check if in your config you made any change to the ES port.

I haven’t modified these configurations. Now there are two ports, one is 9200 and the other is 9300. Would you please tell me how to modify them

cd5b59eeccde   elasticsearch:7.10.1           "/tini -- /usr/local…"   5 days ago     Up 9 hours    9200/tcp, 9300/tcp 

Another thing you can test it to connect manually to ES from the LMS, by running a curl elasticsearch:9200.
You should get something like this:

$ tutor local run lms bash
app@71baffd71f6f:~/edx-platform$ curl elasticsearch:9200
  "name" : "89086da9ce34",
  "cluster_name" : "openedx",
  "cluster_uuid" : "cptPPxMyTD-l1flY7-KkAg",
  "version" : {
    "number" : "7.10.1",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa",
    "build_date" : "2020-12-05T01:00:33.671820Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  "tagline" : "You Know, for Search"

OK, thank you very much. I’ll try it now

Had some nasty problems with Elasticsearch, finally I stopped Tutor, removed everything related to ES (docker remove | docker rmi | removed folder /srv/tutor/data/elasticsearch) and had “tutor local quickstart” perform its magic :grin:

Thank you. I will delete the image and file you mentioned and restart it. Will elasticsearch download it again? Because my network is not good recently, it will take me a day to try it myself

Yes, Tutor will download and install the docker image again, and create all the indices after.

Oh,Thank you very much,I will have a try now!