Code Monkey home page Code Monkey logo

Comments (7)

dereuromark avatar dereuromark commented on June 19, 2024

Are u sure the logging is the problem? What if u disable the db logging?

from cakephp-databaselog.

hammertime44 avatar hammertime44 commented on June 19, 2024

The error does not appear when I revert to file logging. Strangely, I'm not logging anything in my file upload method. Perhaps there's default logging for all actions?

from cakephp-databaselog.

dereuromark avatar dereuromark commented on June 19, 2024

No some error must happen then. Maybe invalid db credentials. stack trace should tell u more.

from cakephp-databaselog.

hammertime44 avatar hammertime44 commented on June 19, 2024

The credentials are fine and am able to log in other actions. However, this particular action accepts a json request with a file attachment throws the error below:


Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 16384 bytes) in /var/www/mcaz_ctr_dev/vendor/dereuromark/cakephp-databaselog/src/Model/Table/DatabaseLogsTable.php on line 69

Fatal error: Allowed memory size of 2151677952 bytes exhausted (tried to allocate 262144 bytes) in /var/www/mcaz_ctr_dev/vendor/cakephp/cakephp/src/ORM/Marshaller.php on line 281

from cakephp-databaselog.

dereuromark avatar dereuromark commented on June 19, 2024

aha, so the blob file data might be the cause.
what are u logging here?

from cakephp-databaselog.

hammertime44 avatar hammertime44 commented on June 19, 2024

Not logging anything in my action (below). I suspect the upload plugin may be logging something automatically.

public function addAttachments()
    {
        $application = $this->Applications->get($this->request->getData('foreign_key'), ['contain' => [], 'fields' => ['id', 'user_id']]);
        if (empty($application)) {
            $this->response->body('Failure');
                $this->response->statusCode(403);
                $this->set([
                        'errors' => 'The application does not exist',
                        'message' => 'Failure', 
                        '_serialize' => ['errors','message']]);
                    return;
        }

        //$category = $this->request->getData();
        if ($this->request->is('post')) {
            $application = $this->Applications->patchEntity($application, $this->request->getData());
            if ($this->Applications->save($application)) {
                $this->set([
                        'message' => 'Success', 
                        //'category' => $category,
                        'content' => $application['attachments'],
                        '_serialize' => ['message', 'content', 'category']]);
                    return;
            } else {
                $this->response->body('Failure');
                $this->response->statusCode(403);
                $this->set([
                        'errors' => $application->errors(),
                        'message' => 'Failure', 
                        '_serialize' => ['errors','message']]);
                    return;
            }
        }
        $this->set(compact('application'));
        $this->set('_serialize', ['application']);
    }

from cakephp-databaselog.

dereuromark avatar dereuromark commented on June 19, 2024

Well, you need to find the point where it logs and debug the data it tries to log. To find out why this fails.
Then, once reproducible we can find out how to fix things.

from cakephp-databaselog.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.