-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Random 502 Bad Gateway errors when Xdebug is enabled #1085
Comments
Hi, @esequielp Did you change Nginx conf? |
NO , I didnt change the nginx config, where I can see the logs files? |
To see the log files you can execute the And the error log is at within the Docker container: What is the Nginx image you use? I can't reproduce this issue. You didn't have a problem during the To be sure try to execute these commands:
|
I also encounter this 502 error when randomly refresh the page while having Xdebug enabled. Logs from Nginx says: If Xdebug is disabled, no error occurs. |
When I enable xdebug, sometimes it works, sometimes it throws the 502 error. I can set breakpoints and it breaks as expected when it works, but half the time it throws a 502. I'm using the latest docker-magento setup on a macbook with an m3 chip, with an existing project. Here is my app log error: Here is my phpfpm related error: Any ideas? I'm not a server admin. Thanks for the help! |
I often get 502 error when xdebug is enabled too.
P.S.
containers/phpfpm/Dockerfile contains:
Remove your |
Same problem with 502 bag gateway. Tried to use a different php-fpm instance but it ddn't work |
Hello @CarlosM-ESP , I've provided the example from my local environment. In your case, you could experiment with different combinations of PHP(use your current version) and different Xdebug versions. It seems that there may be compatibility issues between specific versions of PHP and Xdebug |
@markshust |
@CarlosM-ESP I'm looking into this further. I'm thinking the SPX extension that was added in a couple months ago could potentially be conflicting with Xdebug. Also... https://bugs.xdebug.org/view.php?id=2253 I'm wondering if we should downgrade to the last major version release of Xdebug (3.2.2). |
I've replicated the issue, and have confirmed that the Xdebug is causing it. |
I have confirmed that a "502 Bad Gateway" error is always returned and replicable whenever Xdebug 3.3.1 is enabled (per bug filed at https://bugs.xdebug.org/view.php?id=2253). The issue is resolved by downgrading Xdebug back to 3.2.2. While this works for PHP 8.1/8.2, unfortunately it is not an option when running PHP 8.3 due to package version constraints (pecl/xdebug requires PHP (version >= 8.0.0, version <= 8.2.99), installed version is 8.3.6). I'll update the PHP 8.1/8.2 images to downgrade Xdebug back to 3.2.2. I'll have this updated tomorrow. Unfortunately, there is no resolution for PHP 8.3 due to hard version constraints set by Xdebug. I'm surprised others aren't commenting on the Xdebug bug/issue as running Xdebug on PHP 8.3 is currently not an option. If you'd like this fixed for PHP 8.3, I'd recommend to comment on the ticket at https://bugs.xdebug.org/view.php?id=2253 to increase the likelihood of this bug getting resolved. |
Downgrade Xdebug to 3.2.2 to fix 502 Bad Gateway error #1085
Another possibly related bug before I build & tag new images, related to running Blackfire and Xdebug at the same time: https://bugs.xdebug.org/view.php?id=2230 Few possible resolutions/options:
|
FYI I don't think changing the load order of extensions is possible, as the ini files are loaded alphabetically, and it seems as though blackfire is already loading before xdebug:
But this is not representative of the output, as it looks like it is loading after xdebug:
If the output is unrelated, this means that Blackfire is probably loading first, and that issue or possible fix is not applicable. It's getting late here, but I'll look more into this tomorrow. |
Thanks @markshust Please inform when you resolve this issue! |
I've confirmed that this issue of Xdebug conflicting with the Blackfire extension is the most likely culprit of this bug, as Xdebug 3.3.1 works with PHP 8.3 if the Blackfire extension is disabled. Here's how I'll proceed:
The code is about ready to go, but I will need GitHub actions to recompile the new images. This process typically takes about 90 minutes once it starts, so I'll check back later to update the compose.yaml file to the new image version once it's complete, and tag this update as 46.1.0. This version will also contain the PHP Swoole extension for Adobe Commerce GraphQL Application Layer support (#1114). I haven't delved into this topic yet to find out how to configure it with Commerce or run the application layer, but we'll need this extension anyways for this app layer, so I figured I'd build this in since we'll need new images anyways (I forgot to add it in the initial PHP 8.3 image at the time of the Magento 2.4.7 release earlier this week). I'll update this ticket as soon as the new images and configuration has been published. |
Disable Blackfire in PHP 8.3 image by default #1085
Tagging new versions of PHP Docker images to fix #1085
It looks like GitHub auto-closed this ticket, but it should be resolved. The images are being re-built right now (https://github.com/markshust/docker-magento/actions). I'll tag docker-magento |
@markshust |
Magento 2.4.7 installed. Xdebug problem disappeared. Thank you, Mark! |
Thanks for the update. I've downgraded to
which at the moment seems to run just fine. Not sure where the issue lies, just commented out of curiosity to check if anyone ran into the same issue. |
Description
I am using the last installation :
curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.6-p4 community
Error happens when go to especify product
Steps To Reproduce
Expected Result
open the product
Actual Result
give 502 Bad Gateway
The text was updated successfully, but these errors were encountered: