Page 1 of 1

error when adding dictionary to CSWeb

Posted: October 23rd, 2019, 9:40 am
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

Re: error when adding dictionary to CSWeb

Posted: October 23rd, 2019, 10:06 am
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

Re: error when adding dictionary to CSWeb

Posted: October 23rd, 2019, 10:49 am
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.

Re: error when adding dictionary to CSWeb

Posted: October 24th, 2019, 2:55 am
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