loeffel

Headers already sent error

Recommended Posts

Line 70 of app/code/community/Ess/M2ePro/controllers/CronController.php is producing an error in system.log:

2017-12-22T07:12:14+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /var/www/clients/client1/web2/web/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /var/www/clients/client1/web2/web/lib/Zend/Controller/Response/Abstract.php:768
[2] /var/www/clients/client1/web2/web/app/code/core/Mage/Core/Controller/Response/Http.php:84
[3] /var/www/clients/client1/web2/web/app/code/core/Mage/Core/Controller/Varien/Front.php:184
[4] /var/www/clients/client1/web2/web/app/code/core/Mage/Core/Model/App.php:365
[5] /var/www/clients/client1/web2/web/app/Mage.php:684
[6] /var/www/clients/client1/web2/web/index.php:83

 

The Code in CronController.php producing the error:

    private function closeConnection()
    {
        @ob_end_clean();
        ob_start();

        ignore_user_abort(true);
        $this->getResponse()->setBody('processing...');
        $this->getResponse()->outputBody();

        header('Connection: Close');
        header('Content-Length: '.ob_get_length());

        while (ob_get_level()) {
            if (!$result = @ob_end_flush()) {
                break;
            }
        }

        @flush();

        $this->getResponse()->headersSentThrowsException = false;
    }

Is there a way to fix this as it bloats up my system.log

Edited by loeffel

Share this post


Link to post
Share on other sites

I got a response from M2E and it works :)

 

Quote

 

The log records that you are referring to are indeed returned as a result of the Cron Job operations. However, these are not the errors that could affect the performance of your Magento. The records are just the warnings that do interfere with work of the system. 
In the future M2E Pro version, we will implement the necessary changes to make sure that the warnings are not displayed in the system logs. 

 To prevent the warnings from being returned in the current version, you can simply comment out the line in the specified file, please see the details below:

 - you just need to navigate to app/code/community/Ess/M2ePro/controllers/CronController.php

 - find and comment out the line $this->closeConnection();

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.