Can't install magento via cli command
Got error:
Installing search configuration...
In SearchConfig.php line 81:
Could not validate a connection to Elasticsearch. No alive nodes found in y
our cluster
php7.3.13
But i got success installl by web wizard install
Hi @mrtuvn. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Add a comment to Assigning an issue: @magento I am working on this
May not related with magento. Possible relate with setup enviroments
Hi @engcom-Echo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @mrtuvn. Thank you for your report.
Could not validate a connection to Elasticsearch - it is well.
But I got success to install by web wizard install - it's weird - you were to get the following result :
I think this is a browser cache - accordingly, the check was not performed.
But I got success to install by web wizard install
Unfortunately, I was not able to reproduce this behavior.
Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest 2.4-develop
branch. Thank you for collaboration.
@engcom-Echo Why close this issue ?
I only got issue in cli mode ! No problem with web wizard install
Tested in my local with Nginx1.16 + elasticsearch 7.7 + php7.4
When i recheck codebase i found seem magento want to remove wizard install in 2.4.0
https://github.com/magento/magento2/blob/2.4-develop/setup/src/Magento/Setup/Model/SearchConfig.php
Above link is latest changed related with my issue
Here is screenshot show problem
Hi @mrtuvn. Thank you for your report.
- Could not validate a connection to Elasticsearch - it is well.
- But I got success to install by web wizard install - it's weird - you were to get the following result :
I think this is a browser cache - accordingly, the check was not performed.But I got success to install by web wizard install
Unfortunately, I was not able to reproduce this behavior.Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest2.4-develop
branch. Thank you for collaboration.
Error because you put wrong elasticsearch hostname. This issue not happen with me. Only get issue in cli
Hi @mrtuvn.
Unfortunately, I was not able to reproduce:
This issue out occurs if Elasticsearch is configured incorrectly :
Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest 2.4-develop
branch. Thank you for collaboration.
@engcom-Echo i have checked my enviroment again
Everything fits with magento requirements
Elasticsearch 7.2
setup by warden enviroment warden.dev
php 7.4 nodejs 12
can you tell me why this set configured incorrectly ? My instance up and ready only the install step via cli failed caused by elasticsearch
If i commented the line https://github.com/magento/magento2/blob/2.4-develop/setup/src/Magento/Setup/Model/SearchConfig.php#L69
The installation process success without throw exception.
I also have this problem. I was just wanting to test something on the latest 2.4 development branch to see if the issue has been fixed. I don't have (or want) elastic search. The web setup wizard seems to be removed on the version I'm testing, so I'm forced to use the command line. The command line install gives the error mentioned above "Could not validate a connection to Elasticsearch. No alive nodes found in your cluster". What would I have to do to get round this ? It seems that Magento 2.4 is now dependent on elastic search ? Is that correct ?
Looks like that is correct. Magento 2.4 installation is now dependent on having Elastic search. The mysql option has been removed.
I am having the same issue..
VERSION="2.4-develop"
BASE_URL=https://my-web/
DB_HOST=localhost
DB_NAME=db
DB_USER=usr
DB_PASS=pass
ADMIN_FORNAME=Magento
ADMIN_LASTNAME=User
[email protected]
ADMIN_USER=admin
ADMIN_PASS=pass
DEFAULT_LANG=en_US
DEFAULT_CURR=EUR
DEFAULT_TIMEZONE=Europe/Bratislava
echo "removing old magento"
rm -rf magento2
git clone -b $VERSION https://github.com/magento/magento2
mysql -u $DB_USER -p$DB_PASS $DB_NAME < removetables.sql
mkdir magento2/var/composer_home
cp auth.json magento2/var/composer_home/auth.json
cd magento2
composer config repositories.magento composer https://repo.magento.com/packages.json
composer update
php bin/magento setup:install --base-url=$BASE_URL --db-host=$DB_HOST --db-name=$DB_NAME --db-user=$DB_USER --db-password=$DB_PASS --admin-firstname=$ADMIN_FORNAME --admin-lastname=$ADMIN_LASTNAME --admin-email=$ADMIN_EMAIL --admin-user=$ADMIN_USER --admin-password=$ADMIN_PASS --language=$DEFAULT_LANG --currency=$DEFAULT_CURR --timezone=$DEFAULT_TIMEZONE --use-rewrites=1
I DO NOT WANT TO USE ELASTIC SEARCH.
Elastic search just takes a lot of ram for my server, and I do not want Magento if it is dependend on elastic search.
I confirm that setup wizard seems to be removed and Magento 2.4 requires a valid Elasticsearch connection during the installation process. There is something in the documentation about this change.
You can declare the Elasticsearch credentials with these parameters: --elasticsearch-host=elasticsearch --elasticsearch-username=elastic --elasticsearch-password=changeme
. But on my side, I face another issue related to the format while important the sample data. 😕
Elasticsearch 7.6+ is required. I saw the 'Could not validate a connection' message as above while running Elasticsearch 7.2, and resolved via:
brew upgrade elastic/tap/elasticsearch-full
elasticsearch -d
then re-running setup:install
. I didn't need to pass in any --elasticsearch
parameters.
My local configuration of ES is I think just a vanilla install.
Seem we have some people got same problem here not only mine. Possible real problem
Can we reopen this ? @engcom-Echo
Noted in have to temporary comment oneline in codebase (setup script) inorder to pass through cli installation without get any exception
Try this command :
php -dmemory_limit=-1 bin/magento setup:install --base-url=http://127.0.0.1/m24 --db-host=localhost --db-name=m24 --db-user=root --db-password=root --admin-firstname=admin --admin-lastname=admin [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=mysql
set this option : --search-engine=mysql
Try this command :
php -dmemory_limit=-1 bin/magento setup:install --base-url=http://127.0.0.1/m24 --db-host=localhost --db-name=m24 --db-user=root --db-password=root --admin-firstname=admin --admin-lastname=admin [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=mysql
set this option :
--search-engine=mysql
In SearchConfig.php line 97:
Search engine 'mysql' is not an available search engine.
I was having the same problem, after 2 days I found the problem was in --elasticsearch-host = 127.0.0.1, I did that and the installation continued normally.
magento setup:install --base-url=http://192.168.0.197/ocean/ \
--db-host=localhost --db-name=banco --db-user=admin --db-password=mypass \
--admin-firstname=admin --admin-lastname=meir [email protected] \
--admin-user=admin --admin-password=mypass --language=pt_BR \
--currency=BRL --timezone=America/Sao_Paulo --use-rewrites=1 \
--search-engine=elasticsearch7 --elasticsearch-host=127.0.0.1 \
--elasticsearch-port=9200
Having a same issue .. any solution ??
Having a same issue .. any solution ??
(I'm a noob and an advanced DIYer)
I found a video in YouTube. Showed install step by step. Elasticsearch worked. But magento didn't work properly. Then I learned about elasticsearch search using elastic cloud free trial. Installed on Magento 2.3.5. you can get some insight about how it works and later how to install with cli. If it's in external server.
I think if I keep trying I can make it work. But already lost 2 days with this. And will probably be much more with the extensions not supporting 2.4
Development and 3rd party documentation is very slow with magento. Most don't like to upgrade because it breaks so easily. I think most stores are still in deprecated 1.9 ...
My desition was to wait a few months and stay in 2.3.5p2.
Btw. Algolia search is waaaay better than elastic. And well priced.
Some comments here suggest to cancel the search engine all together. That was my next step to try. Using Algolia. Maybe it works fine.
I have unblocked 9200 port from UFW and it worked
If you want to test something on Magento 2.4.0, without having Elasticsearch running, you can edit vendor/magento/module-elasticsearch/Setup/Validator.php
and make it return empty array like below.
public function validate(): array
{
return $errors = [];
try {
$client = $this->clientResolver->create();
if (!$client->testConnection()) {
$errors[] = 'Could not validate a connection to Elasticsearch.'
. ' Verify that the Elasticsearch host and port are configured correctly.';
}
} catch (\Exception $e) {
$errors[] = 'Could not validate a connection to Elasticsearch. ' . $e->getMessage();
}
return $errors;
}
He desbloqueado el puerto 9200 de UFW y funcionó
Hi, can you tell me how you had configured elasticsearch "localhost or IP" and what version you have.
I have elasticsearch 7.8.1, I have kibana and cerebor connected, both marked green in elasticsearch and both marked local. They work perfectly, however I can't install Magento 2.4 because of the
——
In SearchConfig.php line 81:
Could not validate a connection to Elasticsearch. No alive nodes found in your cluster
———
Someone has managed to solve the problem.
this is my installation configuration part of elasticsearch
--search-engine=elasticsearch7
--elasticsearch-host=https://localhost
--elasticsearch-port=9200
--elasticsearch-enable-auth=1
--elasticsearch-username=elastic
--elasticsearch-password=@elastic123#
I'm hesitating:
--search-engine=elasticsearch7
Is that right?
@puntable Thanks, good solution, for all who do not use Sample Data! Installation of sample data fails without Elastic.
nstallation of sample data fails without Elastic.
@netzkollektiv I have Elastic configured but still installation of sample data fails.
Most helpful comment
I was having the same problem, after 2 days I found the problem was in --elasticsearch-host = 127.0.0.1, I did that and the installation continued normally.
magento setup:install --base-url=http://192.168.0.197/ocean/ \
--db-host=localhost --db-name=banco --db-user=admin --db-password=mypass \
--admin-firstname=admin --admin-lastname=meir [email protected] \
--admin-user=admin --admin-password=mypass --language=pt_BR \
--currency=BRL --timezone=America/Sao_Paulo --use-rewrites=1 \
--search-engine=elasticsearch7 --elasticsearch-host=127.0.0.1 \
--elasticsearch-port=9200