Tasks not loading for certain users

ojs3
upgrade
Tags: #<Tag:0x007f483f181b98> #<Tag:0x007f483f1819e0>

#1

Hi,
Once again, I would like to start with thanks to the developers for untiring efforts on OJS.

There are similar titles related to task errors, and I examined them. Unfortunately, their comments did not help me. Origin of their error messages and their problem seems to be different.
I have site manager and editor roles and have full database and ftp access.

I upgraded the journal’s system from OJS 2.4.8.2 to 3.0.2. Although it did not previously exist (for a few weeks), I started to get an error message when I log in as another editor. The error message is:
Failed to load resource: the server responded with a status of 500 (Internal Server Error).

Safari inspector shows that error too;

h ttp://www.adlitipbulteni.com/index.php/atb/$$$call$$$/grid/notifications/task-notifications-grid/fetch-grid?_=1499614724526

I noticed that this error occurs immediately when I open the backend control panel and repeats every time.

Although Tasks button show number of existing tasks, it does not show anything except “loading” text and a rotating circle. In the meantime, I got the following error in php log.

PHP Warning: assert(): Assertion failed in .../lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php on line 122
PHP Fatal error: Call to a member function getAssocType() on null in .../lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php on line 123

The same user (editor) also reports the same issue when he logs in with his username and password. I get the same issue when I log in as some other users (authors) also. 

Hope, we can find a solution for this.
Best Regards,
Ugur Kocak

Server Environment: Linux OS, PHP version 5.6.29, Apache 2.2, database driver mysql, Database server version 5.6.34.


[3.0.2 --> 3.1] Issues inaccessible
Cannot load tasks view
#2

Hi @drugurkocak,

The assertion warning shouldn’t cause a 500 error; you should see something like a Fatal Error message in your PHP log at the same date/time as you attempt to fetch the tasks list.

Regards,
Alec Smecher
Public Knowledge Project Team


#3

Several days ago we faced with the same problem! Exactly, tasks not loading!

PHP Warning: assert(): Assertion failed in .../lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php on line 150
PHP Fatal error: Call to a member function getLocalizedTitle() on a non-object in .../lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php on line 152

Everything was OK last week. No ideas… :frowning:


#4

Hi @rkhalikov,

What version of OJS are you using? (Please include this information in your posts.)

Regards,
Alec Smecher
Public Knowledge Project Team


#5

OJS 3.0.2
OS platform Linux
PHP version 5.5.38
Apache version Apache/2.2.22 (@RELEASE@)
Database driver mysql
Database server version 5.5.56


#6

Hi @rkhalikov,

I suspect there’s some inconsistent data in your database that’s confusing OJS. Can you try turning on the show_stacktrace option in config.inc.php? This will cause the log to record more data when the error is encountered.

Regards,
Alec Smecher
Public Knowledge Project Team


Tasks Not Working
#7

OK, I’ve enabled show_stacktrace and tried to see tasks. But I have only the same fatal errors in logs (in line 150 and 152) as before. Other errors are PHP Warning: file_exists(): and PHP Strict Standards.


#8

Hi @rkhalikov,

Hmm, OK. Could you edit lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php and find line 150:

assert(is_a($submission, 'Submission'));

Just below that, add:

error_log('Assoc type: ' . $notification->getAssocType() . ' Assoc ID: ' . $notification->getAssocId());

This should cause some useful information to get logged.

Regards,
Alec Smecher
Public Knowledge Project Team


#9

Well, done. But I guess, no more info received:

[error] Assoc type: 1048585 Assoc ID: 27, referer: https://.../submissions
[error] Assoc type: 1048586 Assoc ID: 8, referer: https://.../submissions
[error] PHP Warning:  assert(): Assertion failed in .../lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php on line 150
[error] Assoc type: 1048585 Assoc ID: 13, referer: https://.../submissions
[error] PHP Fatal error:  Call to a member function getLocalizedTitle() on a non-object in .../lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php on line 154, referer: https://.../submissions

#10

Hi @rkhalikov,

It looks like you have notifications that refer to nonexistent submissions. Could you try the following query?

SELECT * FROM notifications n LEFT JOIN submissions s ON (n.assoc_id=s.submission_id) WHERE n.assoc_type=1048585 AND s.submission_id IS NULL;

Simply deleting any resulting records should resolve the issue, but I’d like to see if I can track down the source of these.

Regards,
Alec Smecher
Public Knowledge Project Team


#11

No results :frowning: MySQL returned an empty result set (i.e. zero rows).

I tried to add one new paper (new submission). It works, I see 1 new task label, but list of tasks is not loading:

Requering SQL returned zero rows as well…


#12

Hi @rkhalikov,

Hmm, can you try:

SELECT * FROM notifications n LEFT JOIN queries q ON (n.assoc_id=q.query_id) WHERE n.assoc_type=1048586 AND q.query_id IS NULL;

Regards,
Alec Smecher
Public Knowledge Project Team


#13

Done, but zero rows again…


#14

Hi @rkhalikov,

Hmm, another hypothesis:

 SELECT s.submission_id, s.section_id FROM submissions s LEFT JOIN sections se ON (s.section_id = se.section_id) WHERE se.section_id IS NULL;

Regards,
Alec Smecher
Public Knowledge Project Team


#15

Hmm, one result:

submission_id 13
section_id null


#16

Hi @rkhalikov,

OK, that’s definitely a data error, though I’m not 100% sure it’s the one that’s causing your tasks list to fail. Submission ID 13 is assigned to a nonexistent section. You’ll have to correct this in the database – update the section_id value of the submissions table for that row.

Regards,
Alec Smecher
Public Knowledge Project Team


#17

Can I just delete this entry (Submission ID 13)?


#18

Hi @rkhalikov,

Yes, if you don’t mind it disappearing from the record.

Regards,
Alec Smecher
Public Knowledge Project Team


#19

OK, I went another way. For a troubled journal, I recreated its sections. Then I mapped a problem article (Submission ID 13, what irony :wink: ) for a new section by editing submissions table.
And the problem with tasks has disappeared! Now everything is working properly. Thank you very much for your help!


#20

Hi @asmecher,
I’m sorry I could not write an anything before. I am little busy, so I am just reading it.
I am sure my issue is also caused by a mess in the database, probably I did.
Only the following query gives some results, others give empty results.
SELECT * FROM notifications n LEFT JOIN queries q ON (n.assoc_id=q.query_id) WHERE n.assoc_type=1048586 AND q.query_id IS NULL;


Your suggestions will make me happy.
Best regards,
Ugur Kocak