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

GET /object?filter[notexistingfield]=string => 500 with memory exhausted #1359

Closed
didoda opened this issue Oct 18, 2017 · 10 comments
Closed

Comments

@didoda
Copy link
Member

didoda commented Oct 18, 2017

Objects filter

Calling GET /object?filter[notexistingfield]=string we'd expect a response 200 with no data.
Instead we got a 500, and memory exhausted error.

Sample stack trace:

{
    "error": {
        "status": "500",
        "title": "Allowed memory size of 536870912 bytes exhausted (tried to allocate 72 bytes)",
        "meta": {
            "trace": [
                "#0 \/var\/www\/workspace\/bedita4\/vendor\/cakephp\/cakephp\/src\/Error\/BaseErrorHandler.php(105): Cake\\Error\\BaseErrorHandler-\u003EhandleFatalError(1, \u0027Allowed memory ...\u0027, \u0027\/var\/www\/worksp...\u0027, 341)",
                "#1 [internal function]: Cake\\Error\\BaseErrorHandler-\u003ECake\\Error\\{closure}()",
                "#2 {main}"
            ]
        }
    },
    "links": {
        "self": "http:\/\/bedita4.lcl\/objects?page=1\u0026page_size=10\u0026filter%5Bstatusssss%5D=off",
        "home": "http:\/\/bedita4.lcl\/home"
    }
}
@stefanorosanelli
Copy link
Member

this does not happen in my environment and elsewhere, check for instance
https://be4-test.bedita.net/objects?filter%5Bgustavo%5D=off"

400 response is correct IMHO

@didoda
Copy link
Member Author

didoda commented Oct 18, 2017

actually this bug happens only when BEdita DevTools is enabled config app.php:

'BEdita/DevTools' => ['autoload' => true, 'bootstrap' => true],

@fquffio
Copy link
Member

fquffio commented Oct 18, 2017

I have BEdita/DevTools enabled, but still I cannot reproduce… 😕

Could you please run this command?
echo '<?php phpinfo();' > BEDITA4_ROOT/webroot/info.php && open http://BEDITA4_URL/info.php
Then search for memory_limit in the webpage that has been loaded, and report it here.

Please note that this might not be equivalent to running php -i | grep memory_limit, since configuration files might be different for PHP as CLI, Apache module or FPM.

My value is 128M and should be more than enough, unless you have to process large files. Is yours significantly lower?


I have tested with PHP 5.6.31, 7.0.22 and 7.1.8.


I also tried turning debug off, and loading BEdita/DevTools regardless of it, or loading it with CakePHP's autoloader, but still works.

Have you tried to run composer update?

@didoda
Copy link
Member Author

didoda commented Oct 18, 2017

My value is 128M too

@didoda
Copy link
Member Author

didoda commented Oct 19, 2017

It seems that this bug is reproduceable only in my environment.
Debug kit, on 400 exception, launch a query Select <...> from objects <...> that consumes all the memory.
When I disable debug kit plugin, I get the expected behaviour (400).

@fquffio
Copy link
Member

fquffio commented Nov 7, 2017

@didoda Sorry, I read your comment just now… Do you still experience the issue? Do you have a custom debugkit connection in your app.php? Have you tried to remove any *.sqlite file in your tmp/ directory?

@didoda
Copy link
Member Author

didoda commented Nov 10, 2017

In app.php:

    'Plugins' => [
        'DockBooking' => ['autoload' => true, 'routes' => true],
        'BEdita/DevTools' => ['autoload' => true, 'bootstrap' => true],
    ],

sqlite files removed, I'm still experiencing the problem

@stefanorosanelli
Copy link
Member

@didoda is this still happening? or can we close it?

@didoda
Copy link
Member Author

didoda commented Jan 8, 2019

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /<...>/bedita4/vendor/cakephp/cakephp/src/ORM/ResultSet.php on line 341

Still happening. However, if the issue is minor, we can close it

@batopa batopa modified the milestones: 4.0.0, 4-next Jan 9, 2019
@didoda
Copy link
Member Author

didoda commented Oct 9, 2019

Not happening anymore

@didoda didoda closed this as completed Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants