Solved

ResAPI for restore responding with error "ClientInfo is not complete","errorCode":9517

  • 15 February 2024
  • 6 replies
  • 32 views

Badge +2

Hello, 

I am trying to test the Retrieve to Client (Restore) API following the document  Retrieve to Client (Restore) | Commvault®

I tested the API with both Postman and Golang, and both times I received an error in response. The error is pasted below.

"ClientInfo is not complete","errorCode":9517

Please see the sample GoLang code below. I followed the example in the Commvault rest API docs, but I can't figure out what's missing here.
 

package main

import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"strings"
)

func main() {

url := "https://hostname/commandcenter/api/retrieveToClient"
method := "POST"

payload := strings.NewReader(`{
"mode": 2,
"serviceType": 1,
"userInfo": {
"userGuid": "da752adf-79f0-47d6-8be5-d3dadc9abc5e"
},
"advanced": {
"restoreDataAndACL": true,
"restoreDeletedFiles": true
},
"header": {
"destination": {
"clientId": 171,
"clientName": "<<clientname>>",
"inPlace": false,
"destPath": [
"C://Users//Administrator//Downloads"
]
},
"filePaths": [
"//C://Users//Administrator//Desktop//800gb"
],
"srcContent": {
"subclientId": 399,
"clientId": 171,
"instanceId": 1,
"backupSetId": 331,
"appTypeId": 33
}
}
}`)

client := &http.Client{}
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authtoken", "QSDK 3b83bf1066977563d72cc4d5de464a5b4602376898a02ae6d0bb71b2203d48c1d76041e15edda9950eeb20242519e7c51a2a33c8a90d6c921d532e1f9b71c104f22fca2b87e0566fb6fa4aa12b6a3eb26036f77470d15f8468ab08ce41ce4b14d8017a898127d930021c4d9e37626fb2f8b025ad070dd3f8e998d0fdc8a0ae2ec865e1879aef4ee20081d6932753a8d9171c04870d64c090d4db4cf5e2696e5d8885d32b3db00d1d489d1774c9d0811aa83f2ec97b4639f64d45de8dc813d7967e5cf7f7304bb314a65920e0cb2b22e545ada376f28de827d65dc20ea48eb0dda3fbef4e598ed68fa")

res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}

 

icon

Best answer by Jacek Piechucki 15 February 2024, 09:33

View original

6 replies

Hi,

Please set the debug level to 10 for webeserver.log on the client where webserver is running, wait a minute or two, replicate the issue and share the log snippet, sanitized, if necessary.

Kr,

Jacek

Badge +2

Hello @Jacek Piechucki , 

 

Thank you. Please find the log snippet below. 

