POST VM Restore issue

Last post 01-06-2021, 5:06 PM by Dima Munkov. 1 replies.
Sort Posts: Previous Next
  • POST VM Restore issue
    Posted: 01-06-2021, 3:43 PM

    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
  • Re: POST VM Restore issue
    Posted: 01-06-2021, 5:06 PM

    Interestingly, the Swagger expects only json body:

    Which didn't work either:

    18616 89    01/07 09:59:37 89  prod01\admmunkovdm  - Processing POST request : /v2/vsa/vm/502b01a6-5fcf-840c-219c-18627dcdc116/recover : Headers :[Content-Type=application/json][Accept=application/json][Accept-Encoding=gzip, deflate, br][Accept-Language=en-US,en;q=0.9][Expect=100-continue][Host=127.0.0.1:81][Referer=https://nzs0d1comsrv01h.prod01.inroot.net/webconsole/sandbox/apiexplorer/][Origin=https://nzs0d1comsrv01h.prod01.inroot.net][Content-Length=331][sec-fetch-site=same-origin][sec-fetch-mode=cors][sec-fetch-dest=empty][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:53598] : Parameters : (empty) : AdditionalInfo[ClientIP[127.0.0.1] ConsoleType[Unknown] Operation[CV.WebServer.Controllers.VirtualizationController.PerformFullVMRestore (CVWebControllerVirtualization)] Username[prod01\admmunkovdm]] : Request : 502b01a6-5fcf-840c-219c-18627dcdc116
    30284 124 01/07 09:59:38 ### ### WebServerRoute::HandleRequest - WebException : The remote server returned an error: (500) Internal Server Error.
    30284 124 01/07 09:59:38 ### ### WebServerRoute::HandleRequest - WebException Stack Trace : at System.Net.HttpWebRequest.GetResponse()
    at CVInfoMgmtService.WebServerRoute.HandleRequest()
    18616 89 01/07 09:59:38 89 prod01\admmunkovdm BuildCommonRestoreOptions - unexpected exception : 'Object reference not set to an instance of an object' at CV.WebServer.Handlers.CVWebHandlerTask.BuildCommonRestoreOptions(VMRestoreReq vMRestoreReq, VMStatusInfo vmEntity). Response status code set to HttpStatusCode.InternalServerError (500)
    18616 89 01/07 09:59:38 89 prod01\admmunkovdm Invoke - HTTP code 'InternalServerError' : Out : (empty)(empty)
The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2021 Commvault | All Rights Reserved. | Legal | Privacy Policy