Skip to Content
0
May 19, 2020 at 02:48 PM

Cannot read property 'length' of undefined when deleting row

273 Views Last edit May 20, 2020 at 07:23 AM 2 rev

Hi developers,

If I want to delete a certain object from a Hana database I receive the following error:

DELETE /api/projects('certain_id') [2020-05-19T14:28:10.325Z | ERROR | 1186905]: Cannot read property 'length' of undefined [INTERNAL ERROR] TypeError: Cannot read property 'length' of undefined

This error refers to the next line in handlerUtils in node_modules:

await processDeepAsync(async (data, entity) => {
      const errors = await checkReferenceIntegrity(entity, data, context, csn)
 ----> if (errors.length !== 0) { <----
        for (const error of errors) {
          context.error(400, error)
        }
      }
    },
    context.data,
    context.target,
    false,
    true
  )

Reinstalling the npm packages doesn't seem to do the trick. Even overwriting the On Delete handler returns the same error. This only occurs when a row from the Projects-entity is deleted. Rows in other tables get deleted just fine even though the requests are equal. I also checked if the object exists in the Projects-table and it does exist.

Does anyone has experienced this before?

Thanks in advance.