Handle broken or incomplete views more gracefully

Bug #619961 reported by Krzysztof Klimonda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
couchdb-glib
New
Undecided
Unassigned

Bug Description

malformed (or incomplete) views seem to confuse couchdb-glib which starts throwing lots of Critical messages like that:
(process:4377): Json-CRITICAL **: json_object_get_object_member: assertion `JSON_NODE_TYPE (node) == JSON_NODE_OBJECT' failed

(process:4377): Json-CRITICAL **: json_object_get_string_member: assertion `object != NULL' failed

(process:4377): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed

(process:4377): Json-CRITICAL **: json_object_has_member: assertion `object != NULL' failed

(process:4377): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(process:4377): Json-CRITICAL **: json_object_ref: assertion `object != NULL' failed

(process:4377): Json-CRITICAL **: json_object_set_string_member: assertion `object != NULL' failed

handle such case more gracefully.

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

Even after I've tweaked my code some more I still get following messages:

(process:4001): Json-CRITICAL **: json_object_get_string_member: assertion `node != NULL' failed

(process:4001): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed

(process:4001): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

The request sent to couchdb looks like this:
http://127.0.0.1:5984/kangaroo/_design/channel/_view/all_channels?key=["http://planet.ubuntu.com/"]

view is:
function(doc) {
  if (doc.type == "channel")
    emit([doc.gobject.homepage], doc);
}

and the Json Document that couchdb returns:
{
    "total_rows": 1,
    "offset": 0,
    "rows": [
        {
            "id": "124ea9f53911132fe958dd10500061f9",
            "key": [
                "http://planet.ubuntu.com/"
            ],
            "value": {
                "_id": "124ea9f53911132fe958dd10500061f9",
                "_rev": "1-1a216d57f81a2a833298ffaed26ea33c",
                "type": "channel",
                "gobject": {
                    "title": "Planet Ubuntu",
                    "homepage": "http://planet.ubuntu.com/",
                    "description": "(...)",
                    "image": null,
                    "language": "en",
                    "category": null,
                    "copyright": null,
                    "editor": null,
                    "webmaster": null,
                    "generator": null
                }
            }
        }
    ]
}

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

It's going to get fixed once the branch I'm working on is finished and merged

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.