Hello,
I am installing Magento 2.4.3 Open source on my local Xampp server. However, the installation wont complete then I am receiving the following error message:
-------
"search engine 'elasticsearch8' is not an available search engine"
--------
I am running the following commands in CLI.
--------------------
php bin/magento setup:install --base-url=http://localhost/mage2rock --db-host=localhost --db-name=magento --db-user=root --db-password= --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=Elasticsearch8 --elasticsearch-host="localhost" --elasticsearch-port=9200 --elasticsearch-enable-auth=true
-------------------
Anyone have any idea what could be the issue? Thank you.
Solved! Go to Solution.
I am unsure of How are you installing Magento! @infoianmed1665 Let me know if we can connect somehow, and I can help you solve the installation issue.
I am also a business practitioner and solution analyst; the steps I have shared are all given valid and follow the Magento process. But if still, you are getting errors, and there might be some reason for this.
Let me know if you want me to assist you. Thank you.
Hi @infoianmed1665 ,
Magento 2.4.3 doesn't support elasticsearch8! So, you need to install elasticsearch7.X or 6.X in your local.
Here are a few possibilities you need to check to troubleshoot:
Verify Elasticsearch Installation: As my first guess goes, Magento 2.4.3 does not support Elasticsearch8. Ensure that you have installed Elasticsearch version 7.x or 6.x on your local XAMPP server.
Confirm Elasticsearch Service Status: Check if the Elasticsearch service is running properly on your local XAMPP server. You can verify this by accessing the Elasticsearch URL in your web browser (e.g., http://localhost:9200). If Elasticsearch is running, you should see a JSON response with version information.
Adjust the Elasticsearch Engine Setting: In your installation command, replace "Elasticsearch8" with "Elasticsearch6" or "Elasticsearch7," depending on the version you have installed. The search engine parameter should match the Elasticsearch version you are using.
Verify Elasticsearch Connection Details: Double-check the Elasticsearch host and port values in your installation command. Ensure they match the configuration of your local Elasticsearch installation. By default, Elasticsearch runs on localhost (127.0.0.1) and port 9200.
After making these adjustments, try running the installation command again and see if the error persists.
If the issue persists, please provide any relevant error logs or additional information that could help further diagnose the problem. Or you should be fine with this solution.
Hello @infoianmed1665
You have to install elasticsearch7 not elasticsearch8.
Then run below command
bin/magento setup:install --base-url=http://localhost/mage2rock --db-host=localhost --db-name=magento --db-user=root --db-password= --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200
Thanks
Thank you for your reply. I have completed the steps described in your reply. I have now installed ElasticSearch7.16.2. The ElasticSearch error seems to be gone for now. However, the installation has errors. I am getting the errors below.
---
In Mysql.php line 109:
SQLSTATE[42S02]: Base table or view not found: 1932 Table 'magento.flag' doesn't exist in engine, query was: DESCRIBE `flag`
In Mysql.php line 90:
SQLSTATE[42S02]: Base table or view not found: 1932 Table 'magento.flag' doesn't exist in engine
---
I am stuck for now. Any ideas/solutions will be much appreciated.
It shows the "flag" table is missing in the CLI command. Check the database and verify if the "flag" table is missing.
Then run the database upgrade command in your installation dir, clear the cache, and again install Magento.
You should be fine with it.
Thank you for your suggestion and solution proposal. I have checked in phpMyadmin and indeed I can see that the table "flag" does exist but when you click on it you get the following error message:
"#1932 -Table 'magento.flag' doesn't exist in engine".
To be honest, I am not sure how to go about upgrading the database. Could you please provide explicit commands that I need to run to upgrade the mySQL database, clear cache in Xampp?
Sorry for bothering. If you this is not clear and need further info, please let me know.
Thank you in advance for your response.
o explicitly upgrade the Magento database and clear the cache in XAMPP, please follow these steps:
Upgrade the Database:
Open a command prompt or terminal.
Navigate to your Magento installation directory.
Run the following command:
php bin/magento setup:upgrade
This command triggers the database upgrade process in Magento and ensures that all necessary tables, including the flag table is created or updated.
Clear the Cache:
In the command prompt or terminal, while still in the Magento installation directory, run the following command:
php bin/magento cache:clean
This command clears the cache in Magento, ensuring caching.
Thank you again for your response. I have tried your upgrade commands but those won't solve my problem.
So I decided to drop all the tables in the Magento MySQL database so that I can install from scratch. When I try to install am getting this error message below even though the database is empty.
---
In Mysql.php line 109:
SQLSTATE[HY000]: General error: 1813 Tablespace for table '`magento`.`setup_module`' exists. Please DISCARD the tablespace befor
e IMPORT, query was: CREATE TABLE IF NOT EXISTS `setup_module` (
`module` varchar(50) NOT NULL COMMENT 'Module' ,
`schema_version` varchar(50) NULL COMMENT 'Schema Version' ,
`data_version` varchar(50) NULL COMMENT 'Data Version' ,
PRIMARY KEY (`module`)
) COMMENT='Module versions registry' ENGINE=innodb charset=utf8 COLLATE=utf8_general_ci
In Mysql.php line 90:
SQLSTATE[HY000]: General error: 1813 Tablespace for table '`magento`.`setup_module`' exists. Please DISCARD the tablespace befor
e IMPORT
---
My background is in business and technical and need to prepare for a Magento project which will start in 10 days time so I hope you understand. I don't want to give up but the Magento installation issue is surely testing my patience. Anybody else have ideas on how to fix my issue?
I can understand your situation. Here's the solution that my dev team is following:
Please delete the app/etc/env.php file.
Then run the below command
php bin/magento setup:install --base-url="http://localhost/mag24/" --db-host="localhost" --db-name="mag24" --db-user="root" -db-password="root123" --admin-firstname="admin" --admin-lastname="admin" --admin-email="admin@admin.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"
Please change the database credentials and URL in the given command as per yours.
Thanks again for your suggestion. I couldn't find such a file env.php in Xampp.
Now when I run the Magento installation command you provided, I am getting this error message. The installation runs for several minutes before it stops due to this error.
----
But when I run the code "curl -X GET 'http://localhost:9200' check on the installation of Elasticsearch in CLI, I am getting this error.
---
At line:1 char:2
+ - curl -X GET 'http://localhost:9200'
+ ~
Missing expression after unary operator '-'.
At line:1 char:3
+ - curl -X GET 'http://localhost:9200'
+ ~~~~
Unexpected token 'curl' in expression or statement.
+ CategoryInfo : ParserError: ( [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
----
I hope someone can spot the mistake and suggest a solution. Thanks a million times.