Hi,
I've started looking at Commvault API and decided to make an automated backup restore test.
Having troubles with the following query (as viewed from the WebServer.log):
18616 47 01/07 09:21:22 47 prod01\admmunkovdm - Processing POST request : /v2/vsa/vm/502b01a6-5fcf-840c-219c-18627dcdc116/recover : Headers :[Content-Type=application/xml][Accept=application/json][Accept-Encoding=identity][Expect=100-continue][Host=127.0.0.1:81][Content-Length=324][SkipOldJsonConverter=true][CVRequestRouted=true][MS-ASPNETCORE-TOKEN=b3db4dec-5215-4544-b7ff-43e169642bd7][X-Original-Proto=http][WEBSERVERCORE-FLAG=true][X-Original-For=127.0.0.1:52287] : Parameters : (empty) : AdditionalInfo[ClientIP[127.0.0.1] ConsoleType[Unknown] Operation[CV.WebServer.Controllers.VirtualizationController.PerformFullVMRestore (CVWebControllerVirtualization)] Username[prod01\admmunkovdm]] : Request : <Api_VMRestoreReq jobId="4899337" powerOnVmAfterRestore="0" inPlaceRestore="0" passUnconditionalOverride="0"><destinationInfo><vmware esxHost="nzs010svrcha06v.prod01.inroot.net" newName="NZS010AWX01M_RST" dataStore="DELL_ME4_Vol3" /></destinationInfo><destinationClient clientName="vCenter" /></Api_VMRestoreReq>
To which I'm getting the following error stack trace:
30284 165 01/07 09:21:25 ### ### WebServerRoute::HandleRequest - WebException : The remote server returned an error: (500) Internal Server Error.
30284 165 01/07 09:21:25 ### ### WebServerRoute::HandleRequest - WebException Stack Trace : at System.Net.HttpWebRequest.GetResponse()
at CVInfoMgmtService.WebServerRoute.HandleRequest()
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - exception : source Core .Net SqlClient Data Provider, message : The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied., System.Linq.Enumerable+<TakeWhileIterator>d__204`1[System.Char]. inner exception : none
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - attempt [1] to executing select command [SELECT id as clientId FROM App_client WHERE name = @clientName] against nzs0d1comsrv01h\Commvault::commserv
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - exception : source Core .Net SqlClient Data Provider, message : The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied., System.Linq.Enumerable+<TakeWhileIterator>d__204`1[System.Char]. inner exception : none
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - attempt [2] to executing select command [SELECT id as clientId FROM App_client WHERE name = @clientName] against nzs0d1comsrv01h\Commvault::commserv
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - exception : source Core .Net SqlClient Data Provider, message : The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied., System.Linq.Enumerable+<TakeWhileIterator>d__204`1[System.Char]. inner exception : none
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - attempt [3] to executing select command [SELECT id as clientId FROM App_client WHERE name = @clientName] against nzs0d1comsrv01h\Commvault::commserv
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - exception : source Core .Net SqlClient Data Provider, message : The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied., System.Linq.Enumerable+<TakeWhileIterator>d__204`1[System.Char]. inner exception : none
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - attempt [4] to executing select command [SELECT id as clientId FROM App_client WHERE name = @clientName] against nzs0d1comsrv01h\Commvault::commserv
18616 47 01/07 09:21:25 47 prod01\admmunkovdm ExecuteSelect - exception : source Core .Net SqlClient Data Provider, message : The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied., System.Linq.Enumerable+<TakeWhileIterator>d__204`1[System.Char]. inner exception : none
18616 47 01/07 09:21:25 47 prod01\admmunkovdm GetClientId - System.Data.SqlClient.SqlException (0x80131904): The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied.
at CV.WebServer.Services.DatabaseContextBase.ExecuteSelect(SqlCommand cmd)
at CV.WebServer.Services.CommservDBContext.GetClientId(String clientName)
ClientConnectionId:09ecda72-2c65-426a-beb4-0c8fc7ce3e1c
Error Number:8178,State:1,Class:16
18616 47 01/07 09:21:25 47 prod01\admmunkovdm GetClientId - unexpected exception : 'System.Data.SqlClient.SqlException (0x80131904): The parameterized query '(@clientName nvarchar(4000))SELECT id as clientId FROM App_clien' expects the parameter '@clientName', which was not supplied.
at CV.WebServer.Services.DatabaseContextBase.ExecuteSelect(SqlCommand cmd)
at CV.WebServer.Services.CommservDBContext.GetClientId(String clientName)
ClientConnectionId:09ecda72-2c65-426a-beb4-0c8fc7ce3e1c
It seems that it can't recognize "<destinationClient clientName="vCenter" />" from request body as a variable for the SQL query to get the client ID.
I will try using sandbox instead of my "normal" way (using Ansible uri module) and report back soon.
Thanks a lot,
Dima