24568 176   02/14 23:34:51 176 hdpsauto  - WEBAPI-STARTED processing [POST]:[/retrieveToClient] request. : /retrieveToClient : Headers :[Accept=application/json][Accept-Encoding=gzip][Content-Length=625][Content-Type=application/json][Host=HOSTNAME:81][SkipOldJsonConverter=true][trace-id=ws1bf18d03f46f][WEBSERVERCORE-FLAG=true] : AdditionalInfo[ ConsoleType[API]ClientIP[<<CLIENT_IP>>] Operation[CV.WebServer.Controllers.ClientController.retrieveToClient (CVWebControllerClient)] isTokenSupplied?[True] Username[hdpsauto]] : Request : <DM2ContentIndexing_RetrieveToClientReq mode="2" serviceType="1"><userInfo userGuid="da752adf-79f0-47d6-8be5-d3dadc9cec5e" /><advanced restoreDataAndACL="1" restoreDeletedFiles="1" /><header><filePaths val="//C://Users//Administrator//Desktop//800gb" /><destination clientId="171" clientName="<<CLIENT_NAME>>" inPlace="0"><destPath val="C://Users//Administrator//Downloads" /></destination><srcContent subclientId="399" clientId="171" instanceId="1" backupSetId="331" appTypeId="33" /></header></DM2ContentIndexing_RetrieveToClientReq>
24568 176 02/14 23:34:51 176 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
24568 176 02/14 23:34:51 176 hdpsauto <validator> - Verifying Client.retrieveToClient arguments.
24568 176 02/14 23:34:51 176 hdpsauto <validator> - Client.retrieveToClient parameter 'RetrieveToClientReq req' is set and valid
24568 176 02/14 23:34:51 176 hdpsauto <validator> - All arguments are OK. Continue Client.retrieveToClient execution.
24568 176 02/14 23:34:51 176 hdpsauto GetService - lookup for requested interface ICVIDAEntityDbContext among registered services succeeded.
24568 176 02/14 23:34:51 176 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
24568 176 02/14 23:34:51 176 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
24568 4668 02/14 23:34:51 ### GetNumberFromGalaxyRegistry()() - Retrival of Number from Galaxy Registry failed with Error code [0x303] Error string [Invalid Argument]
24568 4668 02/14 23:34:51 ### GetNumberFromGalaxyRegistry()() - Retrival of Number from Galaxy Registry failed with Error code [0x303] Error string [Invalid Argument]
24568 63c 02/14 23:34:51 ### getQSDKTokenInfo() - Found matching token for provided CS.
24568 168 02/14 23:34:51 ### hdpsauto dmSecurity::GetProviders - Host name or proxy name is empty for name server #[0]. Firewall config check skipped.
24568 168 02/14 23:34:51 ### hdpsauto dmSecurity::GetProviders - Host name or proxy URL is empty for name server #[0]. Firewall config check skipped.
24568 168 02/14 23:34:51 ### hdpsauto dmSecurity::GetProviders - Host name or proxy name is empty for name server #[1]. Firewall config check skipped.
24568 168 02/14 23:34:51 ### hdpsauto dmSecurity::GetProviders - Host name or proxy URL is empty for name server #[1]. Firewall config check skipped.
24568 168 02/14 23:34:51 ### hdpsauto Login:GetDomains - Service details are not returned for security reason
24568 176 02/14 23:34:51 ### hdpsauto csSecurity::getBrowseClientsContents - Input --> userGuid : [B98A5], fromTime : [0], toTime : [0]
clientId : [171, serviceType : [1], mailBoxorNFS : [],mode = [0]
24568 176 02/14 23:34:51 176 hdpsauto ShouldVisit - Message is not supported for company tagging
24568 176 02/14 23:34:51 176 hdpsauto Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/retrieveToClient] in [230] ms; HTTP code 'OK' Out : <DM2ContentIndexing_RetrieveToClientResp><errList errLogMessage="ClientInfo is not complete" errorCode="9517" /></DM2ContentIndexing_RetrieveToClientResp>
24568 1454 02/14 23:36:16 ### CVPlatformInfo::getRegStringImpl() - Field messagequeueTCPPort in key ~MessageQueue is not a string.

 

Please find below my working code.

The difference is provided client name.

The other important modification for Windows restores is using backslashes instead of slashes; otherwise browse process will not find data to restore.

 

 

package main

import (
    "crypto/tls"
    "fmt"
    "io/ioutil"
    "net/http"
    "strings"
)

