when running some command in magento 2.4.3 such as "setup: upgrade" an error is generated in elasticsearch how can I solve this? I'll put pictures below.
-
You mean before setup:upgrade elasticsearch is running and status is active? Because now I see elasticsearch is down. Also what version of elasticsearch you using?– StratocasterCommented Jan 10, 2022 at 8:47
-
I meant that it seems to work, however when I run a magento command like setup:upgrade it stops working and stays that way.– 1322Lucas12123Commented Jan 10, 2022 at 14:45
-
So what Elasticsearch version you are using?– StratocasterCommented Jan 11, 2022 at 6:15
-
i use version 7.9– 1322Lucas12123Commented Jan 11, 2022 at 6:43
-
What version are set in admin configuration? Should be Elasticsearch7.– StratocasterCommented Jan 11, 2022 at 6:46
3 Answers
It's a issue of elastic search connection. to test it just goto admin -> Store -> Configuration -> Catalog -> Catalog Search then you can see elastic search details like host and port.
so just run "curl -XGET [host]:[port]" and you will able to identify that connection is not working or not
-
yes it is working, however if I run setup:upgrade it stops. Commented Jan 10, 2022 at 14:44
You can simply try to restart Elasticsearch first: For example on Ubuntu:
sudo service elasticsearch restart
If it still not working, try to debug with error message shown on the terminal.
-
it to run elasticsearch every time setup:upgrade is run. ): Commented Jan 10, 2022 at 14:44
Maybe your elasticsearch is broken in some way. Could try to reinstall it. Or you could use https://github.com/duydo/evm . Very good tool, can switch Elasticsearch version if required. Also easy to run. Remove your current ES and install this one. Try to use it. If same problem, try to look for custom modules, that maybe try to reindex something to elasticsearch. Disable it and try again.