Error importing users into OJS 2.4.8

Hi,

I’m trying to import users xml into OJS but keep getting the following error. I checked all the user tables they only go upto ID 39 currently

DB Error: Duplicate entry ‘39-441’ for key ‘u_e_pkey’

I also cant find the field in the db?

Any help would be appreciated,

Thank you

Hi @Nardusg,

The u_e_pkey index is defined in lib/pkp/xml/schema/controlledVocab.xml. At a guess, it sounds like a user has the same reviewing interest specified more than once in your XML.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Thank you for the feedback.
I had a look at the XML file, every single user has only one reviewing interest.

SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [type] => reviewer
        )

)

There are also no duplicate users or emails addresses in it.
The file contains 430 users.

Is there anything else you can think of why I might be getting this error.

Can I perhaps send you the xlm file and you can try import it ?

Thank you

Hi @Nardusg,

Is it possible that you’re importing a user who already exists, and has that reviewing interest already assigned to their account? (If you can confirm this, it would be a good aspect of the code to improve.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I cleared all the users from the system and tried the import again but got the same error, this time instead of
DB Error: Duplicate entry ‘39-441’ for key ‘u_e_pkey’
I got
DB Error: Duplicate entry ‘74-441’ for key ‘u_e_pkey’

So it definitely a user user causing the issue, but im not sure how to identify the user.

Any other ideas?

Regards

Hi @Nardusg,

Check your username for the entry in the users table where user_id = 74.

What is the XML for that user account?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Thank you for the response,

I managed to import all the users in batches of 42.
For some reason the import kept on failing on the 43 or 44 record, even tho the record had a first_name, the entry in the db would have “user1” as the first_name and he rest of the record would be empty except for the dates.

This happened every time I had more than 42 records in die XML file.

Regards
Nardus

Hi @Nardusg,

Ah, that note about the number of users is helpful. I see this has already been caught at Importing users from 2.2.4 to 2.4.8. You should be able to increase your server’s max_input_vars setting to allow more at a time. (Note that the OJS 3.x plugin doesn’t have this limit.)

Regards,
Alec Smecher
Public Knowledge Project Team

Now I feel dumb haha, I never even thought of that. Thank you

Hi @asmecher

Apologies for all the request, but im in the process up upgrading 14 journals from 2.4.8 to 3.1

I managed to do 3 but the forth one is giving me the following error when trying to upgrade.

A database error has occurred: Invalid use of NULL value

You wouldn’t perhaps know why?

Regards

Hi @Nardusg,

Could you post this as a new topic with as many relevant details as you can include? That’ll help keep the forum organized. I’d suggest seeing if you can determine what step in the upgrade process is being executed – if you’re not using the command-line upgrade tool, then I’d recommend it; it provides more information on what the upgrade is doing.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you very much I have created a new topic for this.