func main() {

    url := "https://webconsolehostname/commandcenter/api/retrieveToClient"
    method := "POST"

    payload := strings.NewReader(`{
  "mode": 2,
  "serviceType": 1,
  "userInfo": {
    "userGuid": "2AE69CA3-1DDA-4AB3-848D-DFCB06EC195D"
  },
  "advanced": {
    "restoreDataAndACL": true,
    "restoreDeletedFiles": true
  },
  "header": {
    "destination": {
      "clientId": 2,
      "clientName": "CS04-32",
      "inPlace": false,
      "destPath": [
        "C:\\users\\Administrator\\Downloads"
      ]
    },
    "filePaths": [
      "C:\\inetpub\\logs\\LogFiles"
    ],
    "srcContent": {
      "subclientId": 3,
      "clientId": 2,
      "instanceId": 1,
      "backupSetId": 4,
      "appTypeId": 33
    }
  }
}`)

    client := &http.Client{}
    http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Accept", "application/json")
    req.Header.Add("Authtoken", "QSDK 3e165b4162d1221ad17fc6cc514a6d4eee0d575578132754627489f115c6917a7816c987a4247df7a577a9d64f27b738eb0ba58eca554f90f41450c18027230dfdc3ab16be0694eddeef0530d09afab3c24a41ed2881b64d5a463394b7f996b4df20a684fbbdd2b905542c576186e91a1bf147c3c3269d27671e73230255fb8df3d15856c6bf663994a249c337fbddf7185360e79ee475d0afc1f8952620abadd18ac00efd326cce909ddae30f0d312ff9faecf8d7980fa7bc4f65f70d1303763d41d8afde213e3b566021db58a6587bc")

    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}

Badge +2

Hi, 

I made the changes according to your suggestion, but I am still getting the same error message. 

Code: 

package main

import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"strings"
)

func main() {

url := "https://hostname/commandcenter/api/retrieveToClient"
method := "POST"

payload := strings.NewReader(`{
"mode": 2,
"serviceType": 1,
"userInfo": {
"userGuid": "da752adf-79f0-47d6-8be5-d3dadc9cec5e"
},
"advanced": {
"restoreDataAndACL": true,
"restoreDeletedFiles": true
},
"header": {
"destination": {
"clientId": 171,
"clientName": "win-knp93b9ojtb",
"inPlace": false,
"destPath": [
"C:\\Users\\Administrator\\Downloads"
]
},
"filePaths": [
"C:\\Users\\Administrator\\Desktop\\800gb"
],
"srcContent": {
"subclientId": 399,
"clientId": 171,
"instanceId": 1,
"backupSetId": 331,
"appTypeId": 33
}
}
}`)

client := &http.Client{}
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authtoken", "QSDK 3b9fd47dac7abd89831dce09cba43bc04c6ba32156b51f9dbf7fb5f99db7090353fa5ce7f5f22da66c2debabf6908487487bfa379da1b0e775b43d93055330802218d8488d60efbff5a7b35027f7783b5ec661481b6b5b11569a33235635f074f15381ba9822db94b3e60a79e77e564b511218e5286f91e104df614969e02c1e442c20f45076e7499cc5e441c57373178bfd3aba6ffc417eaaebb2d2d8b4041f2bd91f369563c1641bc661ccff1f96a21f5d88e111c3a78b86cb222ffb4084099f126307e316fc0498925b7306b18f22775e2e3bed495b37d")

res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}

WebServer.log

