Problem after upgrading to OJS 3.2.0-2. Crossref Plugin and another errors

Hi @Adriano_Jose,

OK, that’s good news. I’m concerned about the number of author entries that aren’t associated with publications (publication_id), though. Are author listings generally looking correct? Could you look at a sampling of entries in the pre-upgrade database that have the same author_id to see whether they’re associated with submissions (by submission_id)?

Regards,
Alec Smecher
Public Knowledge Project Team

Pre-upgrade (2.4.8-5):

SELECT a.author_id, a.submission_id,a.user_group_id,s.stage_id  FROM authors a,submissions s where a.submission_id=s.submission_id and email in ('phellipecunha@hotmail.com','monica.senna20@gmail.com') order by author_id;

Capturar2

Pos-upgrade (3.2.0-2):

SELECT a.author_id, a.submission_id,a.user_group_id,s.stage_id,p.publication_id,p.primary_contact_id  FROM authors a,submissions s, publications p where a.submission_id=s.submission_id and p.submission_id=s.submission_id  and a.email in ('phellipecunha@hotmail.com','monica.senna20@gmail.com') order by author_id;

Capturar3

Is this what you want to see?

regards,
Adriano Moreno

Hi @Adriano_Jose,

Are those examples of cases where there is no accompanying entry in publications corresponding to the publication_id in authors after upgrading?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
this select:

select * from publications p where p.submission_id not in (select a.submission_id from authors a);

Returns 541 rows.

this select:

select * from publications p where p.submission_id not in (select s.submission_id from submissions s);

Returns 0 rows.

this select:

select * from submissions s where s.submission_id not in (select a.submission_id from authors a);

Returns 542 rows.

this select:

select * from authors a where a.submission_id not in (select s.submission_id from submissions s);

Returns 34 rows.

In the authors table, the publication_id column is all NULL;

Some submissions do not have authors and some authors do not have submissions, but it does not seem to me much in view of the total, because we have 44458 rows in Authors, 25223 rows in Submissions and 25223 rows in Publications table.

Hi @Adriano_Jose,

I would expect the publication_id column of authors to be populated by this query in dbscripts/xml/upgrade/3.2.0_versioning.xml:

UPDATE authors
SET publication_id = s.current_publication_id
FROM submissions s, temp_authors ta
WHERE authors.author_id = ta.author_id AND s.submission_id = ta.submission_id

Just to confirm, what is your driver setting in config.inc.php?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher
The driver is:
driver = postgres

And my system information:

Perhaps the same thing happened when updating email_id, where the data was there, but it just wasn’t copied to the column. So, during the update I ran the script to fill it out.
As I explained here:

Error when updating from 3.1.2-4 to 3.2.0-1 with postgres - #15 by Adriano_Jose

Hi @Adriano_Jose,

