During a reindexing process on a table where records fail to be found by global search, a null pointer exception may be thrown by the CurrencyPriceOptimizer when calling GlideRecord.next():

at com.glide.currency.CurrencyPriceOptimizer.setValues(CurrencyPriceOptimizer.java:199)
at com.glide.script.AGlideRecordOptimizer.next(AGlideRecordOptimizer.java:49)
at com.glide.script.GlideRecord.applyOptimizers(GlideRecord.java:3260)
at com.glide.script.GlideRecord.next(GlideRecord.java:6121)
at com.glide.ts.indexer.TSIndexThread.processSet(TSIndexThread.java:138)
at com.glide.ts.indexer.TSIndexThread.index(TSIndexThread.java:105)
at com.glide.ts.indexer.TSIndexThread.run0(TSIndexThread.java:81)
at com.glide.util.ParentedThread.run(ParentedThread.java:51)

Steps to Reproduce

The exact steps to reproduce are not available. This issue was found after starting a 'Regenerate Text Index' job, that failed several times due to the null pointer exception. The reindexing was required by a global text search run on task numbers not returning the expected task records.

If the task number values fail to get indexed, then the exact match search will not find them when using the latest global search engine. However, the legacy global search will still find a record that is not indexed.

This could be significant if you had a backlog of text index events. You would still want the exact match to find the record while we wait for the record to get indexed, and since the purpose of exact match is to avoid a text search, it should not matter if the record is not yet indexed.



This problem was fixed since Jakarta Patch 9. As a workaround on older versions, you can disable the code path that generates the NullPointerException by disabling the optimizer setting the system property as follows: 

glide.currency_price_optimizer.enabled = false 

This might affect performance when the related table has a currency field, however it will avoid the NullPointerException. 

After that, reindexing the table that has generated the issue will be necessary. If possible, you can disable text_index on one of the columns to reduce memory usage.


Related Problem: PRB1248691

Seen In


Intended Fix Version

Jakarta Patch 9

Fixed In

Kingston Patch 3

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-15 08:51:12