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

bin/mftf throws Faild to connect error #1290

Open
pradeepkanaka opened this issue Feb 6, 2025 · 5 comments
Open

bin/mftf throws Faild to connect error #1290

pradeepkanaka opened this issue Feb 6, 2025 · 5 comments
Labels

Comments

@pradeepkanaka
Copy link

pradeepkanaka commented Feb 6, 2025

What could be the reason for this issue?

Image

I can browse the URL https://magento.test/

Copy link

dosubot bot commented Feb 6, 2025

Hello @pradeepkanaka! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue.

I found a similar open issue where a suggested solution involves configuring extra_hosts in your Docker setup:

extra_hosts: &appextrahosts
  - "magento.test:172.17.0.1"

Make sure to uncomment all extra_hosts: *appextrahosts lines in your configuration. After making these changes, restart your Docker setup. Additionally, ensure that you are using HTTPS by setting MAGENTO_BASE_URL=https://magento.test [1].

Common causes for connectivity issues to magento.test on port 443 include incorrect port mapping, missing extra_hosts configuration, SSL certificate issues, or incorrect Docker network settings. Ensure that your compose.yaml file maps the correct ports and that your SSL certificates are properly set up [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the bug label Feb 6, 2025
@pradeepkanaka
Copy link
Author

pradeepkanaka commented Feb 7, 2025

@dosu

Getting below error when running bin/mftf doctor

Connecting to Selenium Server ...

[OK] Successful

Loading Admin page ...

[ERROR] Failed to load page at url: https://magento.test/admin/admin
Please check Selenium Browser session have access to Magento instance.

Image

Copy link

dosubot bot commented Feb 7, 2025

To resolve the error you're encountering with bin/mftf doctor, ensure that Selenium can access the Magento instance. Here are some steps to check and configure:

  1. Verify extra_hosts Configuration: Ensure that the extra_hosts configuration in your compose.yaml file is correctly set up to map magento.test to the Docker network gateway. It should look like this:

    extra_hosts: &appextrahosts
      - "magento.test:172.17.0.1"

    Make sure this configuration is applied to both the app and selenium services.

  2. Check Selenium Service: Ensure that the Selenium service is correctly configured and running. In your compose.yaml, the Selenium service should be uncommented and configured like this:

    selenium:
      image: selenium/standalone-chrome-debug:3.8.1
      ports:
        - "5900:5900"
      extra_hosts: *appextrahosts
  3. Update MFTF Configuration: Ensure that the src/dev/tests/acceptance/.env file includes the line SELENIUM_HOST=selenium to define the host Codeception should connect to.

  4. Nginx Configuration: Verify that your nginx.conf file allows access to the necessary paths for MFTF. Ensure the following configuration is present:

    location ~* ^/dev/tests/acceptance/utils($|/) {
        root $MAGE_ROOT;
        location ~ ^/dev/tests/acceptance/utils/command.php {
            fastcgi_pass   fastcgi_backend;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }

These steps should help ensure that Selenium can access the Magento instance and resolve the error you're facing with bin/mftf doctor [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@pradeepkanaka
Copy link
Author

@dosu

These configurations have already been added but still have the same issue. When I catch the exception that we are getting
above, it says xpath lookup error: Failed to execute 'send' on 'XMLHttpRequest'

Copy link

dosubot bot commented Feb 7, 2025

The error message xpath lookup error: Failed to execute 'send' on 'XMLHttpRequest' in the context of MFTF tests can be caused by several factors, such as:

  1. Network Issues: Ensure that the network configuration allows the Selenium server to communicate with the Magento instance. Double-check the extra_hosts configuration to ensure proper DNS resolution.

  2. Selenium Configuration: Verify that the Selenium server is correctly set up and running. Ensure that the SELENIUM_HOST in the .env file is set to selenium.

  3. Nginx Configuration: Make sure that the Nginx configuration allows access to the necessary paths for MFTF tests, as previously mentioned.

  4. JavaScript Errors: Check the browser console for any JavaScript errors that might be causing the XMLHttpRequest to fail.

  5. Timeouts: Increase the timeout settings in your MFTF configuration to allow more time for the requests to complete.

If these steps do not resolve the issue, consider checking the logs for more detailed error messages that might provide additional insights.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

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

No branches or pull requests

1 participant