Opened 15 years ago

Closed 15 years ago

#1463 closed defect (fixed)

HTTP Status 500 when logging in

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: blocker Milestone: BASE 2.15
Component: web Version: 2.14.2
Keywords: Cc:

Description

This is an issue that most likely was caused by #1439. The problem is that the literal string 'null' is used as the sort property for the projects list in the menu. Since projects doesn't have a 'null' property the query fails and the entire page fails to load. This has been known to happen on times on list pages as well, but there the error is catched and the user can use the 'clear filter' option and choose a different sort column to work around the problem. There is no easy workaround when this happens in the menu. A user that is affected by this problem will not be able to use BASE until it is fixed.

A manual cleaning of the database is needed. We have successfully used the following query:

update `Contexts` set `sort_property` = null 
where `sort_property` like '%null%'

This fix will only cure the current problem. It may appear again though we do not yet know why or when this invalid data is inserted into the database.

Change History (4)

comment:1 by Nicklas Nordborg, 15 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 15 years ago

Under some circumstances the following can appear in the JSP page for a list:

<input type="hidden" name="sortby" value="null">

And this is generated by the Table taglib, line 561 when the sort property is a null referecence.

The hidden field value is then sent back to BASE as a string (processed in Base.getAndSetCurrentContext()), and is saved to the current context and later also to the database. Then, when the query is generated by ItemContext.configureQuery() the string 'null' is used in the query. Two changes are needed:

  1. The Table taglib should generate: <input type="hidden" name="sortby" value="">
  2. The empty string should be converted back to null in Base.getAndSetCurrentContext()
  3. The ItemContext.configureQuery() already knows how to handle null so no changes are required there.

comment:3 by Nicklas Nordborg, 15 years ago

(In [5264]) References #1463: HTTP Status 500 when logging in

This should fix the source of the problem. We also need the update code to execute the above SQL to get rid of existing problematic data in the database.

comment:4 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [5267]) Fixes #1463: HTTP Status 500 when logging in

Added update scripts that removes the bad 'null' values in the sort_property column.

Made the menu script more robust in case an error occurs.

NOTE! This update conflicts with the schema version change in the trunk for #1442 [5260]. This needs to be fixed in the trunk when we have merged 2.15 back to it.

Note: See TracTickets for help on using tickets.