OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Create New Issue DB Error

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Create New Issue DB Error

Postby aimag » Fri Feb 01, 2008 2:48 pm

After installing OJS 2.2.0.0 and successfully importing the back issues and current one, I tried to create a new issue and received the following error message:

DB Error: Duplicate entry '1' for key 2

We tried emptying the sessions table but to no avail (cleared but did not drop using phpadmin). We noticed, however, when looking at issue_settings in phpmyadmin, a warning that
UNIQUE and INDEX keys should not both be set for column 'issue_id"

Is this the problem? Any ideas on how to fix it?

--Mike
aimag
 
Posts: 3
Joined: Fri Feb 01, 2008 2:06 pm

Re: Create New Issue DB Error

Postby asmecher » Wed Feb 06, 2008 11:23 am

Hi Mike,

Just to confirm -- when you get the error message, are you using the import/export tool, or creating the issue via the Editor's "Create Issue" interface?

In order to figure out which SQL statement is causing the problem, could you turn on the show_stacktrace option in config.inc.php, try again, and post the resulting error message?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: Create New Issue DB Error

Postby aimag » Wed Feb 06, 2008 2:46 pm

Thanks Alec.

I've imported 112 issues without incident using the import/export tool. I was trying to create a future issue using the Editor's "Create Issue" interface when I encountered the error. Here's the verbose error message with the show_stacktrace option turned on:

DB Error: Duplicate entry '1' for key 2Stack Trace:File: /usr/local/apache/htdocs/ojs/classes/issue/IssueDAO.inc.php line 252
Function: issuedao->update("INSERT INTO issues (journal_id, volume, number, year, publis...", Array(14))

File: /usr/local/apache/htdocs/ojs/classes/issue/form/IssueForm.inc.php line 348
Function: issuedao->insertissue(Object(issue))

File: /usr/local/apache/htdocs/ojs/pages/editor/IssueManagementHandler.inc.php line 136
Function: issueform->execute()

File: /usr/local/apache/htdocs/ojs/pages/editor/EditorHandler.inc.php line 468
Function: issuemanagementhandler::saveissue()

File: (unknown) line (unknown)
Function: editorhandler::saveissue(Array(0))

File: /usr/local/apache/htdocs/ojs/index.php line 58
Function: call_user_func(Array(2), Array(0))

File: /usr/local/apache/htdocs/ojs/index.php line 69
Function: handlerequest()

--Mike
aimag
 
Posts: 3
Joined: Fri Feb 01, 2008 2:06 pm

Re: Create New Issue DB Error

Postby asmecher » Wed Feb 06, 2008 3:01 pm

Hmm -- could you send me the output of the following MySQL query?
Code: Select all
SHOW INDEXES FROM issues;
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: Create New Issue DB Error

Postby aimag » Thu Feb 07, 2008 3:58 pm

Here it is, Alec. Thank you for your help.

--Mike


| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+--------+------------+------------------------+--------------+-----------------+-----------+-------------+----------+--------+------+------------+---------+
| issues | 0 | PRIMARY | 1 | issue_id | A | 109 | NULL | NULL | | BTREE | |
| issues | 0 | issues_public_issue_id | 1 | public_issue_id | A | NULL | NULL | NULL | YES | BTREE | |
| issues | 0 | issues_public_issue_id | 2 | journal_id | A | NULL | NULL | NULL | | BTREE | |
| issues | 1 | issues_journal_id | 1 | journal_id | A | NULL | NULL | NULL | | BTREE | |
aimag
 
Posts: 3
Joined: Fri Feb 01, 2008 2:06 pm

Re: Create New Issue DB Error

Postby asmecher » Fri Feb 08, 2008 11:45 am

Hi Mike,

Are you entering a public issue ID in the form? If so, try using something different -- it looks to me like you're trying to use a duplicate value. This should be caught by the checks in PHP rather than resulting in a database error, but if you can confirm, I can debug from there.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 3 guests