java.lang.NullPointerException in SCCM Import
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 12:50 PM
Hello developers and CMDB experts! I am hoping I can get some assistance on an issue that I have been trying to knock out for awhile now. When running the scheduled import "MECM-SG-SCCM Computer Identity" at first I was receiving just a "java.lang.NullPointerException" error with no additional data.
I tried both with the Business Rule I have in place to abort certain CIs from being created activated and deactivated - this did not change the result.
Finally I noticed a "Run as" user was missing from the execution. I attempted to run as myself (admin) to ensure this wasn't an ACL issue and now I am receiving additional information as shown below. I did also check the transform definition "SG-SCCM Computer Identity" on the "SCCM Computer Identity" Robust Import Set Transformer to ensure that no fields were empty for the source and target fields. Although - I do have a question if it's okay to mix-match the source field(s) and target field(s) - i.e. source field is singular and filled with matched target fields being multiple?
java.lang.NullPointerException: Cannot invoke "com.glide.db.meta.IRow.setValue(String, String)" because "r" is null
at com.glide.script.GlideRecordITable.setValue(GlideRecordITable.java:634)
at com.glide.script.GlideRecord.setFields0(GlideRecord.java:6965)
at com.glide.script.GlideRecord.setFields(GlideRecord.java:6925)
at com.glide.script.GlideRecord.insert(GlideRecord.java:5380)
at com.glide.script.GlideRecord.insert(GlideRecord.java:5296)
at com.snc.cmdb.identify_reconcile.RecordCommitter.commitInner(RecordCommitter.java:371)
at com.snc.cmdb.identify_reconcile.RecordCommitter.commit(RecordCommitter.java:305)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.commitRecordsInBatches(IdentificationEngine.java:1070)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.process(IdentificationEngine.java:916)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.execute(IdentificationEngine.java:641)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.executeAndGenerateOutput(IdentificationEngine.java:563)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.execute(IdentificationEngine.java:520)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.createOrUpdateCI(IdentificationEngine.java:366)
at com.snc.cmdb.identify_reconcile.PayloadMerger.execute(PayloadMerger.java:256)
at com.snc.cmdb.identify_reconcile.PayloadMerger.mergeAndExecute0(PayloadMerger.java:324)
at com.snc.cmdb.identify_reconcile.PayloadMerger.mergeAndExecute(PayloadMerger.java:66)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.createOrUpdateCI(IdentificationEngine.java:341)
at com.snc.cmdb.identify_reconcile.listener.IREMessageListener.invokeIre(IREMessageListener.java:339)
at com.snc.cmdb.identify_reconcile.listener.IREMessageListener.onMessages(IREMessageListener.java:154)
at com.glide.db.impex.transformer.service.RobustImportSetTransformerDAO$ThrottlingListener.onMessages(RobustImportSetTransformerDAO.java:156)
at com.glide.db.impex.transformer.service.RobustImportSetProcessor.processBatch(RobustImportSetProcessor.java:125)
at com.glide.db.impex.transformer.service.RobustImportSetProcessor.transform(RobustImportSetProcessor.java:83)
at com.glide.system_import_set.ImportSetTransformerImpl.doRobustImportSetTransform(ImportSetTransformerImpl.java:166)
at com.glide.system_import_set.ImportSetTransformerImpl.transformAllMaps(ImportSetTransformerImpl.java:114)
at com.glide.system_import_set.ImportSetTransformer.transformAllMaps(ImportSetTransformer.java:91)
at com.snc.automation.ImportSetTransformerJob.runTransform(ImportSetTransformerJob.java:291)
at com.snc.automation.ImportSetTransformerJob.execute(ImportSetTransformerJob.java:103)
at com.glide.schedule.JobExecutor.lambda$executeJob$1(JobExecutor.java:195)
at com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:198)
at com.glide.schedule.JobExecutor.execute(JobExecutor.java:178)
at com.glide.schedule.JobExecutor.execute(JobExecutor.java:168)
at com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:609)
at com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$2(SchedulerWorkerThread.java:402)
at com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)
at com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:402)
at com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:178)
Any suggestions are greatly appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 11:27 AM
we had a similar problem, and noticed an error in the flow, which we weren't updating something problem. if you open the flow, with operations, you should see what its updating on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:48 AM
Hi @tiguin2798 ,
As per my understanding why this usually happens
The error:
java.lang.NullPointerException: Cannot invoke "com.glide.db.meta.IRow.setValue(String, String)" because "r" is null
indicates:
* The import set transform is trying to set a value on a GlideRecord which doesn’t exist (r is null).
* This typically happens when:
* The source field doesn’t have a matching record in the target table.
* The transform script or transform mapping tries to insert/update without properly initializing the GlideRecord.
* The identification / reconciliation (IRE) fails because required identifier fields are missing.
* The business rule or script triggered during import aborts or nullifies the GlideRecord before commit.
Solution Steps as per my understanding :-
1.Check your source data
* Ensure your Import Set table (staging table) actually contains data in the expected columns, especially those mapped to identifier fields (e.g., name, serial_number, asset_tag, etc.).
* Empty or incorrect data in these fields can lead to null GlideRecord.
2. Validate your transform map
* Go to System Import Sets → Administration → Transform Maps.
* Open SG-SCCM Computer Identity.
* Confirm:
* Mandatory target fields are correctly mapped.
* Coalesce is enabled on identifier fields (so update works, not always insert).
* No field map or script tries to set a field value using a null or empty source.
Mixing singular source fields to multiple target fields is technically possible if each mapping points to the same source field,
but ensure the source field really has data in each row — otherwise, the target field could get null and break IRE.
3. Check transform scripts and Business Rules
* Inspect any onBefore, onAfter, or transform scripts in the transform map.
* Make sure none of them:
* Calls gr.setValue(...) where gr (the GlideRecord) is null.
* Aborts the process or returns before properly initializing the record.
4. Validate Identification & Reconciliation (IRE) configuration
* Navigate to:
* CMDB → Identification / Reconciliation → Identification Rules
* Ensure your rule for SCCM Computer Identity:
* Has required identifier fields properly configured.
* Those fields are present and populated in your source data.
* If identifier fields are missing/null → IRE returns null GlideRecord → causes your NPE.
5. Confirm Data Policies & ACLs
* Ensure there are no Data Policies making required fields empty.
* Check if the “Run as” user has write access to the target table / fields.
6. Test manually
* Take a single import row → open it.
* Use the Transform button manually → see if it works or fails.
* Inspect the logs for that single import.
Extra checks & best practice
1.In your transform map → coalesce on the correct field
2.Check if the target field (e.g., sys_id) is null before calling setValue
3. Avoid aborting GlideRecord or calling .newRecord() conditionally in scripts
4.Use try/catch in transform scripts to catch unexpected nulls and log
Why the “Run as” admin changed the error
When you changed the "Run as" user:
The process could execute more scripts or steps, so the null appeared deeper in the stack (inside IRE instead of ACL block).
Summary / fix:
A.Check source data has values in identifier fields
B.Fix transform maps: coalesce, mandatory fields, and scripts
C.Review Identification rules in IRE
D. Ensure no Business Rule or Data Policy wipes data
E. Retest with a single import set row
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thank You
AJ - TechTrek with AJ
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
ServiceNow Community MVP 2025