Question

DR Backup Post Process unable to run Powershell script ?

  • 10 February 2023
  • 3 replies
  • 321 views

Userlevel 1
Badge +7

Hi!

We’re currently running a .bat script to do some simple copying of files to another destination, and we’re in the process of updating this to a powershell script, that basicly does the same, but does some additional checks and such first.

 

I’ve verified that i can run the script manually with when i’m logged in as the user specified in the “run as user” 

 

But when i run a disaster recovery backup, i get the followig error: 

 

Error Code: [7:78] Description: Unable to run [C:\Path_to_Script\Name-of-script.ps1] on the client. Internal Error [150995005] in CVSession while communicating with remote host [Remote system [FQDN of Commcell server]. Remote execute request returned error: [].]. [] Source: commcellserver, Process: startPrePostCmd

 

 

Anyone know what could be the issue here ? As far as i can see/understand, there should not be any “Remote System” ?


3 replies

Badge +1

Hi, 

I don’t know if it will help you bu we have similar error with running PreScan process with predefined Power Shell script.

I’m not sure for 100% that DR Backup Post Process use same logic as PreScan during normal files backup but I will list all problems and solution we applied.

  1. Running script locally return problems with PowerShell Execution Policy
    1. You can skip this if you didn’t have this problem
    2. If you have, you can change Execution Policy for:
      • User that running script ether by changing policy to:
        • RemoteSigned -- easy to apply and prevent from running scripts from internet that are not signed
        • AllSigned -- hard for apply and prevent from running not signed scripts
        • Bypass -- easy to apply but allow running any script
      • You can change PowerShell setting for CurrentUser or LocalMachine
      • Hear is M$ documentation link
  2. When selecting script in advanced option for subclient we get similar error as You posted above
    • We declared script as argument for C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  3. Last problem that we encounter was 
    Nonzero code [1] returned from user command.
    • We moved all logic to script as:

      • > -- redirecting output to file

      • | -- sending stream to another process 

    • Of course we can send argument as parameter separated by “ “ (space)

In our case PreScan process that we applied in advanced setting look like that:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe  E:\Commvault\makeFolderList-SIG.ps1 R:\PATH\FORSCAN E:\Commvault\outputLogFile.txt -2

 

Output file is used as source list for subclient content like that:

<INCLUDE,E:\Commvault\outputLogFile.txt>

 

Userlevel 6
Badge +15

If you look in the log “startprepostcommand.log” on the CommServe, do you see more details on the issue than in Job Manager?

 

Userlevel 1
Badge +7

Not really any more details ….. here is an example of one of the attempts (logs sanetized somewhat):

 

12956 3110  02/10 13:11:05 ####### ::main() - jobId 1530185 - commandPath = <Path-to-Script>\PSscript.ps1
12956 3110  02/10 13:11:05 1530185 ::main() - jobId 1530185 userImpersonationLevel[2] - before execute cmd
12956 3110  02/10 13:11:05 1530185 ::main() - jobId 1530185 - Use Impersonation.
12956 3110  02/10 13:11:05 1530185 ::main() - jobId 1530185 - Got username [Domain\<ServiceAccount>]
12956 3110  02/10 13:11:05 1530185 ::main() - jobId 1530185 - remoteexename = [<Path-to-Script>\PSscript.ps1]
12956 3110  02/10 13:11:05 1530185 ::main() - jobId 1530185 - args = [ -bkplevel 1 -attempt 5 -status 1 -job 1530185]
12956 3110  02/10 13:11:05 1530185 executePrePostCmd() -  Attempting to execute remote command on client [<Commserve>]..
12956 3110  02/10 13:11:06 1530185 executePrePostCmd() - jobId 1530185 - Error encountered in ExecRemoteCmdAndWait - [0x80070306:{CCvNetwork::ExecRemoteCmdAndWait(2740)} + {CCvNetwork::ExecRemoteCmdAndWait(2721)/W32.774.(One or more errors occurred while processing the request. (ERROR_ERRORS_ENCOUNTERED.774))-}]
12956 3110  02/10 13:11:06 1530185 executePrePostCmd() - jobId 1530185 - Received error text from remote cvsession [Internal Error [150995005] in CVSession while communicating with remote host [Remote system [<Commserve>.<Domain>]. Remote execute request returned error: [].].  []]
12956 3110  02/10 13:11:06 1530185 executePrePostCmd() - jobId 1530185 - Error [9000056] returned from executeRemoteCommand <Path-to-Script>\PSscript.ps1
12956 3110  02/10 13:11:06 1530185 EvEvent::setMsgEventArguments() - MsgId[0x0700004e], Arg[1] = [117440623]
12956 3110  02/10 13:11:06 1530185 EvEvent::setMsgEventArguments() - MsgId[0x0700004e], Arg[2] = [<Path-to-Script>\PSscript.ps1]
12956 3110  02/10 13:11:06 1530185 EvEvent::setMsgEventArguments() - MsgId[0x0700004e], Arg[3] = [Internal Error [150995005] in CVSession while communicating with remote host [Remote system [<Commserve>.<Domain>]. Remote execute request returned error: [].].  []]
12956 3110  02/10 13:11:06 1530185 EvEvent::setMsgEventArguments() - [MsgId[0x0700004e][]: [3] Args Pushed, [1] Args expected.
12956 3110  02/10 13:11:06 1530185 ::exitHere() - jobId 1530185 - Exiting due to failure.

Reply