3904 130   02/15 03:51:15 130 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
23904 130 02/15 03:51:15 130 hdpsauto <validator> - Verifying DM2Messages.GetDomains arguments.
23904 130 02/15 03:51:15 130 hdpsauto <validator> - All arguments are OK. Continue DM2Messages.GetDomains execution.
23904 130 02/15 03:51:15 130 hdpsauto ShouldVisit - Message is not supported for company tagging
23904 130 02/15 03:51:15 130 hdpsauto Invoke - WEBAPI-FINISHED processing [GET]:[/CVWebService.svc/getDomains] in [149] ms; HTTP code 'OK' Out : <DM2ContentIndexing_GetLogonListResp><domains serviceType="2" hostName="SelfCert.Com" resourceId="0" flags="1" isCS="0" enabled="1" servicePassword="" port="0" domainName="SELFCERT" secureLDAP="0" id="1" serviceUserName="" /></DM2ContentIndexing_GetLogonListResp>
23904 116 02/15 03:51:15 116 hdpsauto Invoke - 'POST /CVWebService.svc/retrieveToClient' is not found in CVWebServerCoreRouting.conf. Will be handled by WebServerCore
23904 116 02/15 03:51:15 116 hdpsauto Invoke - IP [Client_IP] is not a trusted ip source
23904 116 02/15 03:51:15 116 hdpsauto Invoke - Mode is not a trusted mode [QSDKToken]
23904 116 02/15 03:51:15 116 hdpsauto TokenTypeAndApiMatches - API '/retrievetoclient' does not check the token type.
23904 116 02/15 03:51:15 116 hdpsauto Invoke - authenticated = True, bAuthRequired = True, refuse = False
23904 116 02/15 03:51:15 116 hdpsauto Invoke - RemoteWebServiceHelper.IsRemoteServiceRequest returned false
23904 116 02/15 03:51:15 116 hdpsauto - WEBAPI-STARTED processing [POST]:[/retrieveToClient] request. : /retrieveToClient : Headers :[Accept=application/json][Accept-Encoding=gzip][Content-Length=623][Content-Type=application/json][Host=WIN-C7K6LI9LPL7:81][SkipOldJsonConverter=true][trace-id=wsba8dadf035b3][WEBSERVERCORE-FLAG=true] : AdditionalInfo[ ConsoleType[API]ClientIP[172.18.105.206] Operation[CV.WebServer.Controllers.ClientController.retrieveToClient (CVWebControllerClient)] isTokenSupplied?[True] Username[hdpsauto]] : Request : <DM2ContentIndexing_RetrieveToClientReq mode="2" serviceType="1"><userInfo userGuid="da752adf-79f0-47d6-8be5-d3dadc9cec5e" /><advanced restoreDataAndACL="1" restoreDeletedFiles="1" /><header><filePaths val="C:\Users\Administrator\Desktop\800gb" /><destination clientId="171" clientName="win-knp93b9ojtb" inPlace="0"><destPath val="C:\Users\Administrator\Downloads" /></destination><srcContent subclientId="399" clientId="171" instanceId="1" backupSetId="331" appTypeId="33" /></header></DM2ContentIndexing_RetrieveToClientReq>
23904 116 02/15 03:51:15 116 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
23904 116 02/15 03:51:15 116 hdpsauto <validator> - Verifying Client.retrieveToClient arguments.
23904 116 02/15 03:51:15 116 hdpsauto <validator> - Client.retrieveToClient parameter 'RetrieveToClientReq req' is set and valid
23904 116 02/15 03:51:15 116 hdpsauto <validator> - All arguments are OK. Continue Client.retrieveToClient execution.
23904 116 02/15 03:51:15 116 hdpsauto GetService - lookup for requested interface ICVIDAEntityDbContext among registered services succeeded.
23904 116 02/15 03:51:15 116 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
23904 116 02/15 03:51:15 116 hdpsauto GetService - lookup for requested interface IWebSessionInfoService among registered services succeeded.
23904 116 02/15 03:51:16 116 hdpsauto ShouldVisit - Message is not supported for company tagging
23904 116 02/15 03:51:16 116 hdpsauto Invoke - WEBAPI-FINISHED processing [POST]:[/CVWebService.svc/retrieveToClient] in [384] ms; HTTP code 'OK' Out : <DM2ContentIndexing_RetrieveToClientResp><errList errLogMessage="ClientInfo is not complete" errorCode="9517" /></DM2ContentIndexing_RetrieveToClientResp>
23904 116 02/15 03:51:15 ### hdpsauto csSecurity::getBrowseClientsContents - Input --> userGuid : [B98A5], fromTime : [0], toTime : [0]
clientId : [171, serviceType : [1], mailBoxorNFS : [],mode = [0]

 

The only thing I can think of is a confusing / incorrect set of data given for destination or source elements and provided to the API.

Badge +2

Thanks @Jacek Piechucki ,

The issue has been resolved. The backup I tried to restore was pruned because its retention time had expired. I took a fresh backup today, and the problem is now resolved.

I believe the REST API page should be modified to use backslashes rather than slashes in the file path.

Also, could you please provide an example of a Linux path?

Reply