error when adding dictionary to CSWeb

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

error when adding dictionary to CSWeb

Post by Anne »

Hi,
We have a problem adding more than one dictionary to CSWeb. The first one works OK, but when we try to add the second one, we get the error message
"Failed to add dictionary. We are sorry, but something went terribly wrong".

And this is the corresponding entry in the log file:

[2019-10-23 16:37:36] CSPro API.CRITICAL: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '255' for key 'PRIMARY' (uncaught exception) at C:\inetpub\wwwroot\csweb\src\api\app\helpers.php line 137 {"exception":"[object] (PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '255' for key 'PRIMARY' at C:\\inetpub\\wwwroot\\csweb\\src\\api\\app\\helpers.php:137)"} []

A colleague of mine just upgraded the CSWeb server, and I assume it went OK, as it tells me it's up to date if I try to run the upgrade script.

Any suggestions?

Anne
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: error when adding dictionary to CSWeb

Post by Anne »

My colleagues were desperate so I ended up deleting the mysql database and reconfigure the whole system.

This made it work for now.. But still: What happened?

A
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: error when adding dictionary to CSWeb

Post by josh »

There was a limitation in earlier versions of CSWeb where the auto increment key of the dictionaries table was defined as a tinyint which can only go up to 255. Every time you update a dictionary we delete the row in the table and create a new one which increments the key. After 255 updates you run into that error because it can't be incremented anymore. By deleting and recreating the database you effectively reset that counter back to 1 so it works again.

In version 7.2 we increased the size of that variable so you if you upgrade to the latest version you should not have that problem anymore.
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: error when adding dictionary to CSWeb

Post by Anne »

Thanks.
We had already upgraded to 7.3, but I assume it must have happened because we probably went from betaversion of 7.1 to 7.3

(I know. We shouldn't have done it that way.... :oops: )

Anyway: It works now! :D
Post Reply