Hmm, interesting – would it be possible to re-run the upgrade with postgres7 as the driver instead of postgres? [Edit: I’ve added a fix for this for future releases, starting with OJS/OMP 3.2.0-3. See Driver settings of postgres, postgres6, and postgres9 result in missed upgrade steps · Issue #5763 · pkp/pkp-lib · GitHub]

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I did it in production doing a re-upgrade from 3.2.0-2 to 3.2.0-2, but it seems that it didn’t make any difference, because versioning.xml file did not run again.
On a test machine from 3.1.2-4 to 3.2.0-1, versioning.xml file run, but then an error happened::

ERROR: Upgrade failed: DB: ERROR:  duplicate key value violates unique constraint "citations_publication_seq"
DETALHE:  Key (publication_id, seq)=(6114, 3) already exists.

So I took the publication_id column from the authors table on the test machine and copied it to the production machine, as they are clones.
I thought it would work now, but when trying to make a new submission, it presents the following error:

[Sun Apr 19 00:55:38.606588 2020] [php7:error] [pid 9524] [client 172.20.7.116:55391] PHP Fatal error:  Uncaught Exception: DB Error: ERROR:  null value in column "submission_id" violates not-null constraint\nDETALHE:  Failing row contains (51947, null, 0, suporte.periodicos@grupos.ufes.br, 988, 1, 25353). Query: INSERT INTO authors (email, include_in_browse, publication_id, user_group_id) VALUES (?, ?, ?, ?) in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php:703\nStack trace:\n#0 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_postgres7), 'INSERT INTO aut...')\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/SchemaDAO.inc.php(79): DAO->update('INSERT INTO aut...', Array)\n#2 /var/www/ojs-3.2.0-2/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php(382): SchemaDAO->insertObject(Object(Author))\n#3 /var/www/ojs-3.2.0-2/lib/pkp/pages/submission/PKPSubmissionHandler.inc.php(171): PKPSubmissionSubmitStep1Form->execute()\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): PKPSubmissionHandler->saveStep(Array, Object(Request))\n#5 /var/www/ojs-3.2.0-2/l in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php on line 703, referer: http://periodicos.ufes.br/argumentum/submission/wizard

If I do this sql and update the publication_id on authors table, could give any error?

select p.publication_id, a.author_id  
from authors a
inner join  submissions s
on a.submission_id = s.submission_id
inner join publications p
on s.submission_id = p.submission_id
order by a.author_id 

so, with the results, in all rows, I do like this:

UPDATE AUTHORS SET PUBLICATION_ID = ... WHERE AUTHOR_ID = ... ; Commit;

Whato do you think about this?

Regards,
Adriano Moreno

Hi @Adriano_Jose,

Unfortunately you won’t be able to re-run 3.1.x to 3.2.x steps be re-running the upgrade script again; you’d have to go back to an earlier backup for those scripts to be executed.

Regards,
Alec Smecher
Public Knowledge Project Team

Now it worked. I was able to update all the information in the column publication_id in the authors table.
But, when trying to make a new submission, this error keeps showing up and the screen is locked:

[Sun Apr 19 00:55:38.606588 2020] [php7:error] [pid 9524] [client 172.20.7.116:55391] PHP Fatal error: Uncaught Exception: DB Error: ERROR: null value in column "submission_id" violates not-null constraint\nDETALHE: Failing row contains (51947, null, 0, suporte.periodicos@grupos.ufes.br, 988, 1, 25353). Query: INSERT INTO authors (email, include_in_browse, publication_id, user_group_id) VALUES (?, ?, ?, ?) in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php:703\nStack trace:\n#0 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_postgres7), 'INSERT INTO aut...')\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/SchemaDAO.inc.php(79): DAO->update('INSERT INTO aut...', Array)\n#2 /var/www/ojs-3.2.0-2/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php(382): SchemaDAO->insertObject(Object(Author))\n#3 /var/www/ojs-3.2.0-2/lib/pkp/pages/submission/PKPSubmissionHandler.inc.php(171): PKPSubmissionSubmitStep1Form->execute()\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): PKPSubmissionHandler->saveStep(Array, Object(Request))\n#5 /var/www/ojs-3.2.0-2/l in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php on line 703, referer: http://periodicos.ufes.br/argumentum/submission/wizard

I searched the table for the values in the error line and the information is there in the Submissions and Publications tables. What would be the reason for the NULL submission_id information?

select *  from publications where publication_id = 25353  ;

50

select *  from submissions  where submission_id = 29901 ;

34

Hi @Adriano_Jose,

This message:

DB Error: ERROR: null value in column "submission_id" violates not-null constraint

…is caused by the ADODB library we rely on for schema management failing to drop a constraint in the database that has been removed from the XML schema descriptors. You should be able to correct it by running:

ALTER TABLE authors ALTER COLUMN submission_id DROP NOT NULL;

That modification should work fine on your current database; this will need to be run after the upgrade is executed, not before, in case you execute the upgrade again from backup for some reason.

There may be other cases like this (see also Error when updating from 3.1.2-4 to 3.2.0-1 with postgres - #5 by Adriano_Jose).

Longer term, we’re planning to stop using the ADODB library for schema management; see https://github.com/pkp/pkp-lib/issues/2493 for details.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Hi @asmecher,
thanks again. It is now possible to make submissions.
But when using the Quick Submit plugin and others functionalities, these error appears:

Error 1:

[Tue Apr 21 09:02:50.937545 2020] [php7:error] [pid 25430] [client 114.119.166.72:10370] PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /var/www/ojs-3.2.0-2/pages/search/SearchHandler.inc.php:215\nStack trace:\n#0 [internal function]: SearchHandler->{closure}(14904)\n#1 /var/www/ojs-3.2.0-2/pages/search/SearchHandler.inc.php(216): array_map(Object(Closure), Array)\n#2 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): SearchHandler->authors(Array, Object(Request))\n#3 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/Dispatcher.inc.php(143): PKPPageRouter->route(Object(Request))\n#5 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPApplication.inc.php(278): Dispatcher->dispatch(Object(Request))\n#6 /var/www/ojs-3.2.0-2/index.php(68): PKPApplication->execute()\n#7 {main}\n  thrown in /var/www/ojs-3.2.0-2/pages/search/SearchHandler.inc.php on line 215

Error 2:

[Tue Apr 21 09:10:16.488811 2020] [php7:error] [pid 25595] [client 114.119.160.55:53204] PHP Fatal error:  Uncaught Error: Call to a member function getJournalId() on null in /var/www/ojs-3.2.0-2/classes/issue/IssueAction.inc.php:31\nStack trace:\n#0 /var/www/ojs-3.2.0-2/pages/search/SearchHandler.inc.php(245): IssueAction->subscriptionRequired(NULL, Object(Journal))\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): SearchHandler->authors(Array, Object(Request))\n#2 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)\n#3 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/Dispatcher.inc.php(143): PKPPageRouter->route(Object(Request))\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPApplication.inc.php(278): Dispatcher->dispatch(Object(Request))\n#5 /var/www/ojs-3.2.0-2/index.php(68): PKPApplication->execute()\n#6 {main}\n  thrown in /var/www/ojs-3.2.0-2/classes/issue/IssueAction.inc.php on line 31

Error 3:

[Tue Apr 21 09:14:34.331452 2020] [php7:error] [pid 25636] [client 181.213.94.80:59108] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function PKP\\Services\\PKPPublicationService::edit(), 2 passed in /var/www/ojs-3.2.0-2/classes/controllers/grid/issues/IssueGridHandler.inc.php on line 318 and exactly 3 expected in /var/www/ojs-3.2.0-2/lib/pkp/classes/services/PKPPublicationService.inc.php:498\nStack trace:\n#0 /var/www/ojs-3.2.0-2/classes/controllers/grid/issues/IssueGridHandler.inc.php(318): PKP\\Services\\PKPPublicationService->edit(Object(Publication), Array)\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): IssueGridHandler->deleteIssue(Array, Object(Request))\n#2 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)\n#3 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/Dispatcher.inc.php(143): PKPComponentRouter->route(Object(Request))\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPApplication.inc.php(278): Dispatcher->dispatch(Object(Request))\n#5 /var/www/ojs-3.2.0-2/index.php(68): PK in /var/www/ojs-3.2.0-2/lib/pkp/classes/services/PKPPublicationService.inc.php on line 498, referer: http://periodicos.ufes.br/almanaque/manageIssues

Error 4 (I think this about Quick Submission):

[Tue Apr 21 09:22:25.647889 2020] [php7:error] [pid 25875] [client 181.213.94.80:59329] PHP Fatal error:  Uncaught Exception: DB Error: ERROR:  duplicate key value violates unique constraint "publication_galleys_pkey"\nDETALHE:  Key (galley_id)=(13) already exists. Query: INSERT INTO publication_galleys (locale, label, publication_id, url_path, remote_url) VALUES (?, ?, ?, ?, ?) in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php:703\nStack trace:\n#0 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_postgres7), 'INSERT INTO pub...')\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/SchemaDAO.inc.php(79): DAO->update('INSERT INTO pub...', Array)\n#2 /var/www/ojs-3.2.0-2/controllers/grid/articleGalleys/form/ArticleGalleyForm.inc.php(165): SchemaDAO->insertObject(Object(ArticleGalley))\n#3 /var/www/ojs-3.2.0-2/controllers/grid/articleGalleys/ArticleGalleyGridHandler.inc.php(405): ArticleGalleyForm->execute()\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): ArticleGalleyGridHandler->updateGalley(Array, Object(Request))\n#5 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPC in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php on line 703, referer: http://periodicos.ufes.br/almanaque/management/importexport/plugin/QuickSubmitPlugin/saveSubmit

Error 5:

[Tue Apr 21 10:37:12.936834 2020] [php7:error] [pid 28735] [client 201.68.18.126:57983] PHP Fatal error:  Uncaught Exception: DB Error: ERROR:  duplicate key value violates unique constraint "sessions_pkey"\nDETAIL:  Key (session_id)=(ec7897014f9d39d1213117a03a554f48) already exists. Query: INSERT INTO sessions\n\t\t\t\t(session_id, ip_address, user_agent, created, last_used, remember, data, domain)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, ?, ?, ?, ?) in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php:703\nStack trace:\n#0 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_postgres7), 'INSERT INTO ses...')\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/session/SessionDAO.inc.php(78): DAO->update('INSERT INTO ses...', Array)\n#2 /var/www/ojs-3.2.0-2/lib/pkp/classes/session/SessionManager.inc.php(89): SessionDAO->insertObject(Object(Session))\n#3 /var/www/ojs-3.2.0-2/lib/pkp/classes/session/SessionManager.inc.php(129): SessionManager->__construct(Object(SessionDAO), Object(Request))\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/security/Validation.inc.php(377): SessionManager::getManager()\n#5 /var/www/ojs-3.2. in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php on line 703

Could you help me again?

Hi all,
I am not sure if this is the right post for my problem. I upgraded to OJS 3.2.0.2 and crossref plugin could not deposit DOI properly. Here are the messages from the error log. It also led to a HTTP 500 error page.

Please help and let me know what can I do to solve the proper export of DOI to crossref?

Many thanks!
Neuroscirn

[22-Apr-2020 07:10:27 Asia/Kuala_Lumpur] PHP Fatal error:  Uncaught Error: Call to a member function saveXml() on null in /home/neurosc1/public_html/ojs/classes/plugins/PubObjectsExportPlugin.inc.php:372
Stack trace:
#0 /home/neurosc1/public_html/ojs/plugins/importexport/crossref/CrossRefExportPlugin.inc.php(219): PubObjectsExportPlugin->exportXML(Array, 'article=>crossr...', Object(Journal), false)
#1 /home/neurosc1/public_html/ojs/classes/plugins/PubObjectsExportPlugin.inc.php(176): CrossRefExportPlugin->executeExportAction(Object(Request), Array, 'article=>crossr...', 'exportSubmissio...', 'articles', false)
#2 /home/neurosc1/public_html/ojs/classes/plugins/DOIPubIdExportPlugin.inc.php(29): PubObjectsExportPlugin->display(Array, Object(Request))
#3 /home/neurosc1/public_html/ojs/lib/pkp/pages/management/PKPToolsHandler.inc.php(104): DOIPubIdExportPlugin->display(Array, Object(Request))
#4 /home/neurosc1/public_html/ojs/lib/pkp/classes/core/PKPRouter.inc.php(391): PKPToolsHandler->importexport(Array, Object(Request))
#5 /home/neurosc1/public_html/ojs/lib/pkp/classe in /home/neurosc1/public_html/ojs/classes/plugins/PubObjectsExportPlugin.inc.php on line 372
1 Like

Hi @neuroscirn,

That’s a different issue – see CrossRef exports are empty after upgrade · Issue #5681 · pkp/pkp-lib · GitHub.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,
would it be possible to correct these errors?
I am very concerned, as this machine is in production, with more than 80 journals and I’m getting a lot of complaints.

Mainly this: Error 4 (I think this about Quick Submission)

[Tue Apr 21 09:22:25.647889 2020] [php7:error] [pid 25875] [client 181.213.94.80:59329] PHP Fatal error:  Uncaught Exception: DB Error: ERROR:  duplicate key value violates unique constraint "publication_galleys_pkey"\nDETALHE:  Key (galley_id)=(13) already exists. Query: INSERT INTO publication_galleys (locale, label, publication_id, url_path, remote_url) VALUES (?, ?, ?, ?, ?) in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php:703\nStack trace:\n#0 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_postgres7), 'INSERT INTO pub...')\n#1 /var/www/ojs-3.2.0-2/lib/pkp/classes/db/SchemaDAO.inc.php(79): DAO->update('INSERT INTO pub...', Array)\n#2 /var/www/ojs-3.2.0-2/controllers/grid/articleGalleys/form/ArticleGalleyForm.inc.php(165): SchemaDAO->insertObject(Object(ArticleGalley))\n#3 /var/www/ojs-3.2.0-2/controllers/grid/articleGalleys/ArticleGalleyGridHandler.inc.php(405): ArticleGalleyForm->execute()\n#4 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPRouter.inc.php(391): ArticleGalleyGridHandler->updateGalley(Array, Object(Request))\n#5 /var/www/ojs-3.2.0-2/lib/pkp/classes/core/PKPC in /var/www/ojs-3.2.0-2/lib/pkp/classes/db/DAO.inc.php on line 703, referer: http://periodicos.ufes.br/almanaque/management/importexport/plugin/QuickSubmitPlugin/saveSubmit

Thanks @asmecher. The issue has been solved!

Hi @asmecher and @Adriano_Jose

I’m in the same situation here, unable to create a galley:

ERROR: duplicate key value violates unique constraint “publication_galleys_pkey”

Regards,
Tarcisio Pereira

Hi @Tarcisio_Pereira,

It looks like you’ve already found the solution – to reset your PostgreSQL sequences: (OJS 3.2.0-3) DB Error: duplicate key value violates unique constraint "publication_galleys_pkey" - #6 by Tarcisio_Pereira

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

I used ojs 3.2.0.2 and i cant export Crossref and Doaj data, what can i do?

Hi @thelaris,

Can you describe the problem in more detail?

Regards,
Alec Smecher
Public Knowledge Project Team