NullPointerException issue with sys_ai_record_activity tableDescriptionCustomers may encounter a NullPointerException when the platform attempts to read or write data to the GenAI Record Activity table (sys_ai_record_activity). This issue occurs because the sharded tables for sys_ai_record_activity are not fully created or synchronized during: Installation of the GenAI Q4 plugin (com.glide.ai_record_activity), orUpgrade to ZP4 / YP11 / AP0 As a result, runtime access to the table fails, leading to errors similar to: Error getting record for sys_ai_record_activity: java.lang.NullPointerExceptionThis issue does not impact all instances and may appear intermittently depending on plugin installation or upgrade timing.Steps to Reproduce Steps to Reproduce: Install the GenAI Q4 feature or upgrade an existing instance to ZP4/YP11/AP0.Ensure the plugin com.glide.ai_record_activity is installed.Trigger a GenAI operation that records or reads activity data.Observe system logs or error output.The following error may appear: Error getting record for sys_ai_record_activity: java.lang.NullPointerExceptionCause: The table sys_ai_record_activity uses sharding (16 shards) and relies on an entry in sys_table_rotation for shard management. In some upgrade or installation scenarios, the shard tables are not fully created or synchronized, even though the base table and plugin are present. This leads to null references when the platform attempts to access shard metadata or records. Workaround(function() { var rotationName = 'sys_ai_record_activity'; // Check rotation record exists var rotGr = new GlideRecord('sys_table_rotation'); rotGr.addQuery('name', rotationName); rotGr.addQuery('type', 'shard'); rotGr.query(); if (!rotGr.next()) { gs.error('No shard rotation found for ' + rotationName + '. Plugin may not be installed.'); return; } var rotationSysId = rotGr.getUniqueValue(); var numShards = rotGr.shards.nil() ? 16 : parseInt(rotGr.getValue('shards')); // Check sys_dictionary entries var dictGr = new GlideRecord('sys_dictionary'); dictGr.addQuery('name', 'STARTSWITH', rotationName); dictGr.addQuery('name', '!=', rotationName); dictGr.addQuery('name', 'DOES NOT CONTAIN', rotationName + '_'); dictGr.addNullQuery('element'); dictGr.query(); var dictCount = dictGr.getRowCount(); gs.info('sys_dictionary shard entries found: ' + dictCount + '/' + numShards); if (dictCount < numShards) { // sys_dictionary missing - need full synchronize gs.info('sys_dictionary incomplete, running full synchronize...'); var tu = new SNC.TableRotationSynchronizer(rotationName); if (tu.isValid()) { tu.synchronize(); gs.info('synchronize() complete.'); } else { gs.error('TableRotationSynchronizer is not valid for ' + rotationName); } } // Always reconcile sys_table_shard records var created = 0; for (var i = 0; i < numShards; i++) { var shardName = rotationName + ('0000' + i).slice(-4); var shardGr = new GlideRecord('sys_table_shard'); shardGr.addQuery('table_name', shardName); shardGr.query(); if (!shardGr.hasNext()) { var newShard = new GlideRecord('sys_table_shard'); newShard.setValue('name', rotationSysId); newShard.setValue('table_name', shardName); newShard.insert(); gs.info('Created sys_table_shard for ' + shardName); created++; } } GlideCacheManager.flush('table_rotation_shard'); gs.info('Done. Created ' + created + ' missing sys_table_shard records. Cache flushed.'); })(); Resolution / Fix Status : A permanent fix is under investigation to ensure automatic shard creation and synchronization during plugin installation and instance upgrades, without requiring manual repair. Until the fix is delivered, plugin repair is the recommended workaround.Impacted Release Version Details:Starting from ZP4/YP11Note: This issue can only be observed when com.glide.ai_record_activity plugin is installed. We can disable this feature by turning off this sys_property "glide.ai.field_indicators.enabled".Related Problem: PRB1974604