Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Magento 2 Quickstart doesn't work "couldn't validate opensearch" #4762

Closed
1 task done
bharatk101-dckap opened this issue Mar 17, 2023 · 9 comments
Closed
1 task done

Comments

@bharatk101-dckap
Copy link

bharatk101-dckap commented Mar 17, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Run a Diagnostic and Paste Link Here

DDev Debug test file - https://gist.github.com/bharatk101-dckap/1e66df93732d1da9f7722e2fbfacc437

Expected Behavior

I installed ddev on my machine and used Magento 2 Quickstart steps to install latest Magento version but I got the error while setting up the magento. Magento setup should complete without any error

Actual Behavior

image

Steps To Reproduce

  1. Go to 'Magento 2 Quickstart'
  2. Run commands step by step
  3. Run ddev magento setup command bin/magento setup:install --db-host=db --db-name=db --db-user=db --db-password=db --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US
  4. See error

Anything else?

No response

@rfay
Copy link
Member

rfay commented Mar 17, 2023

Thanks! It's too hard to look at your output as a screenshot, please edit to show the full output of the problem command, thanks! You could add it as a separate file in your gist if you want to as well.

@rfay
Copy link
Member

rfay commented Mar 17, 2023

I don't get as far as you got:

$ ddev magento setup:install --base-url='https://junk.ddev.site/' --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db --elasticsearch-host=elasticsearch --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US
Warning: require(/var/www/html/setup/config/application.config.php): Failed to open stream: No such file or directory in /var/www/html/vendor/magento/framework/Console/Cli.php on line 79
Failed to run magento setup:install --base-url=https://junk.ddev.site/ --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db --elasticsearch-host=elasticsearch --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US: exit status 1

@rfay
Copy link
Member

rfay commented Mar 17, 2023

@cmuench could you validate the Magento2 quickstart and give us a little guidance here? Seems some things have shifted in Magento 2.4.6?

@rfay
Copy link
Member

rfay commented Mar 17, 2023

OK, I removed vendor dir and then did ddev composer install again, and now can get your error @bharatk101-dckap

Could not validate a connection to the OpenSearch. No alive nodes found in your cluster

@rfay rfay changed the title Magento 2 setup gives an error, couldn't validate opensearch [docs] Magento 2 Quickstart doesn't work "couldn't validate opensearch" Mar 17, 2023
@bharatk101-dckap
Copy link
Author

image

Here's the error
`[Progress: 663 / 1332]
[Progress: 664 / 1332]
Installing search configuration...

In SearchConfig.php line 81:

Could not validate a connection to the OpenSearch. No alive nodes found in
your cluster

Failed to run magento setup:install --base-url=https://docker.magento.com/ --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db --elasticsearch-host=elasticsearch --admin-firstname=Magento --admin-lastname=User --admin-email=bharatkulkarni@dckap.com --admin-user=admin --admin-password=admin@123 --language=en_US: exit status 1

`

@cmuench
Copy link
Collaborator

cmuench commented Mar 18, 2023

@bharatk101-dckap Can you try to add the option --search-engine=elasticsearch7

In my Magento 2 Demo I use this:
--search-engine=elasticsearch7 --elasticsearch-host=elasticsearch --elasticsearch-port=9200.

@rfay
Copy link
Member

rfay commented Mar 18, 2023

I confirm that changing the quickstart to
ddev magento setup:install --base-url='https://ddev-magento2.ddev.site/' --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db --elasticsearch-host=elasticsearch --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --search-engine=elasticsearch7

makes it succeed.

@rfay
Copy link
Member

rfay commented Mar 18, 2023

However, then we get one step farther and

$ ddev magento module:disable Magento_TwoFactorAuth
Unable to change status of modules because of the following constraints:
Cannot disable Magento_TwoFactorAuth because modules depend on it:
Magento_AdminAdobeImsTwoFactorAuth: Magento_AdminAdobeImsTwoFactorAuth->Magento_TwoFactorAuth
Failed to run magento module:disable Magento_TwoFactorAuth: exit status 1

What do we have to do to fix that @cmuench ? Thanks!

@cmuench
Copy link
Collaborator

cmuench commented Mar 18, 2023

The Magento_AdminAdobeImsTwoFactorAuth module was introduced in 2.4.6.
The following script work on my machine.

mkdir ddev-magento2 && cd ddev-magento2
ddev config --project-type=magento2 --php-version=8.1 --docroot=pub --create-docroot --disable-settings-management
ddev get ddev/ddev-elasticsearch
ddev start
ddev composer create --repository=https://repo.magento.com/ magento/project-community-edition -y
rm -f app/etc/env.php

# Change the base-url below to your project's URL
ddev magento setup:install --base-url='https://ddev-magento2.ddev.site/' --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db --elasticsearch-host=elasticsearch --search-engine=elasticsearch7 --elasticsearch-port=9200 --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US

ddev magento deploy:mode:set developer
ddev magento module:disable Magento_TwoFactorAuth Magento_AdminAdobeImsTwoFactorAuth
ddev config --disable-settings-management=false

I will create a pull request for the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants