WeBWorK Problems

Data too long for 'frozen_hash'

Data too long for 'frozen_hash'

by Tim Flowers -
Number of replies: 4

This error has been popping up for us lately. I am not sure if it is a server issue or an issue with the individual problems or both.  

Here are 2 library problems as examples:

Library/SDSU/Discrete/IntegersAndRationals/basemulttableB5.pg 

Example seeds:  42 , 2681 , 

Library/SUNYSB/modOperator.pg

Example seeds: 3466 , 4391

Here is the error message:

DBD::MariaDB::st execute failed: Data too long for column 'frozen_hash' at row 1 at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 881.

Any ideas? 

We are running 2.17

In reply to Tim Flowers

Re: Data too long for 'frozen_hash'

by Glenn Rice -

Disable the "still not right" achievement.  Either that or upgrade to webwork 2.18 (probably not an option for you at this point).

What is happening is that that achievement saves the last answer to the frozen hash column.  It is very easy for the last answer to contain to much data for the frozen hash column which prior to webwork 2.18 was a VARCHAR(1024) column.  Fir webwork 2.18 that is changed to a MEDIUMBLOB which can hold more than the last answer column which is of type TEXT.

In reply to Glenn Rice

Re: Data too long for 'frozen_hash'

by Jeremy Lounds -

We recently upgraded one of our webwork servers to 2.19, and this error has been reported a few times this morning. I checked the database, and the column "frozen_hash" in the course "_achievement_user" table is a varchar(1024).

Did we do something wrong in our upgrade, or has this problem resurfaced in 2.19?

Thank you!

Jeremy

In reply to Jeremy Lounds

Re: Data too long for 'frozen_hash'

by Glenn Rice -

The frozen_hash columns in both the global_user_achievement and achievement_user tables should be of type MEDIUMBLOB for webwork 2.18 or newer.  If they are still the old VARCHAR(1024) type, then you will still see that error with certain achievements.

For WeBWorK 2.20 you can fix the types of the columns when you upgrade courses from the admin user interface in the browser.  Prior to WeBWorK 2.20 there is a script in /opt/webwork/webwork2/bin that will do this for you.  It is somewhat oddly named for this because it was originally written for something else, but it also does this.  The script is upgrade-database-to-utf8mb4.pl.  To use it for one course run

upgrade-database-to-utf8mb4.pl -c course_id

If it asks you if you want to overwrite an existing webwork2.sql file, then you probably should say no, and then also say no to running the script anyway (which it will ask you next).  Then either move the existing webwork2.sql file elsewhere, or add "-b webwork2-new.sql" to the above command, and run the script again.

If the script reports errors, then restore the sql backup file, and post the errors here.  We can then troubleshoot further.

If the script succeeds, the data types of those columns will be set to what is defined in the webwork2 database schema which is MEDIUMBLOB, and you won't see that error anymore.