The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Knowledge record not found error

Community Alums
Not applicable

Hi All,

 

We have recently upgraded our instance to xanadu, after we upgrade our instance we got a strange issue like whenever we search knowledge article in global search it is giving knowledge record not found error. Can please help me resolve.

vamsib11_0-1732689929315.png

 

8 REPLIES 8

Problem record PRB1830531 has been updated recently with targetted versions for fix: Zurich,Yokohama Patch 1,Xanadu Patch 6.

 

We've just took the nuclear approach and updated the prefix to affected KBs to fit within the standard number length which still works fine as we can't wait any longer for the fix.

As usual we don't have access to view the PRB. Standard number lengths?  Are you able to tell which KB's are affected thru a query as it seems random?

 

We have a mix of KB and KM prefixes. KM's are older and appear to be the affected ones.

If you raise a case with Now Support they'll link your ticket to the problem so you can view it.

 

The issue affetced knowledge articles which have numbers longer than 9 characters. For a couple of our knowledge bases we had 7 digits prefixed by 3 or 4 letters, giving total lengths of 10 and 11 respectively. Changing these prefixes to be 2 letters followed by 7 digits resolved for us, I believe reducing the number of digits to bring the total characters down to 9 would also have resolved however we didn't test this solution.

 

Example, KBA0012345 became KB0012345 and permalinks/global search then worked correctly.

santoshipar
Tera Contributor

Hi,
We were facing the same issue and ServiceNow didn’t provide a direct workaround. However, we found our own solution. After upgrading to Patch 6 on the sub-instance, we took the code they applied as a fix in Patch 6.

The solution was implemented in the KBCommonSNC script include, but we cannot modify it due to security constraints. Instead, we added the necessary code to the KBCommon script include, which resolved the issue of not getting any search results when searching for KB articles from global search.
Script include : KBCommon 
https://Instancename.service-now.com/sys_script_include.do?sys_id=39e84ab2d72121004792a1737e610306&s...
Function that added in this :

// Xanadu upgrade patch 6 source fix for FedEx
    //
    getCorrectlyPaddedNumber: function(number) {
        number = String(number);
        if(gs.nil(number))
            return number;

        // check if the number is already present before adding padding
        var kbKnowledge = new GlideRecordSecure("kb_knowledge");
        if (kbKnowledge.get('number', number)) {
            return number;
        }
       
        var grNumber = new GlideRecord("sys_number");
        grNumber.addQuery("category", "=", "kb_knowledge");
        grNumber.query();
        if (grNumber.next()) {
            this.PREFIX = grNumber.prefix + '';
            this.DIGITS = grNumber.maximum_digits;
        }
        if (number.length == (this.DIGITS + this.PREFIX.length))
            return number;
        number = number.replace(this.PREFIX, ''); //Remove prefix
        number = number.replace(/^0+/, ''); // Remove leading zeros
        number = number.padStart(this.DIGITS, '0'); // Pad with zeros to meet the required length
        return this.PREFIX + number; //Add the prefix back
    },

---------------------------------------------------------------------------------------------

Note: Make sure to remove this code once you upgrade with Patch 6.

 

Please mark this if it helpful.