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.