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

[Bug]: Sending parallel GraphQl mutation request cause 500 Internal Server Error #793

Closed
ayoob-lfc opened this issue Aug 27, 2023 · 4 comments
Assignees
Labels
Milestone

Comments

@ayoob-lfc
Copy link

Expected behavior

Should get status 200 when sending parallel GraphQl request.

Actual behavior

I get a 500 Internal Server Error, and the following in dev.log

php.CRITICAL: Fatal Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) {"exception":"[object] (Symfony\Component\ErrorHandler\Error\OutOfMemoryError(code: 0): Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) at /var/www/html/vendor/pimcore/data-hub/src/Configuration.php:152)"} []

Steps to reproduce

Create multiple large GraphQl mutation request.
Send them all in one go.
You will get 500 Internal Server error.

@ayoob-lfc ayoob-lfc added the Bug label Aug 27, 2023
@ayoob-lfc
Copy link
Author

ayoob-lfc commented Aug 27, 2023

FYI if I add the following:

        ini_set('memory_limit', '-1');

Just before the line:

if (is_array($configuration)) {

The error goes away!

@dvesh3 dvesh3 added this to the 1.6.5 milestone Sep 14, 2023
@kingjia90
Copy link
Contributor

kingjia90 commented Oct 27, 2023

What happens when removing

if (is_array($configuration)) {
$configuration = json_decode(json_encode($configuration), true);
}

?

This encode/decode looks unnecessary and doesn't change the outcome

@dvesh3 dvesh3 self-assigned this Nov 3, 2023
@dvesh3
Copy link
Contributor

dvesh3 commented Nov 6, 2023

@kingjia90 yes, not necessary it seems since we decode it already as associative on save

$dataDecoded = json_decode($data, true);

Also on import

$importData = json_decode($json, true);

@dvesh3
Copy link
Contributor

dvesh3 commented Nov 9, 2023

Fixed by #813

@dvesh3 dvesh3 closed this as completed Nov 9, 2023
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

3 participants