MySQL Error after Migration and Upgrade - Application Error #401 - MySQL Error 1062

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
MJHurst
Posts: 4
Joined: 08 Mar 2021, 16:48

MySQL Error after Migration and Upgrade - Application Error #401 - MySQL Error 1062

Post by MJHurst »

I'm trying to move our Mantis implementation from windows server running IIS and a MS SQL for the database to an Ubuntu server using Apache2 and MySQL. I've successfully, sort of, moved the data from MS SQL to MySql and stood up the new version of Mantis. The database is connected to Mantis and I'm able to login. Here is where i'm stuck. Once i'm logged in i'm able to to select any of the issues in the database. Once i do this and click on something like the "Manage" button, i'm presented with the following:

APPLICATION ERROR #401 Database query failed. Error received from database was #1062: Duplicate entry '0' for key 'mantis_tokens_table.PRIMARY' for the query: INSERT INTO mantis_tokens_table ( type, value, timestamp, expiry, owner ) VALUES ( ?, ?, ?, ?, ? ).

Once this message is presented, i'm not able to do anything else within the site. If i clear my cache and try to access the site, same error message. The only way i've found to get past this is to delete the record '0' from that table. Once deleted i log back in, it works, and then the same message pops up again.

I suspect this has something to do with Database permissions, but I'm not sure where to start.
cas
Posts: 1516
Joined: 11 Mar 2006, 16:08
Contact:

Re: MySQL Error after Migration and Upgrade - Application Error #401 - MySQL Error 1062

Post by cas »

Is perhaps the auto-increment missing on the id-field?
If so, run this command within phpmyadmin:

Code: Select all

ALTER TABLE `mantis_tokens_table`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
MJHurst
Posts: 4
Joined: 08 Mar 2021, 16:48

Re: MySQL Error after Migration and Upgrade - Application Error #401 - MySQL Error 1062

Post by MJHurst »

Thank you! That seems to have fixed it. Strange that it only started after the migration.
Post Reply