Solved

VM backup API returning internal server error


Badge +6

I need to backup VMs and I am using the below API:(tried both of them)

https://api.commvault.com/docs/SP34/api/cv/OpenAPI3/virtual-machine-backup

https://api.commvault.com/docs/SP34/api/cv/VirtualizationOperations/perform-vm-backup

But they are not working and throwing internal server. Can someone help me with this.

P.S. I am testing it on a test commvault with similar environment to production.

Below are the logs for one of my API calls:

14536 175   05/31 11:44:36 175 admin  - WEBAPI-STARTED processing [POST]:[/v4/VirtualMachines/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] request. : /v4/VirtualMachines/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup : Parameters : [backupLevel=FULL] : AdditionalInfo[ ConsoleType[API]]
14536 175   05/31 11:44:36 175 admin GetTemplateInfoForAPI - Pipeline Stages selected : default
14536 175   05/31 11:44:36 175 admin ProcessStep - Pipeline stage 'default' will be executed
14536 175   05/31 11:44:36 175 admin ProcessStep - Request from the pipeline after rendering: 
14536 160   05/31 11:44:36 160 admin  - WEBAPI-STARTED processing [POST]:[/v2/vsa/vm/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] request. : /v2/vsa/vm/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup : Parameters : [backupLevel=FULL] : AdditionalInfo[ ConsoleType[API]]
14536 160   05/31 11:44:36 160 admin GetQSDKTokenForAnyTokenType - unexpected exception : Exception : 'System.NotImplementedException: Token type is not supported.
   at CV.WebServer.Services.WebSessionInfoServiceImpl.TokenHelper.GetQSDKTokenForAnyTokenType(HttpContext context)
   at CV.WebServer.Services.WebSessionInfoServiceImpl.GetQSDKToken()
   at CV.WebServer.Handlers.CVWebHandlerQAPI..ctor()
   at CV.WebServer.Handlers.CVSubclient.BackupSubclient(CreateTaskReq req, Int32 userId, Int32 localeId)
   at CV.WebServer.Handlers.CVWebHandlerVMManagement.PerformVMBackup(String vmGuid, BackupLevel bkpLevel)
   at CV.WebServer.Controllers.VirtualizationController.PerformVMBackup(String vmGuid)
   at lambda_method816(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)'] Response status code set to HttpStatusCode.InternalServerError (500)
14536 160   05/31 11:44:36 160 admin Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/v2/vsa/vm/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] in [60] ms;  HTTP code 'InternalServerError'
14536 175   05/31 11:44:36 175 admin Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/v4/VirtualMachines/52c0fb3f-9cf0-ea0c-6518-ff20a5d37a6f/backup] in [78] ms;  HTTP code 'InternalServerError'
14536 183   05/31 11:44:41 183 ###  - WEBAPI-STARTED processing [POST]:[/getDomains] request. : /getDomains : AdditionalInfo[ ConsoleType[Unknown]]
14536 183   05/31 11:44:41 183 ### Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/getDomains] in [16] ms;  HTTP code 'OK'
14536 182   05/31 11:44:41 182 admin  - WEBAPI-STARTED processing [GET]:[/CommcellHealthStatus] request. : /CommcellHealthStatus : Parameters : [CommServGUID=AED8C433-93CB-4A67-80C9-FFFCD116C127] : AdditionalInfo[ ConsoleType[WebConsole]]
14536 183   05/31 11:44:41 ### ### Login:GetDomains - No Domains registered
14536 182   05/31 11:44:42 182 admin Invoke - WEBAPI-FINISHED processing [GET]:[/CVWebService.svc/CommcellHealthStatus] in [347] ms;  HTTP code 'OK'
14536 181   05/31 11:44:53 181 ###  - WEBAPI-STARTED processing [GET]:[] request. :  : AdditionalInfo[ ConsoleType[Unknown]]
14536 181   05/31 11:44:53 181 ### Invoke - WEBAPI-FINISHED processing [GET]:[/CVWebService.svc] in [7] ms;  HTTP code 'OK'
14536 121   05/31 11:49:29 121 _+_PublicSharingUser_  - WEBAPI-STARTED processing [POST]:[/CommServ/GlobalParams] request. : /CommServ/GlobalParams : AdditionalInfo[ ConsoleType[WebConsole]]
14536 121   05/31 11:49:29 121 _+_PublicSharingUser_ GetGlobalParams - Warning: #0 setting(s) that are not allowed to be queried will be skipped!
14536 121   05/31 11:49:29 121 _+_PublicSharingUser_ Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/CommServ/GlobalParams] in [20] ms;  HTTP code 'OK'
14536 187   05/31 11:50:52 187 ###  - WEBAPI-STARTED processing [GET]:[] request. :  : AdditionalInfo[ ConsoleType[Unknown]]
14536 187   05/31 11:50:52 187 ### Invoke - WEBAPI-FINISHED processing [GET]:[/CVWebService.svc] in [9] ms;  HTTP code 'OK'
 

icon

Best answer by RandomCustomer 5 June 2024, 14:26

View original

2 replies

Userlevel 6
Badge +14

Hello @RandomCustomer 

Thanks for the question and all the details.

Can you please confirm that running the job on these VM’s in the GUI is working and only the API method is failing?

Kind regards
Albert Williams

Badge +6

I got this resolved. I had to add Bearer in front of the token.

Reply