Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.9.5, 1.9.11, 2.0.2, 2.1.3, 2.2, 2.3
-
Fix Version/s: 2.2.1, STABLE Sprint 16
-
Component/s: Database SQL/XMLDB, Gradebook
-
Labels:
-
Environment:Linux, PHP 5.2.4, PostgreSQL 8.3
-
Testing Instructions:
-
Database:PostgreSQL
-
Difficulty:Moderate
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
Fixed Branches:MOODLE_22_STABLE
-
Pull from Repository:
-
Pull 2.2 Branch:
MDL-20245_user_preferences2_22 -
Pull Master Branch:
MDL-20245_user_preferences2 -
Pull Master Diff URL:
Description
Noticed in my Postgres log that inserts into the user_preference table have been failing. Here is the log entry:
ERROR: value too long for type character varying(255)
STATEMENT: UPDATE mdl_user_preferences SET value = 'a:2:{s:14:\"aggregatesonly\";a:11:{i:41;s:4:\"1621\";i:46;s:4:\"1466\";i:47;s:4:\"1498\";i:48;s:4:\"1470
\";i:49;s:4:\"1622\";i:50;s:4:\"1623\";i:51;s:4:\"1465\";i:52;s:4:\"1668\";i:53;s:4:\"1669\";i:54;s:4:\"1670\";i:55;s:4:\"1671\";}s:10:\"gradesonly\";a:2:{i:1;s:4:\"1620\";i:2;s:4:\"3024\";}}' WHERE id =
'1619';
A quick look at the DB for the record in question:
select * from mdl_user_preferences where id = '1619';
id | userid | name | value
---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1619 | 12405 | grade_report_grader_collapsed_categories | a:2:{s:14:"aggregatesonly";a:11:{i:41;s:4:"1621";i:46;s:4:"1466";i:47;s:4:"1498";i:48;s:4:"1470";i:49;s:4:"1622";i:50;s:4:"1623";i:51;s:4:"1465";i:52;s:4:"1668";i:53;s:4:"1669";i:54;s:4:"1670";i:55;s:4:"1671";}s:10:"gradesonly";a:1:{i:1;s:4:"1620";}}
Unfortunately, I cannot determine how exactly this was triggered. I
cannot decipher exactly what was being clicked on by the user at the
time these things were logged. Any tips on recreating the problem?
If I were to guess, I would say that there is a problem where a
person may belong to too many courses with too many categories and
have PHP pref arrays that don't serialize to a small enough value.
Perhaps the size of the serialized value should be checked or else a
note presented to the user to that the settings were not saved?
Issue Links
| This issue is duplicated by: | ||||
| MDL-26011 | Error writing to table in Grade |
|
|
|
| MDL-26424 | Error writing to database |
|
|
|
| MDL-26293 | Unable to collaps the grade book categories |
|
|
|
| This issue has been marked as being related by: | ||||
| MDL-30668 | Prevent the grader report from storing serialized data in the user_preferences table |
|
|
|
Uhm... that field for user preferences is supposed to be used to store simple values and not serialised info, that can easily grow over 255cc.
Asigning to Nico (and addressing to 1.9.6) as seems that Gradebook is the responsible for this... couldn't we split that info into smaller (ideally individual) parts or so?
Ciao