Unable to load base folder when using automation with BMC Control-M software

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisdoubleu13
    Visitor
    • May 2016
    • 4

    Unable to load base folder when using automation with BMC Control-M software

    I am using automation and scripting to pull files from a secure SFTP site to our network. I use a PowerShell script to determine some logic that passes certain parameters for what needs to be pulled and to where. When I run this PowerShell script through PowerShell itself, it works just fine. I am trying to implement this script in BMC Control-M (Control-M is an automation software tool for those who are unaware) to automate the process, but when I run it, it fails saying it could not load the base folder (the SFTP site). All I am doing in Control-M is calling the PowerShell script, so I am not sure why it is failing when it works fine it PowerShell itself.

    This may be an issue with Control-M itself, but I just wanted to check and see if the root cause can be fixed here.

    Here is my BC Script:


    Code:
    log verbose append:"C:\MyFolder\CopyToHere\PullFiles.log"
    criteria timestamp:2sec;IgnoreDST size
    filter cutoff:<10days
    filter "*.txt"
    load "C:\MyFolder\CopyToHere" "sftp://username:password@servername"
    option confirm:yes-to-all
    expand all
    select rt.diff rt.older rt.newer rt.orphan 
    copy right->left
    Here is the error message I am getting from my log:

    Connecting to ServerName
    Server key [ssh-rsa xxxx xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx]
    Connection failed: Attempted to open a "Unknown Host Key" dialog when running silently
    Attempted to open a "Unknown Host Key" dialog when running silently
    Load comparison: C:\MyFolder\CopyToHere <->
    Fatal Scripting Error: Unable to load base folder
    Script completed in 0.56 seconds
    Last edited by chrisdoubleu13; 25-May-2016, 03:36 PM.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    BC4 saves settings per Windows User account, so you would need to run the automation as the same Windows User (%AppData%) or use a BC4 Portable Install. A Portable Install (created using the setup.exe) is a single directory install that shares settings for all users accessing it. I would suggest setting it up first as a first test, as it can often help in an automation setup. You can transfer settings between installs using the Tools menu -> Export and Import dialogs.

    The log is showing that the Unknown Host Key dialog is suppressed, so it hasn't been Accepted and Remembered (as the current user). If you can run without /silent, you can accept and remember, then re-enable silent.

    I would recommend testing with test folders first, as there is no Undo command and you cannot preview the action before it is committed.
    Aaron P Scooter Software

    Comment

    • chrisdoubleu13
      Visitor
      • May 2016
      • 4

      #3
      How would I run it without /silent?

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15997

        #4
        Hello,

        Ah, I was not certain if you had added /silent to your automated task. Running from the command line, we would show a Script window, while if you are running in a non-logged in mode, then it would automatically run suppressing the dialog. If run in an environment that cannot show a prompt, then you can't accept the Host Key in order to connect to the server. By using a Portable Install, you can connect once using the GUI, accept the Host Key and remember it, then launch with scripting.
        Aaron P Scooter Software

        Comment

        Working...