Migrate from to 1.9.17 error - needed "auto_increment"

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
johnwebber
TestLink user
Posts: 5
Joined: Mon Dec 23, 2019 3:30 pm

Migrate from to 1.9.17 error - needed "auto_increment"

Post by johnwebber »

Hi,

We have recently migrated from 1.9.4 to 1.9.17. We followed the documented migration steps, but we still encountered the following error when we attempted to access the site:

[19/Dec/19 15:05:19][ERROR][<nosession>][DATABASE]
ERROR ON exec_query() - database.class.php <br />1062 - Duplicate entry '0' for key 'PRIMARY' - /* Class:tlTransaction - Method: writeToDB */ INSERT INTO transactions (entry_point,start_time,end_time,user_id,session_id) VALUES ('/login.php',1576767919,0,0,NULL)<br />THE MESSAGE : /* Class:tlTransaction - Method: writeToDB */ INSERT INTO transactions (entry_point,start_time,end_time,user_id,session_id) VALUES ('/login.php',1576767919,0,0,NULL)
Query failed: errorcode[1062]
errormsg:Duplicate entry '0' for key 'PRIMARY'
[<<][5dfb91afdfc28663290898][DEFAULT][/login.php][19/Dec/19 15:05:19][19/Dec/19 15:05:19][took 0.006857 secs]


We were able to resolve this issue by amending two tables ("transactions” and “events”) by adding "auto_increment" to the IDs for these two tables. Neither of these two tables previously had the "ID" field as auto increment.

The site is now working as expected on 1.9.17, but we wanted to ask if anyone else had come across this issue?

Thanks
John
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Migrate from to 1.9.17 error - needed "auto_increment"

Post by fman »

Hi these two tables are not critic, then you can delete contents if needed.
Please continue upgrade to version 1.9.19 this is latest stable (need to fix the site), but for 1.9.19 use the code from branch tl1.1.19.01 from github
johnwebber
TestLink user
Posts: 5
Joined: Mon Dec 23, 2019 3:30 pm

Re: Migrate from to 1.9.17 error - needed "auto_increment"

Post by johnwebber »

Thank you for your help!

I identified the cause of my issue: we had migrated to a new server as well as upgrading and I discovered that the way in which I had dumped the testlink database was incorrect - I had used the "--skip-opt" option, which meant that all of the "auto_increment" fields were not set correctly. I have therefore re-done the dump without the "--skip-opt" and then re-performed the migration steps.
johnwebber
TestLink user
Posts: 5
Joined: Mon Dec 23, 2019 3:30 pm

Re: Migrate from to 1.9.17 error - needed "auto_increment"

Post by johnwebber »

You also recommended that we upgrade to version 1.9.19, however we may not be able to do this!

I'm afraid that the server that hosts this site, along with a number of other sites, is currently using MySQL 5,6 (actually 5.6.41-84.1), whereas the README for the latest version of Testlink (1.9.19) has the following requirement specified: "DBMS: MySQL 5.7.x / MariaDB 10.1.x, Postgres 9.x, MS-SQL 201x"

Please can you confirm if 1.9.17 is the latest version we can update to, without also updating MySQL?

Thanks
John
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Migrate from to 1.9.17 error - needed "auto_increment"

Post by fman »

IMHO you can use 1.9.19 with MySQL 5.6.
As usual it will be better to use latest stable version on MySQL (8.x) or MariaDB
Post Reply