Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Reconciliation failed with "TypeError: Cannot read property "null" from undefined" due to allocations on unmanaged software upon Vancouver upgrade - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Reconciliation failed with "TypeError: Cannot read property "null" from undefined" due to allocations on unmanaged software upon Vancouver upgrade
KB1585469

Reconciliation failed with "TypeError: Cannot read property "null" from undefined" due to allocations on unmanaged software upon Vancouver upgrade


822 Views Last updated : Jul 1, 2024 public Copy Permalink
KB Summary by Now Assist

Description

You may see the following reconciliation error upon Vancouver upgrade -

TypeError: Cannot read property "null" from undefined

at sys_script_include.602e129eb0276300fa9b028ca0d3b864.script:1206

The error arises in the SamLicenseCalculator script include.
Allocations should not be processed on entitlements where software model has 'license_under_management'=false. However, a bug in the code processes allocations on these entitlements and causes downstream issues. License metric results are not created for these entitlements, but the problematic code attempts to create a 'rights used by' with an 'allocated not in use' value. The full code fix is available in Washington p1 but workarounds are available.

Steps to Reproduce

1) Create an allocation on a 'per device' entitlement (or other metric).
2) For a software model, set LUM as 'false'.
3) Run reconciliation.

Results:
a) Recon status is either 'partially completed' or 'failed'. In the progress summary logs, the message "TypeError: Cannot read property "null" from undefined" is displayed.
b) There might be a record in 'samp_licenses_required_by' for the allocated user/device with empty LMR and 'allocated not in use' > 0.

This issue is reproducible in before Vancouver p6.

Workaround

For the full code fix, please update to: Xanadu when available, WashingtonDC p1, or Vancouver p7.

If upgrading is not doable, one workaround is to retire all entitlements under unmanaged software models -

 var gmu = new GlideMultipleUpdate('alm_license'); // entitlement table
gmu.addQuery('install_status', '!=', 7); // not retired
gmu.addQuery('software_model.license_under_management', false); // unmanaged software model
gmu.setValue('install_status', 7); // set retired
gmu.execute();

Allocations on retired entitlements are automatically ignored. You may optionally clean up the ignored allocations afterwards -

var gr = new GlideRecord('alm_entitlement'); // allocations table
gr.addQuery('licensed_by.install_status', 7); // retired entitlements

gr.query();
gr.deleteMultiple()


Alternatively, you may directly remove invalid allocations rather than retiring entitlements -

var gr = new GlideRecord('alm_entitlement'); // allocations table
gr.addQuery('licensed_by.install_status', 1); // active entitlement (optional query)
gr.addQuery('licensed_by.software_model.license_under_management', false); // unmanaged software model
gr.query();

From here, you can review and deleteMultiple() in the code or delete manually from the UI. Export the records first if you need a backup.


If the above workarounds are not sufficient, you may also implement the following -

Update the below lines of code at line 1177 in Script Include: SamLicenseCalculator
if (!lmrUsage.consumptionRule) {
return;
}

Note: This is a Protected Script, only Maint users can perform changes. *It is suggested to upgrade rather than making this code fix*


Related Problem: PRB1715795

Potentially Seen In

There is no data to report.

Fixed In

Vancouver Patch 7
Washington DC Patch 1
Xanadu

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.