Notifications

235 views

Description

A CI or Asset will fail to be created if any field names in the Asset CI Field Mappings table [alm_asset_ci_field_mapping] are empty or don't exist in the asset or CMDB tables. An empty or bad value in the Asset field column will prevent any CIs being inserted on Asset insert, and vice versa. The newly inserted Asset [or CI] will have a blank CI [or Asset] reference, but there is no other on-screen indication that something went wrong.

This can happen when:

  • a custom field is deleted from the Dictionary, after having set up a Mapping
  • getting your update sets out of order, e.g. a mapping may be added before the field is created
  • accidentally clearing the value of either field, which is possible from a list view or form, or not filling in both fields in the first place.

Steps to Reproduce

  1. Navigate to Asset - Administration - Field Mapping to list the alm_asset_ci_field_mapping table
  2. Clear one of the value in the Asset field column [or Configuration Item field column], or modify it to a bogus fieldname to simulate a field that used to exist/isn't yet existent
  3. Create a new Asset [or CI] with a Model Category/Model that will be synchronised to the CI [or Asset]
  4. Click Submit.
  5. Note that the form does not reference any CI [or Asset], and no CI [or Asset] can be found in the other table either

With "Debug Log" session debug enabled, you will clearly see the errors, which are also in syslog:

The errors below were seen in Madrid Patch 1 when creating an Asset: (other versions do have different line numbers, but its the same business rules and script includes)

Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.9ec37b411b012000e49bfbcd2c071380.script at line 125
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.9ec37b411b012000e49bfbcd2c071380.script at line 75
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.19c0f3603703100044e0bfc8bcbe5d9b.script at line 177
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script.26ebfeef1b3210002502fbcd2c07136f.script at line 1 ==> 1: (new AssetandCI()).createCI(current);

And when Creating a CI:

Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.9ec37b411b012000e49bfbcd2c071380.script at line 125
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.9ec37b411b012000e49bfbcd2c071380.script at line 75
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.19c0f3603703100044e0bfc8bcbe5d9b.script at line 122
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script_include.19c0f3603703100044e0bfc8bcbe5d9b.script at line 81
Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in sys_script.0d6b59dc1b0310002502fbcd2c0713a5.script at line 2 1: var ca = new AssetandCI(); ==> 2: ca.createAsset(current);

Workaround

This problem is under review, however the issue is one of not protecting against bad configurations rather than a bug.

To resolve this in your instance, the bad alm_asset_ci_field_mapping record will need identifying first, and then either correcting or deleting as appropriate to resolve this issue.


Related Problem: PRB1332642

Seen In

Helsinki Patch 6

Fixed In

London Patch 9
Madrid Patch 4
New York

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:44:21
Published:2019-03-27