medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
467 stars 217 forks source link

Feedback Docs - Failed during the form "x" rendering : Cannot read property 'cloneNode' of undefined #8391

Open kennsippell opened 1 year ago

kennsippell commented 1 year ago

Describe the bug This is a feedback document happening in production. 5 times for 5 different users for 5 different forms. 3 from contacts tab, 2 from tasks.

Forms: child_longitudinal_followup_13_19, pregnancy_registration, contact:c70_village:edit, communication, contact:c90_household:edit

To Reproduce No known steps

Logs

{
    "_id": "feedback-2023-07-11T11:09:53.632Z-f5d3daea-9244-4ea2-8c52-ede92d70f181",
    "log": [
        {
            "level": "error",
            "arguments": "[\"Error loading contact form.\",{}]"
        },
        {
            "level": "error",
            "arguments": "[\"Failed during the form \\\"contact:c90_household:edit\\\" rendering : \",\"Cannot read property 'cloneNode' of undefined\"]"
        },
        {
            "level": "info",
            "arguments": "[\"Replication started after unknown seconds since previous attempt\"]"
        },
        {
            "level": "warn",
            "arguments": "[\"Data node: /*/meta/deprecatedID with null-based index: undefined not found. Ignored.\"]"
        },
        {
            "level": "warn",
            "arguments": "[\"Data node: /*/meta/deprecatedID with null-based index: undefined not found. Ignored.\"]"
        },
        {
            "level": "error",
            "arguments": "[\"Unhandled Promise rejection:\",\"Failed to fetch\",\"; Zone:\",\"<root>\",\"; Task:\",\"Promise.then\",\"; Value:\",{\"stack\":\"TypeError: Failed to fetch\",\"message\":\"Failed to fetch\",\"result\":{\"ok\":false,\"start_time\":\"2023-07-11T10:59:43.791Z\",\"docs_read\":0,\"docs_written\":0,\"doc_write_failures\":0,\"errors\":[],\"status\":\"aborting\",\"end_time\":\"2023-07-11T10:59:43.819Z\",\"last_seq\":0}},\"TypeError: Failed to fetch\"]"
        },
        {
            "level": "error",
            "arguments": "[\"Unhandled Promise rejection:\",\"Failed to fetch\",\"; Zone:\",\"<root>\",\"; Task:\",\"Promise.then\",\"; Value:\",{\"stack\":\"TypeError: Failed to fetch\",\"message\":\"Failed to fetch\",\"result\":{\"ok\":false,\"start_time\":\"2023-07-11T10:59:43.788Z\",\"docs_read\":0,\"docs_written\":0,\"doc_write_failures\":0,\"errors\":[],\"status\":\"aborting\",\"end_time\":\"2023-07-11T10:59:43.818Z\",\"last_seq\":0}},\"TypeError: Failed to fetch\"]"
        },
        {
            "level": "warn",
            "arguments": "[\"Configuration error. Config must define have a 'muting.mute_forms' array defined.\"]"
        },
        {
            "level": "info",
            "arguments": "[\"RulesEngine Status: Enabled\"]"
        },
        {
            "level": "info",
            "arguments": "[\"Initiating changes watch (meta=true)\"]"
        },
        {
            "level": "info",
            "arguments": "[\"Initiating changes watch (meta=false)\"]"
        },
        {
            "level": "info",
            "arguments": "[\"Persistent storage denied: storage may be cleared by the UA under storage pressure.\"]"
        },
        {
            "level": "warn",
            "arguments": "[\"db.type() is deprecated and will be removed in a future version of PouchDB\"]"
        }
    ],
    "_rev": "1-f11dc30ce023d01801e685e87883c097",
    "info": "Failed during the form \"contact:c90_household:edit\" rendering : Cannot read property 'cloneNode' of undefined",
    "meta": {
        "url": "https://disc-mali.ml/#/contacts",
        "time": "2023-07-11T11:09:53.632Z",
        "user": {
            "name": "x",
            "roles": [
                "chw"
            ]
        },
        "source": "automatic",
        "version": "4.1.0",
        "language": "fr"
    },
    "type": "feedback"
}

Environment

dianabarsan commented 1 year ago

5 times for 5 different users for 5 different forms

This seems to point to a rather infrequent race condition. Are these forms submitted frequently?

kennsippell commented 1 year ago

Are these forms submitted frequently?

Yes, some of these forms (child_longitudinal_followup_13_19) have been submitted over 10k times. Others 4k, 1k, etc. I didn't look for the contact:edit forms.