Solved

Workflow fails with error exitCode [2], error [execscript: Error 0x10b: User not logged in

  • 26 July 2021
  • 2 replies
  • 43 views

Badge

Wokflow fails with error

 

2713 CommandActivity         : [ForEach(0)->Uncheck enable mediaagent (ExecuteCommand_1)] executing command [qoperation execscript -sn setMediaAgentProperty -si MA1 -si 9 -si 0] with arguments [] on host [whmm65519] as user [groupinfra\a-********]
2713 CommandActivity         : [ForEach(0)->Uncheck enable mediaagent (ExecuteCommand_1)] ERROR: error executing command [qoperation execscript -sn setMediaAgentProperty -si whmm65529 -si 9 -si 0] on host [MA1], errorCode [0], exitCode [2], error [execscript: Error 0x10b: User not logged in
]

 

 

I tried using qlogin before teh workflow.We still get same error

 

Attached the xml file

icon

Best answer by RMcG 27 July 2021, 11:23

Hi Prudhvi,

 

The reason you are getting the ‘User not logged in error’ is that you need to provide a token to the qoperation command to use. Even though you tried a QLogin earlier you need to keep in mind that each ‘Execute Command’ activity in the workflow is establishing a new session with the client. Session state is not maintained across the activities.

You could pass the token you retrieve using a workflow variable and the -tk parameter for the qoperation command. A simpler way though is to just use the ‘ExecuteScript’ workflow activity (under the qcommand section) instead. Then you don’t need to think about it and the qscript will execute using the credentials of the current user executing the workflow.  

I’ve attached a modified version of the workflow replacing a the first two Execute Command activities with the ExecuteScript activity as an example. You’ll need to download the xml file and import it (eg don’t view and copy the xml via the browser as it won’t work properly that way). 

View original

2 replies

Userlevel 6
Badge +13

Hi @prudhvi 

The error being reported there is because the context that script is being executed under isn’t authenticated to the Commcell before the command is executed.

You will need to provide credentials for the script to be executed under, maybe the script will need to be run as a batch file with the qlogin command and credentials supplied before hand.

Take a look at the options available for qlogin and see if these can be included in the script activity.

Thanks,

Stuart

Userlevel 2
Badge +2

Hi Prudhvi,

 

The reason you are getting the ‘User not logged in error’ is that you need to provide a token to the qoperation command to use. Even though you tried a QLogin earlier you need to keep in mind that each ‘Execute Command’ activity in the workflow is establishing a new session with the client. Session state is not maintained across the activities.

You could pass the token you retrieve using a workflow variable and the -tk parameter for the qoperation command. A simpler way though is to just use the ‘ExecuteScript’ workflow activity (under the qcommand section) instead. Then you don’t need to think about it and the qscript will execute using the credentials of the current user executing the workflow.  

I’ve attached a modified version of the workflow replacing a the first two Execute Command activities with the ExecuteScript activity as an example. You’ll need to download the xml file and import it (eg don’t view and copy the xml via the browser as it won’t work properly that way). 

Reply