PKPApplication->errorHandler(2, "Cannot modify header information

Hi all,

My OJS installation is throwing the following two errors on a few pages

ojs2 has produced an error Message: WARNING: Cannot modify header information - headers already sent by (output started at /var/www/pg/lib/pkp/lib/adodb/adodb.inc.php:377) In file: /var/www/pg/lib/pkp/classes/template/PKPTemplateManager.inc.php At line: 340 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, “Cannot modify header information - headers already sent by (output started at /var/www/pg/lib/pkp/lib/adodb/adodb.inc.php:377)”, “/var/www/pg/lib/pkp/classes/template/PKPTemplateManager.inc.php”, 340, Array(7)) File: /var/www/pg/lib/pkp/classes/template/PKPTemplateManager.inc.php line 340 Function: header(“Content-Type: text/html; charset=utf-8”) File: /var/www/pg/pages/reviewer/SubmissionReviewHandler.inc.php line 70 Function: PKPTemplateManager->display(“reviewer/submission.tpl”) File: (unknown) line (unknown) Function: SubmissionReviewHandler->submission(Array(1), Object(Request)) File: /var/www/pg/lib/pkp/classes/core/PKPRouter.inc.php line 362 Function: call_user_func(Array(2), Array(1), Object(Request)) File: /var/www/pg/lib/pkp/classes/core/PKPPageRouter.inc.php line 220 Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(1), False) File: /var/www/pg/lib/pkp/classes/core/Dispatcher.inc.php line 134 Function: PKPPageRouter->route(Object(Request)) File: /var/www/pg/lib/pkp/classes/core/PKPApplication.inc.php line 178 Function: Dispatcher->dispatch(Object(Request)) File: /var/www/pg/index.php line 70 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.4.41-0+deb7u1 Apache Version: Apache/2.2.22 (Debian) DB Driver: mysql DB server version: 5.5.43-0+deb7u1

ojs2 has produced an error Message: WARNING: Cannot modify header information - headers already sent by (output started at /var/www/pg/lib/pkp/lib/adodb/adodb.inc.php:377) In file: /var/www/pg/lib/pkp/classes/template/PKPTemplateManager.inc.php At line: 343 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, “Cannot modify header information - headers already sent by (output started at /var/www/pg/lib/pkp/lib/adodb/adodb.inc.php:377)”, “/var/www/pg/lib/pkp/classes/template/PKPTemplateManager.inc.php”, 343, Array(7)) File: /var/www/pg/lib/pkp/classes/template/PKPTemplateManager.inc.php line 343 Function: header(“Cache-Control: no-store”) File: /var/www/pg/pages/reviewer/SubmissionReviewHandler.inc.php line 70 Function: PKPTemplateManager->display(“reviewer/submission.tpl”) File: (unknown) line (unknown) Function: SubmissionReviewHandler->submission(Array(1), Object(Request)) File: /var/www/pg/lib/pkp/classes/core/PKPRouter.inc.php line 362 Function: call_user_func(Array(2), Array(1), Object(Request)) File: /var/www/pg/lib/pkp/classes/core/PKPPageRouter.inc.php line 220 Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(1), False) File: /var/www/pg/lib/pkp/classes/core/Dispatcher.inc.php line 134 Function: PKPPageRouter->route(Object(Request)) File: /var/www/pg/lib/pkp/classes/core/PKPApplication.inc.php line 178 Function: Dispatcher->dispatch(Object(Request)) File: /var/www/pg/index.php line 70 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.4.41-0+deb7u1 Apache Version: Apache/2.2.22 (Debian) DB Driver: mysql DB server version: 5.5.43-0+deb7u1

This errors only shows when I turn on the option related to database debug:
; Enable database debug output (very verbose!)
debug = On

I’m not really sure on where to look to get more information on this bug, it is pretty strange and I’m worried that I’m losing functionality in some unknown procedure.

I’m looking for anything, since this installation comes from at least version 2.3 (I can’t be sure) and I’m not in contact with previous sysadmins. Currently it is on 2.4.7-1.

Does anybody have an idea on where to look?

It seems like adodb is raising an error before OJS gets a chance to start the page output. The line in question (/var/www/pg/lib/pkp/lib/adodb/adodb.inc.php:377) seems to be outputing the adodb error message. Are you sure there isn’t another line before the OJS HTML content in the browser that describes the adodb error?

Hi all,

The debug option in config.inc.php will naturally cause this error message – with debug enabled, whenever OJS attempts to execute a database query, it’ll be displayed to the user. This will sometimes interfere with OJS’s normal operation, e.g. if it’s trying to redirect a user but debug output has already been displayed.

The debug option is only intended for specific debugging and shouldn’t be turned on beyond exploring a specific page.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thanks Guys,

Actually, We are experiencing what I had believe to be an error and thought that error message have something to do with it.

Now I believe this rather be normal behaviour and we’re missing something on the process of reviewing the file, but it happened for more than 1 user and we don’t now why.

Reviewer login and see one active review pending:

Clicks on the article to enter the review: (It’s past due date now, but this happened before)

Then the reviewer can’t do anything in step 4 and step 5, in a normal case there would be boxes to upload files there.

The only errors that shows on debug mode are the ones that I mentioned in the first post.

Does anybody confirm that the last print shows a bug or it is normal to hide the 4th and 5th items?

Hi @samueloph,

Glancing at the current code, the only thing that should be hiding those options is if a recommendation is already recorded for the review; is that a possibility?

Regards,
Alec Smecher
Public Knowledge Project Team

I think that’s not possible because I can login as a reviewer that didn’t accept to review, and just after accepting it this happens.

I’m did look at the changes I’ve made to OJS to see if there was something wrong, we modify the following files in our OJS, but everything looks ok (they are minor modifications).
templates/manager/people/userProfileForm.tpl
templates/author/submit/step3.tpl
lib/pkp/locale/pt_BR/register.tpl
locale/pt_BR/author.xml
lib/pkp/locale/pt_BR/user.xml

Could this be something database related? Or there is some files missing?

This journal was inserted in OJS using fullJournalTrasnfer (GitHub - lepidus/fullJournalTransfer: OJS plugin for importing/exporting a journal with all its private information (e.g. submitted articles, reviews, editorial decisions, etc.)), is it possible that the transfer caused this? If so, can you give me a hint of what could’ve caused?

Also, I can confirm that this does not happen on the original OJS installation of the journal, just on the one that it has been migrated, but I was thinking our installation had something broken on it. I also gonna see if I can find this error in a journal that has not been transfered using the plugin.

Thanks a lot Alec!

Hi @samueloph,

I’m also thinking it might be a piece of data that wasn’t migrated. You’ll have to start investigating in the PHP side of things – let me know if I can provide some guidance on something specific.

Regards,
Alec Smecher
Public Knowledge Project Team

Hey Folks,

It looks like the problem was on the plugin side, I contacted the developer and he’s already wroking on this.

In case anybody is using the plugin and faces this problem, I’m gona test this workaround that probably fixes the problem:
UPDATE review_assignments SET recommendation=NULL WHERE recommendation=0;

Note: This is a SQL code that must be executed in the database which your OJS connects.

Thanks fot the attention and help!