Uploaded image for project: 'Contrib: Gradebook2'
  1. Contrib: Gradebook2
  2. GRBK-945

Gradebook 2 gets "Failed Request" error when trying to update grades

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: trunk, 1.8.0
    • Fix Version/s: 1.9.0
    • Component/s: GWT Client
    • Labels:
      None
    • Target Version:
    • Previous Issue Keys:

      Description

      GB2 v. 1.4.0, Sakai 2.6.x - In some gradebooks users consistently get an error when they try to update a student's score for an item. The error says:
      Failed Request
      Failure to update grade for [student's name]. Unexpected response from server: 500.
      (see screenshot)

      The truth is it does actually update the grade in the db. It just doesn't reflect it in the client. Following the error message, if a user refreshes the gb2 tool and comes back, the update did save. This leads me to believe it's a timeout thing where the client isn't receiving a confirmation "handshake" from the server in time, so it assumes it failed.

      This is very repeatable in one particular gradebook but I've heard reports of it happening intermittently elsewhere. In the trouble-gradebook, there are no categories. There are some externally maintained items from Samigo but other than that everything looks very standard. Class size of 16 with 19 items. The error message occurs using IE, Firefox, and Chrome.

        Gliffy Diagrams

        1. GRBK-945-error-log.txt
          10 kB
          Paul Dagnall
        1. gb2fail.jpg
          18 kB

          Activity

          Hide
          Jon Gorrono added a comment -

          Paul, can you take a look at the log file output for gradebook2 during that use case for the troublesome gradebook? And, if it has anything interesting, please post or attach it here.... Thanks.

          Show
          Jon Gorrono added a comment - Paul, can you take a look at the log file output for gradebook2 during that use case for the troublesome gradebook? And, if it has anything interesting, please post or attach it here.... Thanks.
          Hide
          Paul Dagnall added a comment -

          I have attached the full error log. I'm wondering if I may have missed a DB update I should have done when upgrading from 1.3.1 to 1.4.0.

          Here are the highlights from the log:

          ERROR: ORA-12899: value too large for column "SAKAIUSER"."GB_ACTION_RECORD_PROPERTY_T"."PROPERTY_VALUE" (actual: 342, maximum: 255)
          (2011-04-27 15:18:54,519 TP-Processor3_org.hibernate.util.JDBCExceptionReporter)
          ERROR: Could not synchronize database state with session (2011-04-27 15:18:54,519 TP-Processor3_org.hibernate.event.def.AbstractFlushingEventListener)
          org.hibernate.exception.GenericJDBCException: could not insert collection: org.sakaiproject.gradebook.gwt.sakai.model.ActionRecord.propertyMap#4428

          Show
          Paul Dagnall added a comment - I have attached the full error log. I'm wondering if I may have missed a DB update I should have done when upgrading from 1.3.1 to 1.4.0. Here are the highlights from the log: ERROR: ORA-12899: value too large for column "SAKAIUSER"."GB_ACTION_RECORD_PROPERTY_T"."PROPERTY_VALUE" (actual: 342, maximum: 255) (2011-04-27 15:18:54,519 TP-Processor3_org.hibernate.util.JDBCExceptionReporter) ERROR: Could not synchronize database state with session (2011-04-27 15:18:54,519 TP-Processor3_org.hibernate.event.def.AbstractFlushingEventListener) org.hibernate.exception.GenericJDBCException: could not insert collection: org.sakaiproject.gradebook.gwt.sakai.model.ActionRecord.propertyMap#4428
          Hide
          Thomas Amsler added a comment -

          I did a little research on this and found the following:

          Our provided SQL upgrade scripts create the GB_ACTION_RECORD_PROPERTY_T as follows:
          https://source.sakaiproject.org/contrib/gradebook2/trunk/sakai/trunk/sql/oracle/sakai_gradebook2.sql

          create table GB_ACTION_RECORD_PROPERTY_T
          (
          ACTION_RECORD_ID number(19),
          PROPERTY_NAME varchar(756),
          PROPERTY_VALUE varchar(756)
          );

          However, the ActionRecord.hbm.xml file just defines:

          <map name="propertyMap" table="GB_ACTION_RECORD_PROPERTY_T" cascade="all" lazy="false">
          <key column="ACTION_RECORD_ID"/>
          <index column="PROPERTY_NAME" type="string"/>
          <element column="PROPERTY_VALUE" type="string"/>
          </map>

          I assume that the default VARCHAR lenght for a type=string is 255. So if you create the GB2 tables via auto.ddl then you would get the incorrect size.

          The quickest way to fix this is to adjust the VARCHAR size to 756 for that column.

          We really need to set the specific "length" on all string properties in the HBM files.

          Show
          Thomas Amsler added a comment - I did a little research on this and found the following: Our provided SQL upgrade scripts create the GB_ACTION_RECORD_PROPERTY_T as follows: https://source.sakaiproject.org/contrib/gradebook2/trunk/sakai/trunk/sql/oracle/sakai_gradebook2.sql create table GB_ACTION_RECORD_PROPERTY_T ( ACTION_RECORD_ID number(19), PROPERTY_NAME varchar(756), PROPERTY_VALUE varchar(756) ); However, the ActionRecord.hbm.xml file just defines: <map name="propertyMap" table="GB_ACTION_RECORD_PROPERTY_T" cascade="all" lazy="false"> <key column="ACTION_RECORD_ID"/> <index column="PROPERTY_NAME" type="string"/> <element column="PROPERTY_VALUE" type="string"/> </map> I assume that the default VARCHAR lenght for a type=string is 255. So if you create the GB2 tables via auto.ddl then you would get the incorrect size. The quickest way to fix this is to adjust the VARCHAR size to 756 for that column. We really need to set the specific "length" on all string properties in the HBM files.
          Hide
          Thomas Amsler added a comment -

          Making this a blocker until we figure out the best course of action.

          Show
          Thomas Amsler added a comment - Making this a blocker until we figure out the best course of action.
          Hide
          Paul Dagnall added a comment -

          First off, thank you for looking into this so quickly! I went ahead and changed the column sizes on our test server and it did the trick.

          Show
          Paul Dagnall added a comment - First off, thank you for looking into this so quickly! I went ahead and changed the column sizes on our test server and it did the trick.
          Hide
          Michael Wenk added a comment -

          Because of double byte characters, I would recommend sizing that column to at least 1512.

          Show
          Michael Wenk added a comment - Because of double byte characters, I would recommend sizing that column to at least 1512.
          Hide
          Thomas Amsler added a comment -

          Background info:

          Java is using UTF-16, whereas the DB is configured to support UTF-8. If we need to limit the string length, then we need to do it on a byte level rather than on a character level. The short term fix is, as Mike pointed about above, to increase/double the column size.

          Show
          Thomas Amsler added a comment - Background info: Java is using UTF-16, whereas the DB is configured to support UTF-8. If we need to limit the string length, then we need to do it on a byte level rather than on a character level. The short term fix is, as Mike pointed about above, to increase/double the column size.
          Hide
          Joyce Johnstone added a comment -

          SP 1

          Show
          Joyce Johnstone added a comment - SP 1
          Hide
          Jon Gorrono added a comment -

          set the column length to 2000

          files update:
          client/src/sql/oracle/sakai_gradebook2.sql
          model/src/hibernate/org/sakaiproject/gradebook/gwt/sakai/model/ActionRecord.hbm.xml
          sakai/trunk/sql/mysql/GRBK-945.sql
          sakai/trunk/sql/oracle/GRBK-945.sql

          Show
          Jon Gorrono added a comment - set the column length to 2000 files update: client/src/sql/oracle/sakai_gradebook2.sql model/src/hibernate/org/sakaiproject/gradebook/gwt/sakai/model/ActionRecord.hbm.xml sakai/trunk/sql/mysql/ GRBK-945 .sql sakai/trunk/sql/oracle/ GRBK-945 .sql

            People

            • Assignee:
              Jon Gorrono
              Reporter:
              Paul Dagnall
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: