Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello again, yesterday I tried to find the solution for the error that occurred. When I follow the

Options
ULW0Z4150
ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

Hello again,

yesterday I tried to find the solution for the error that occurred. When I follow the tutorial to try and implement the personalized product page, I get the error that Class ‘PersonalizedProductDependecyProvider’ is not found.

To resolve this problem I tried to install and configure xdebug for my docker setup. But I can’t get the connection to work. I tried the different troubleshooting options. When I execute this command nc -zv ${SPRYKER_XDEBUG_HOST_IP} 9000, I get an error that the connection is refused. I would be grateful for any advice about how to proceed from here

Comments

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Hello David,

    What platform are you working on?

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    The docker container is on a unix system, I’m working on mac os where my php storm is running

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    I’ve used xdebug a bunch of times on my Mac.

    What is the value of SPRYKER_XDEBUG_HOST_IP?

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    The error message is: nc: connect to 10.101.65.96 port 9000 (tcp) failed: Connection refused

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    actually it should be ‘host.docker.internal’

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    But it seems our script to determinate the IP is wrong.
    Anyway we have a ticket to refactor xdebug in our docker SDK.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Try to change docker/deployment/default/deploy
    with export SPRYKER_XDEBUG_HOST_IP=host.docker.internal
    and then docker/sdk restart -x

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Ok after aplying the change im now getting this error nc: getaddrinfo: Name does not resolve

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    nc -zv host.docker.internal 9000 works?

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Do you use docker-machine?

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    No that line leads to the same error. It is a virtual server machine I’m connecting to, to do my development

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    So it seems linux inside. The problem you need to solve - to determinate IP of your host and pass via SPRYKER_XDEBUG_HOST_IP.

    But how do you map your xdebug port to your dev machine?

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Yes the server is a linux system. I followed this guide https://documentation.spryker.com/installation/spryker_in_docker/debugging-setup-in-docker-201907.htm to establish the connection between php storm and the server. By manually inserting my host ip in SPRYKER_XDEBUG_HOST_IP the connection is now established. But when debugging im still getting errors, that some remote files are not mapped to files in the project

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Also for some reason the xdebug model is not shown when I execute php -m

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited November 2019
    Options

    you need to run docker/sdk cli -x to debug console commands

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Ok now the module shows up. I’ve configured the mapping for the project files but not for the include paths, in PHPStorm. The debug doesn’t stop at any given breakpoint. I’m guessing it’s because a mapping is missing, but I’m unsure how to configure the mappings for the include paths. Thanks for your help so far

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Glad to help

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    Can you point me to any information about how the path mappings in PHPStorm (Languages & Frameworks > PHP > Servers) are supposed to be configured? Especially the mappings for the include paths

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options
  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    I am not sure about include path. But the mapping is simple.

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    edited November 2019
    Options

    Yes I followed that guide and set up the mapping to /data. But I’m still getting the error

     Debug session was finished without being paused
                It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
    

    And the execution is not stopped at the breakpoint I set

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Just as experiment. Try xdebug_break() in any of entrypoint.

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    I think I fixed it. I synced the project files again and now it stops at the given breakpoints. Thanks for your patience

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    What do you use for syncing? docker-sync?

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
    Options

    I synced the files via PHPStorms deployment configuration