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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.