Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Duplicate file name error occurs during update of Credentials.psm1 file synchronized by both Discovery and Orchestration - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Duplicate file name error occurs during update of Credentials.psm1 file synchronized by both Discovery and Orchestration
KB0639983

Duplicate file name error occurs during update of Credentials.psm1 file synchronized by both Discovery and Orchestration


2132 Views Last updated : Mar 5, 2025 public Copy Permalink
KB Summary by Now Assist

Description

 If both Discovery and Orchestration have synchronized versions of the Credentials.psm1 file existing in different paths, any attempt by either application to update their version of the file results in a duplicate file error.

The business rule "Prevent Duplicate,Spaces & Colon in name" is intended to prevent duplicate filenames, so that synchronized MID Server script files won't overwrite each other. However, the business rule incorrectly compares the file names only and does not recognize that the two script files have different paths.

Steps to Reproduce

  1. Synchronize the Credentials.psm1 file for both Discovery and Orchestration in different paths.
  2. Try to update the Credentials.psm1 for either of the applications.
  3. Note the duplicate file name error.
        For more information, see the Credentials.psm1 section in the product documentation topic MID Server PowerShell files.

Workaround

Use one of the following workarounds:

  • Disable (perhaps temporarily) the "Prevent Duplicate,Spaces & Colon in name" business rule.

  • Update the business rule to evaluate both the path and the file name by replacing lines 29 to 32 of the business rule with the following code:

    while(gr.next()){
      var path1 = getPath(current, 0);
      var path2 = getPath(gr, 0);
      if(path1==path2){
        current.setAbortAction(true);
        gs.addErrorMessage(gs.getMessage("Duplicate file name with same path is not allowed "));
      }
    } 
    function getPath(scriptRecord, level) {
      var parentField = "parent";
      for(var i=0;i<level;i++){
        parentField = parentField + ".parent";
      }
      var parent = scriptRecord.getDisplayValue(parentField);
      var path = "";
      if(parent){
        path = getPath(scriptRecord,++level)+"/"+parent;
      }
      return path;
    }

Related Problem: PRB934605

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.