HEPTACOM / HeptacomShopwarePlatformAdminOpenAuth

Shopware plugin to allow open auth logins in the administration
https://www.heptacom.de/
Apache License 2.0
30 stars 10 forks source link

Login returns error message "Maximum execution time of 30 seconds exceeded" #5

Closed ckupferschmid closed 1 year ago

ckupferschmid commented 2 years ago

We have just installed the plugin. Right after configuration/activation, we only get

errors  
0  
code "0"
status "500"
title "Internal Server Error"
detail "Error: Maximum execution time of 30 seconds exceeded"

During the 30sec, the php-fpm goes to100% CPU and the error message in the php-fpm log is: Maximum execution time of 30 seconds exceeded in /opt/shopware/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php Every time the error lists a different line number.

Any idea on this?

Environment: CentOS 8 PHP 7.4.32 Shopware 6.4.16.1

JoshuaBehrens commented 2 years ago

Hi @ckupferschmid that sounds new to me. Can you provide us any form of trace dump? Blackfire, Tideways, SPX, xdebug trace. I am unsure how you get in there but it sounds like an endless loop to me. How did you install the plugin? ZIP file from community store, composer install from community store or composer install from packagist.org?

ckupferschmid commented 2 years ago

@JoshuaBehrens Thanks for coming back so quick. The package was installed via Community Store. I'm fairly new to php and shopware. I do have a dev.log. How can I send it to you?

JoshuaBehrens commented 2 years ago

@ckupferschmid no worries :) dev.log is quite bloated and might not contain the information I am looking for but let's give it a try.

You can upload it to https://privatebin.net/ or similar services to share encrypted files. Send the link to my company address behrens@heptacom.de

If the file is too big, just move it so it will just contain fresh errors and reproduce the error. This will make it easier to read through it.

JoshuaBehrens commented 2 years ago

To wrap up our e-mail conversation: the issue happens somewhere here: https://github.com/HEPTACOM/HeptacomShopwarePlatformAdminOpenAuth/blob/1654524b550d4bcd767471bc44768a9bbe222b7c/src/Controller/AdministrationController.php#L85-L109

Which is likely a missconfiguration on the IDP side, which leads to side effects in our plugin. There is a need for further investigations, why this does not happen in our test setup of this IDP.

ckupferschmid commented 2 years ago

Hmm, we can provide the manifest of the Application Registration if that helps. I have re-setup the application registration 2 times, always with the same result, so it must be something reproducible that we are doing wrong, or that our tenant is configured with, that leads to this issue.

silviokennecke commented 2 years ago

Yes, that would help.

An idea I just had was, that the requests to the IDP might somehow take very long and therefore increase the required execution time. In this part, we do minimum 2 calls to the IDP (token retrieval + get user data). Depending on the configuration, we also request the OIDC metadata file from the IDP.

ckupferschmid commented 1 year ago

Unfortunately increasing the max_execution_time from 30 to 120 in /etc/php.ini does not help. The new error is: Gateway Timeout The gateway did not receive a timely response from the upstream server or application.

JoshuaBehrens commented 1 year ago

Thank you @ckupferschmid for checking

ckupferschmid commented 1 year ago

We had the same issue with an installation at our Shopware partner. Debugging revealed that a dependency was missing. Installing the correct php-gmp module solved the issue today on both installations (the one with our partner and mine too)

JoshuaBehrens commented 1 year ago

Thanks for updating us on your insights. We will check how this php extension affects us :)