Discovery - MicroSoft CA - Certificate Management Pattern - "fix valid dates" step returns an error: "No Valid Date" caused by start/end time (format) in the certificateDescriptionPattern Microsoft CA Certificate Discovery fails with the following IRE error: Discovery status is FAILURE, Identification sections in pattern failed: section: MS CA ID, error: Groovy code failure: Unparseable date: "No Valid Date"." When troubleshooting further in the Pattern Log you encounter the following error on the "fix dates" step "20xx-xx-xx xx:xx:xx: Groovy code failure. java.text.ParseException: Unparseable date: "No Valid Date". Unparseable date: "No Valid Date"" "20xx-xx-xx xx:xx:xx: Groovy code failure: Unparseable date: "No Valid Date". Groovy code failure: Unparseable date: "No Valid Date"" "20xx-xx-xx xx:xx:xx: Execution time: 47 ms" Cause This issue is caused by locale on the target server. Our pattern is looking for a specific date format (dd/MM/yyyy) and when some locale have different date formats (including separators) the pattern fails Possible date formats that are not valid there can be more, but these are the ones ServiceNow has encountered so far: dd.MM.yyyy dd-MM-yyyy Steps to Reproduce Need to have a target server that is not in 'en-US' locale not in standard format, even "en-US" can have strange format such as "M/dd/yyyy HH:mm aa ss'.'S's' z"Run discovery that will run the Microsoft CA Certificate PatternPattern will fail if the date format is not "dd/MM/yyyy"Workaround1) Open discovery pattern Microsoft CA Certificate Pattern 2) Open the identification section (you will be redirected to the Pattern Designer in a new tab) 3) Scroll down to step 20 "fix dates" 3) Change the time parsing script in Target Field Name: valid_to: try{ vt = ${cmdb_ci_certificate[].valid_to} // Attach new format to the map as regex:pattern def format_pattern_map = [/\d{2}\.\d{2}\.\d{4} \d{2}\.\d{2} \w+/:"dd.MM.yyyy HH.mm z" ,/\d{2}\/\d{2}\/\d{4} \d{2}:\d{2} /:"dd/MM/yyyy HH:mm " ,/\d{2}(\.)\d{2}(\.)\d{4}/:"dd.MM.yyyy HH:mm" ,/\d{2}(\-)\d{2}(\-)\d{4}/:"dd-MM-yyyy HH:mm",/\d{2}(\/)\d{2}(\/)\d{4}/:"MM/dd/yyyy HH:mm" ,/\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{2} (AM|PM) \d{1,2}\.\d{3}s \w+/:"M/dd/yyyy HH:mm aa ss'.'S's' z" ] def time = vt for (entry in format_pattern_map) { if (time ==~ entry.key) { return Date.parse(entry.value, time).format("yyyy-MM-dd HH:mm:ss") } } } catch(e){ return "No Valid Date" } 4) Change the time parsing script in Target Field Name: valid_from: try{ vt = ${cmdb_ci_certificate[].valid_from} // Attach new format to the map as regex:pattern def format_pattern_map = [/\d{2}\.\d{2}\.\d{4} \d{2}\.\d{2} \w+/:"dd.MM.yyyy HH.mm z" ,/\d{2}\/\d{2}\/\d{4} \d{2}:\d{2} /:"dd/MM/yyyy HH:mm " ,/\d{2}(\.)\d{2}(\.)\d{4}/:"dd.MM.yyyy HH:mm" ,/\d{2}(\-)\d{2}(\-)\d{4}/:"dd-MM-yyyy HH:mm",/\d{2}(\/)\d{2}(\/)\d{4}/:"MM/dd/yyyy HH:mm" ,/\d{1,2}\/\d{1,2}\/\d{4} \d{1,2}:\d{2} (AM|PM) \d{1,2}\.\d{3}s \w+/:"M/dd/yyyy HH:mm aa ss'.'S's' z" ] def time = vt for (entry in format_pattern_map) { if (time ==~ entry.key) { return Date.parse(entry.value, time).format("yyyy-MM-dd HH:mm:ss") } } } catch(e){ return "No Valid Date" } Additional Information How do I know what my date format is? You can look at the table from step "populate certificate table" and see what date format you have in the valid_to or valid_from column Date format is correct, but I am still getting invalid date error Please reach out to customer support for additional troubleshooting. I do not feel comfortable editing the pattern nor can I change the locale of the target server, what can I do? Please raise a customer enhancement request via our Idea Portal. The instructions to do so are contained within this knowledge article: Idea Management for customer enhancement requestsRelated Problem: PRB1643561