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

when running rooter start --debug, rabbitmq crashes #9

Open
techguyuk opened this issue Feb 25, 2024 · 30 comments
Open

when running rooter start --debug, rabbitmq crashes #9

techguyuk opened this issue Feb 25, 2024 · 30 comments
Assignees

Comments

@techguyuk
Copy link

This is my first time using rooter and having difficulty in getting a magento2 setup up and running

After running rooter start --debug ,

  1. rabbitmq comes up and then crashes
  2. created new project and on the above command , it straight away crashed with below error

When running rooter env:status I see the below

rabbitmq │ 3097 │ - │ - │ 0 │ Completed

Plz help

Content from the commandline

[rabbitmq ] 2024-02-25 21:00:26.670094+00:00 [notice] <0.44.0> Application rabbitmq_prelaunch exited with reason: {{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[#{clean_halt => false,name => rabbit_prelaunch_3115@localhost,name_domain => shortnames,net_tickintensity => 4,net_ticktime => 60,supervisor => net_sup_dynamic}]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}} [rabbitmq ] {"Kernel pid terminated",application_controller,"{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[#{clean_halt => false,name => rabbit_prelaunch_3115@localhost,name_domain => shortnames,net_tickintensity => 4,net_ticktime => 60,supervisor => net_sup_dynamic}]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}}"} [rabbitmq ] Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[#{clean_halt => false,name => rabbit_prelaunch_3115@localhost,name_domain => shortnames,net_tickintensity => 4,net_ticktime => 60,supervisor => net_sup_dynamic}]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}}) [rabbitmq ] [rabbitmq ] Crash dump is being written to: erl_crash.dump...done

Partial content from the log file

=erl_crash_dump:0.5 Sun Feb 25 21:00:28 2024 Slogan: Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[#{clean_halt => false,name => rabbit_prelaunch_3115@localhost,name_domain => shortnames,net_tickintensity => 4,net_ticktime => 60,supervisor => net_sup_dynamic}]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}}) System version: Erlang/OTP 25 [erts-13.2.2.6] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] Taints: crypto Atoms: 13698 Calling Thread: scheduler:1 =scheduler:1 Scheduler Sleep Info Flags: Scheduler Sleep Info Aux Work: THR_PRGR_LATER_OP Current Port: Run Queue Max Length: 0 Run Queue High Length: 0 Run Queue Normal Length: 0 Run Queue Low Length: 0 Run Queue Port Length: 0 Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC Current Process: <0.0.0> Current Process State: Running Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING Current Process Program counter: 0x0000000110b8c710 (init:sleep/1 + 64)

@techguyuk
Copy link
Author

techguyuk commented Feb 26, 2024

Hi @mwr @cristiano-pacheco @riconeitzel @DavidLambauer

Any help, much appreciated

@cristiano-pacheco
Copy link
Collaborator

Hello @atlenquiryuk, I hope you're doing well.

I would suggest stopping your environment and deleting the RabbitMQ folder from the .devenv/state/rabbitmq path.

Try to start the command again.

Ok?

Thanks,

Cristiano.

@cristiano-pacheco cristiano-pacheco self-assigned this Feb 26, 2024
@techguyuk
Copy link
Author

Hi @cristiano-pacheco

Thanks for getting back.

Will try and revert back.

@techguyuk
Copy link
Author

techguyuk commented Feb 26, 2024

Hi @cristiano-pacheco

I just followed your instructions and there is no rabbitmq folder (.devenv/state/rabbitmq)

see screenshot

Any suggestions ?

Thanks

Screenshot 2024-02-26 at 21 34 08

@cristiano-pacheco
Copy link
Collaborator

cristiano-pacheco commented Feb 26, 2024 via email

@techguyuk
Copy link
Author

techguyuk commented Feb 26, 2024

Hi @cristiano-pacheco

Yes, see below.

When I start the environment, I get the following
Screenshot 2024-02-26 at 22 28 33

{ pkgs, inputs, lib, config, ... }:

let
rooterBin = if builtins.getEnv "ROOTER_BIN" != "" then builtins.getEnv "ROOTER_BIN" else "rooter";
composerPhar = builtins.fetchurl{
url = "https://github.com/composer/composer/releases/download/2.2.22/composer.phar";
sha256 = "1lmibmdlk2rsrf4zr7xk4yi5rhlmmi8f2g8h2izb8x4sik600dbx";
};
in {
dotenv.enable = true;
env = {
PROJECT_NAME = "rooter-mage";
PROJECT_HOST = "rooter-mage.rooter.test";

    NGINX_PKG_ROOT = pkgs.nginx;
    DEVENV_STATE_NGINX = "${config.env.DEVENV_STATE}/nginx";

    DEVENV_PHPFPM_SOCKET = "${config.env.DEVENV_STATE}/php-fpm.sock";

    DEVENV_DB_NAME = "app";
    DEVENV_DB_USER = "app";
    DEVENV_DB_PASS = "app";

    DEVENV_AMQP_USER = "guest";
    DEVENV_AMQP_PASS = "guest";
};

# PACKAGES
packages = [
    pkgs.git
    pkgs.gnupatch
    pkgs.curl
    pkgs.yarn
    pkgs.gettext
    pkgs.n98-magerun2
];

# Composer 2.2.x required by Magento2 <=2.4.6
scripts.composer.exec = ''
    php ${composerPhar} $@
'';

# process-compose
process.implementation="process-compose";
process.process-compose={
    "port" = config.env.DEVENV_PROCESS_COMPOSE_PORT;
    "tui" = "false";
    "version" = "0.5";
};

# PHP
languages.php = {
    enable = true;
    package = inputs.phps.packages.${builtins.currentSystem}.php81.buildEnv {
        extensions = { all, enabled }: with all; enabled ++ [ redis xdebug xsl ];
        extraConfig = ''
            memory_limit = -1
            error_reporting=E_ALL
            xdebug.mode = coverage,debug
            sendmail_path = ${pkgs.mailpit}/bin/mailpit sendmail -S 127.0.0.1:${config.env.DEVENV_MAIL_SMTP_PORT}
            display_errors = On
            display_startup_errors = On
        '';
    };
    fpm.phpOptions =''
        memory_limit = -1
        error_reporting=E_ALL
        xdebug.mode = debug
        sendmail_path = ${pkgs.mailpit}/bin/mailpit sendmail -S 127.0.0.1:${config.env.DEVENV_MAIL_SMTP_PORT}
        display_errors = On
        display_startup_errors = On
    '';
    fpm.pools.web = {
        listen = "${config.env.DEVENV_PHPFPM_SOCKET}";
        settings = {
            "clear_env" = "no";
            "pm" = "dynamic";
            "pm.max_children" = 20;
            "pm.start_servers" = 6;
            "pm.min_spare_servers" = 1;
            "pm.max_spare_servers" = 10;
        };
    };
};

# JS
languages.javascript = {
    enable = true;
    package = pkgs.nodejs-18_x;
};

# nginx
services.nginx = {
    enable = true;
    configFile = "${config.env.DEVENV_STATE_NGINX}/nginx.conf";
};

# DATABASE
services.mysql = {
    enable = true;
    package = pkgs.mariadb_106;
    settings = {
        mysqld = {
            port = config.env.DEVENV_DB_PORT;
            innodb_buffer_pool_size = "2G";
            table_open_cache = "2048";
            sort_buffer_size = "8M";
            join_buffer_size = "8M";
            query_cache_size = "256M";
            query_cache_limit = "2M";
        };
    };
    initialDatabases = [{ name = "${config.env.DEVENV_DB_NAME}"; }];
    ensureUsers = [
        {
            name = "${config.env.DEVENV_DB_USER}";
            password = "${config.env.DEVENV_DB_PASS}";
            ensurePermissions = { "${config.env.DEVENV_DB_NAME}.*" = "ALL PRIVILEGES"; };
        }
    ];
};

# mailpit
services.mailpit = {
    enable = true;
    uiListenAddress   = "127.0.0.1:${config.env.DEVENV_MAIL_UI_PORT}";
    smtpListenAddress = "127.0.0.1:${config.env.DEVENV_MAIL_SMTP_PORT}";
};

# Redis
services.redis = {
    enable = true;
    port = lib.strings.toInt ( config.env.DEVENV_REDIS_PORT );
};

# ElasticSearch
services.elasticsearch = {
    enable = true;
    port = lib.strings.toInt ( config.env.DEVENV_ELASTICSEARCH_PORT );
    tcp_port = lib.strings.toInt ( config.env.DEVENV_ELASTICSEARCH_TCP_PORT );
};

# RabbitMQ
services.rabbitmq = {
    enable = true;
    port = lib.strings.toInt ( config.env.DEVENV_AMQP_PORT );
    managementPlugin = {
        enable = true;
        port = lib.strings.toInt ( config.env.DEVENV_AMQP_MANAGEMENT_PORT );
    };
};

}

@cristiano-pacheco
Copy link
Collaborator

Hello @atlenquiryuk, thank you for sharing it.

Let's do a quick test.

Please change your devenv.nix file to have this content:

{ pkgs, inputs, lib, config, ... }:

let
    rooterBin = if builtins.getEnv "ROOTER_BIN" != "" then builtins.getEnv "ROOTER_BIN" else "rooter";
    pkgs-stable = import inputs.nixpkgs-stable { system = pkgs.stdenv.system; };
    composerPhar = builtins.fetchurl{
        url = "https://github.com/composer/composer/releases/download/2.2.22/composer.phar";
        sha256 = "1lmibmdlk2rsrf4zr7xk4yi5rhlmmi8f2g8h2izb8x4sik600dbx";
    };
    magerun2Phar = builtins.fetchurl{
        url = "https://github.com/netz98/n98-magerun2/releases/download/7.2.0/n98-magerun2.phar";
        sha256 = "0z1dkxz69r9r9gf8xm458zysa51f1592iymcp478wjx87i6prvn3";
    };
in {
    dotenv.enable = true;
    env = {
        PROJECT_NAME = "rooter-mage";
        PROJECT_HOST = "rooter-mage.rooter.test";

        NGINX_PKG_ROOT = pkgs.nginx;
        DEVENV_STATE_NGINX = "${config.env.DEVENV_STATE}/nginx";

        DEVENV_PHPFPM_SOCKET = "${config.env.DEVENV_STATE}/php-fpm.sock";

        DEVENV_DB_NAME = "app";
        DEVENV_DB_USER = "app";
        DEVENV_DB_PASS = "app";

        DEVENV_AMQP_USER = "guest";
        DEVENV_AMQP_PASS = "guest";
    };

    # PACKAGES
    packages = [
        pkgs.git
        pkgs.gnupatch
        pkgs.curl
        pkgs.yarn
        pkgs.gettext
    ];

    scripts.composer.exec = ''php ${composerPhar} $@''; # Composer 2.2.x required by Magento2 <=2.4.6
    scripts.magerun2.exec = ''php ${magerun2Phar} $@''; # magerun2 without hardlock to php8.2

    # process-compose
    process.implementation="process-compose";
    process.process-compose={
        "port" = config.env.DEVENV_PROCESS_COMPOSE_PORT;
        "tui" = "false";
        "version" = "0.5";
    };

    # PHP
    languages.php = {
        enable = true;
        package = inputs.phps.packages.${builtins.currentSystem}.php81.buildEnv {
            extensions = { all, enabled }: with all; enabled ++ [ redis xdebug xsl ];
            extraConfig = ''
                memory_limit = -1
                error_reporting=E_ALL
                xdebug.mode = coverage,debug
                sendmail_path = ${pkgs.mailpit}/bin/mailpit sendmail -S 127.0.0.1:${config.env.DEVENV_MAIL_SMTP_PORT}
                display_errors = On
                display_startup_errors = On
            '';
        };
        fpm.phpOptions =''
            memory_limit = -1
            error_reporting=E_ALL
            xdebug.mode = debug
            sendmail_path = ${pkgs.mailpit}/bin/mailpit sendmail -S 127.0.0.1:${config.env.DEVENV_MAIL_SMTP_PORT}
            display_errors = On
            display_startup_errors = On
        '';
        fpm.pools.web = {
            listen = "${config.env.DEVENV_PHPFPM_SOCKET}";
            settings = {
                "clear_env" = "no";
                "pm" = "dynamic";
                "pm.max_children" = 20;
                "pm.start_servers" = 6;
                "pm.min_spare_servers" = 1;
                "pm.max_spare_servers" = 10;
            };
        };
    };

    # JS
    languages.javascript = {
        enable = true;
        package = pkgs.nodejs_20;
    };

    # nginx
    services.nginx = {
        enable = true;
        configFile = "${config.env.DEVENV_STATE_NGINX}/nginx.conf";
    };

    # DATABASE
    services.mysql = {
        enable = true;
        package = pkgs.mariadb_106;
        settings = {
            mysqld = {
                port = config.env.DEVENV_DB_PORT;
                innodb_buffer_pool_size = "2G";
                table_open_cache = "2048";
                sort_buffer_size = "8M";
                join_buffer_size = "8M";
                query_cache_size = "256M";
                query_cache_limit = "2M";
            };
        };
        initialDatabases = [{ name = "${config.env.DEVENV_DB_NAME}"; }];
        ensureUsers = [
            {
                name = "${config.env.DEVENV_DB_USER}";
                password = "${config.env.DEVENV_DB_PASS}";
                ensurePermissions = { "${config.env.DEVENV_DB_NAME}.*" = "ALL PRIVILEGES"; };
            }
        ];
    };

    # mailpit
    services.mailpit = {
        enable = true;
        uiListenAddress   = "127.0.0.1:${config.env.DEVENV_MAIL_UI_PORT}";
        smtpListenAddress = "127.0.0.1:${config.env.DEVENV_MAIL_SMTP_PORT}";
    };

    # Redis
    services.redis = {
        enable = true;
        port = lib.strings.toInt ( config.env.DEVENV_REDIS_PORT );
    };

    # ElasticSearch
    services.elasticsearch = {
        enable = true;
        port = lib.strings.toInt ( config.env.DEVENV_ELASTICSEARCH_PORT );
        tcp_port = lib.strings.toInt ( config.env.DEVENV_ELASTICSEARCH_TCP_PORT );
    };

    # RabbitMQ
    services.rabbitmq = {
        package = pkgs-stable.rabbitmq-server;
        enable = true;
        port = lib.strings.toInt ( config.env.DEVENV_AMQP_PORT );
        managementPlugin = {
            enable = true;
            port = lib.strings.toInt ( config.env.DEVENV_AMQP_MANAGEMENT_PORT );
        };
    };
}

Change the content of your devenv.yaml file to:

allowUnfree: true
inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
  nixpkgs-stable:
    url: github:NixOS/nixpkgs/nixos-23.05
  phps:
    url: github:fossar/nix-phps
    inputs:
      nixpkgs:
        follows: nixpkgs

Change your .envrc file to:

source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="

export NIXPKGS_ALLOW_INSECURE=1
dotenv_if_exists .env
watch_file .env

use devenv

Delete the files and folders with the command below:

  • devenv.lock
  • .devenv.flake.nix
  • .devenv
  • .direnv

After it, please, restart your terminal and start the project again with the debug mode.

What have we changed?

We added a stable input thought the devenv.yaml file and we changed the declaration of the RabbitMQ service to use the RabbitMQ server from the stable channel. With it it will use RabbitMQ's 3.11 version instead of 3.12

devenv.yaml file

nixpkgs-stable:
    url: github:NixOS/nixpkgs/nixos-23.05
devenv.nix file

services.rabbitmq = {
        package = pkgs-stable.rabbitmq-server;

Please, let me know what are the results.

Thanks,

Cristiano.

@techguyuk
Copy link
Author

Hi @cristiano-pacheco

I followed your steps, now after running start in debug mode and when I rus status in anther cmd tab I get the below.

I checked the devenv.nix and I can see the project name is already declared here PROJECT_NAME = "rooter-mage";

So not sure why its throwing the below error

Screenshot 2024-02-27 at 10 53 00

@cristiano-pacheco
Copy link
Collaborator

Hello @atlenquiryuk, the issues you are facing are very weird.

How can this happen if the variable is already set? I don't know what to say 🙈

Maybe define this variable in your .env file and make a new test. Please.

@mwr
Copy link
Member

mwr commented Feb 27, 2024

@atlenquiryuk The error you shared in your last screenshot looks like the environment variables from .env are not set in your current shell.
Can you check

  • .env file and its content contains the variables
  • if direnv allow . was executed

Running env in the shell of the project should contain the variables from .env file.

@techguyuk
Copy link
Author

techguyuk commented Feb 27, 2024

Hi @mwr @cristiano-pacheco

I finally got pass that issue.

@mwr you are right, I did source ~/.bashrc and then all worked.

@cristiano-pacheco your rabbitmq changes worked.

Now I'm facing a different issue when running rooter magento2:db-install

Screenshot 2024-02-27 at 22 00 16

Thanks

@mwr
Copy link
Member

mwr commented Feb 28, 2024

@atlenquiryuk Great that it worked now.
It seems the error you have now is a timeout of the php process triggered.
Let me create an PR for that.
With the latest release https://github.com/run-as-root/rooter/releases/tag/1.0.0-beta6 we already introduced a timeout for mysql:dump, we should probably have the timeout for the processes configurable on a higher level.

@techguyuk
Copy link
Author

Hi @mwr

Thank you.

While I wait for PR and merge, is there a temp fix that I can put to fix this ?.

Thanks

@cristiano-pacheco
Copy link
Collaborator

Hello @atlenquiryuk, you can run the bin/magento setup:install command manually.

This is a command as an example:

bin/magento setup:install \
     --backend-frontname=backend \
     --db-host=127.0.0.1:3557 \
     --db-name=app \
     --db-user=app \
     --db-password=app \
     --search-engine=elasticsearch7 \
     --elasticsearch-host=127.0.0.1 \
     --elasticsearch=9224 \
     --elasticsearch-index-prefix=magento2 \
     --elasticsearch-enable-auth=0 \
     --elasticsearch-timeout=15 \
     --session-save=redis \
     --session-save-redis-host=127.0.0.1 \
     --session-save-redis-port=6511 \
     --session-save-redis-db=2 \
     --session-save-redis-max-concurrency=20 \
     --cache-backend=redis \
     --cache-backend-redis-server=127.0.0.1 \
     --cache-backend-redis-db=0 \
     --cache-backend-redis-port=6511 \
     --page-cache=redis \
     --page-cache-redis-server=127.0.0.1 \
     --page-cache-redis-db=1 \
     --page-cache-redis-port=6511 \
     --admin-user=admin \
     --admin-password=123123q \
     [email protected] \
     --admin-firstname=firstname \
     --admin-lastname=lastname \
     --language=en_US \
     --currency=USD \
     --timezone=America/Chicago \
     --use-rewrites=1 \
     --amqp-host=127.0.0.1 \
     --amqp-port=5674 \
     --amqp-user=guest \
     --amqp-password=guest \
     --enable-modules=all

Note: Don't forget to change the ports according to the values defined in your .env file.

@techguyuk
Copy link
Author

techguyuk commented Feb 28, 2024

Hi @cristiano-pacheco @mwr

Just another thing to consider for the release, in the install command, I'm getting error The "--elasticsearch" option does not exist.

This might need fixing .

In latest version it uses opensearch as the default

@cristiano-pacheco
Copy link
Collaborator

Hi @cristiano-pacheco @mwr

Just another thing to consider for the release, in the install command, I'm getting error The "--elasticsearch" option does not exist.

This might need fixing .

In latest version it uses opensearch as the default

Hello @atlenquiryuk,

I'm not able to reproduce the timeout issue. According to my debug session, it will never occur because the timeout is disabled for that command.

opensearch is not the default. It will be used only if you set the DEVENV_OPENSEARCH_PORT env variable is set AND DEVENV_ELASTICSEARCH_PORT is not set.

@mwr
Copy link
Member

mwr commented Feb 29, 2024

@cristiano-pacheco thanks for double checking.

@atlenquiryuk what is the result of the magento install command when you run it manually.
Do you also get a timeout?

@techguyuk
Copy link
Author

techguyuk commented Feb 29, 2024

Hi @mwr

I'm getting error The "--elasticsearch" option does not exist. This one is really strange, I pinged elasticsearch to check it status and all looks good. So not sure why Im getting this error.

Any suggestions on the "--elasticsearch" option does not exist issue ?

Extremely sorry, this was my mistake, for port I had --elasticsearch=9241, it should be --elasticsearch-port=9241

Now bin/magento setup:install has completed successfully.

When using bin/magento setup:install, i dint receive a timeout error, its only when using rooter magento2:db-install.

Also note, when running rooter magento2:db-install the values for elasticsearch username and password as not taken correctly, see the screenshot here #9 (comment)

Thanks

@mwr
Copy link
Member

mwr commented Feb 29, 2024

@atlenquiryuk What magento version are you using?

you can check the options by running bin/magento setup:install --help

@techguyuk
Copy link
Author

Hi @mwr

Im using magento 2.4.6-p4

Ok, So I ran all the setup steps successfully but now having issue accessing the site. See screenshots

Screenshot 2024-02-29 at 10 06 02
Screenshot 2024-02-29 at 10 02 58

Wondering if there's any issue with routing.

@techguyuk
Copy link
Author

techguyuk commented Feb 29, 2024

Just to add to the previous comment.

Im able to access traffic dashboard
Screenshot 2024-02-29 at 10 10 14

Not able to access mailpit at https://rooter-mage-mail.rooter.test/

Screenshot 2024-02-29 at 10 12 31

Screenshot 2024-02-29 at 10 13 37

Update

Im able to access mailpit by visiting http://127.0.0.1:18223/ as per the screenshot from traffic but not the magento website

Screenshot 2024-02-29 at 10 24 18
Screenshot 2024-02-29 at 10 24 06
Screenshot 2024-02-29 at 10 23 45
Screenshot 2024-02-29 at 10 23 32

@techguyuk
Copy link
Author

Hi @mwr @cristiano-pacheco

Thank you guys so much for your help, got it finally working.

@cristiano-pacheco dint realise rooter doesn't add a host entry into the hosts file. Might be helpful to the other folks following the guide if you could add this to the it.

Thanks again

@techguyuk
Copy link
Author

Hi @cristiano-pacheco @mwr

Do you plan to add varnish support for magento 2 environment ?

Thanks

@mwr
Copy link
Member

mwr commented Mar 1, 2024

@cristiano-pacheco dint realise rooter doesn't add a host entry into the hosts file. Might be helpful to the other folks following the guide if you could add this to the it.

rooter uses dnsmasq and does register a rooter.test route to be routed to traefik.

Maybe did you get an error during rooter installation while running: rooter install?
This command should create the setup for dnsmasq, traefik and also ssl certs.

Do you plan to add varnish support for magento 2 environment ?

Yes we do, I have created a public issue for this: #10

@techguyuk
Copy link
Author

techguyuk commented Mar 1, 2024

Hi @mwr

Thanks for getting back.

Yes, I did run the install command and as far as I remember everything had gone well.

After adding the domains to host file, https works (see screenshot). May be there was an issue and I dint notice.

Screenshot 2024-03-01 at 14 53 49.

Screenshot 2024-03-01 at 17 25 36

Running this scutil --dns, I can see the below entry

Screenshot 2024-03-01 at 17 27 51

If I run rooter install now would that cause any issue to existing environments ?

Thanks

@techguyuk
Copy link
Author

Hi @mwr

Just wanted to give an update incase it helps anyone else.

In /etc/resolver/rooter.test I had the port entry missing, so added it like below and all good now. No need of adding entry to /etc/hosts anymore.

Screenshot 2024-03-02 at 10 36 17

Thanks again for all your help

@mwr
Copy link
Member

mwr commented Mar 3, 2024

@techguyuk Great that you got it working.

If I run rooter install now would that cause any issue to existing environments ?

You can re-run rooter install. It also has an option --force to ensure every step is re-run again. With out the force option it would detect existing files and not overwrite them.

In /etc/resolver/rooter.test I had the port entry missing, so added it like below and all good now. No need of adding entry to /etc/hosts anymore.

Not sure how it can happen that there is no port written to that file.
Was the whole line missing or just the port-number?

@techguyuk
Copy link
Author

Hi @mwr

There were 2 files in /etc/resolver/

  1. test : this file had 2 entries including the port
  2. rooter.test : this file only had one entry without the port

@techguyuk
Copy link
Author

techguyuk commented Mar 3, 2024

Hi @mwr @cristiano-pacheco

Sorry to bother you again.

Im trying to setup xdebug, I followed the steps mentioned in the doc by

  1. running export XDEBUG_CONFIG="idekey=PHPSTORM-XDEBUG" in the command line
  2. switching xdebug on in phpstorm
  3. add a breakpoint in pub/index.php
  4. reload magento webpage

Page loads with no break point trigger.

Any help ?

@techguyuk
Copy link
Author

techguyuk commented Mar 3, 2024

Hi @mwr

I got this working by doing some phpstorm settings as below

  1. installed browser xdebug pluggin and configured to use phpstorm, it sends a xdebug session cookie with value PHPSTORM when enabled

  2. configured phpstorm as below
    Screenshot 2024-03-03 at 22 30 19

  3. now enable debugging in phpstorm

  4. load webpage

  5. stops at the added break point

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