linkedin/glu — Issue #122: JSON with a null param value loads, but breaks the console.
Author: elutfall
Created: 2012-02-06 16:14:08+00:00
State: open

If a model is loaded with a null value in the JSON, the model loads ok. But then glu throws exceptions at every page like this:
Error 500: java.io.NotSerializableException: org.json.JSONObject$Null
Servlet: grails
URI: /console/grails/dashboard/index.dispatch
Exception Message: org.json.JSONObject$Null
Caused by: java.io.NotSerializableException: org.json.JSONObject$Null
Class: UserPreferencesFilters
At Line: [58]

The only way we have found to recover is to shut down the console, find the offending entry in the database file and delete it, and edit the current system in the database file to be the previous model. Then when we start things up, everything is better.

This is a per fabric issue. If the console has three fabrics and you only use 2 of them that don't have bad JSON, you will never see an exception. Once you select the bad fabric you can't get back to a good fabric unti the database has been fixed.

We see this when the tools we wrote to generate our JSON put in a null instead of an empty string. This has been around since 3.x and is still in 4.x. We know how to work around and fix this issue, but the console should fail a bit more gracefully. Either not accept JSON with null values, or accept them and treat them as empty strings.

Example mount point with null value below (it's been scrubbed to remove private info):
{
"tags": [
"frontend"
],
"script": "http://glu.example.com/glu/glu_scripts/deployment.groovy",
"agent": "test.lab.example.net",
"initParameters": {
"artifact": {
"project": null,
"version": "20.68",
"name": "frontend-webapp"
}
},
"mountPoint": "/webapp/0",
},