Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps

Reply

fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"

Member
Posts: 3
2961     0

Hi,

 

I need some help with a database restore operation. I'm attempting to take a backup file taken from one server and restore it to another. The backup contains just a couple of zones and a few records.

I can successfully restore the backup file via the GUI, but it fails using the API,

 

I'm using PowerShell v6 running on mac.

 

 
$res = Invoke-RestMethod `
        -Uri "https://infobloxsvr/wapi/v2.6/fileop?_function=uploadinit" `
        -Method Post `
        -ContentType 'application/json' `
        -AllowUnencryptedAuthentication `
        -SkipCertificateCheck `
        -WebSession $authCookie2

$form = @{file = '@database.bak' }

Invoke-RestMethod `
        -Uri $res.url `
        -Method Post `
        -ContentType 'multipart/form-data' `
        -AllowUnencryptedAuthentication `
        -SkipCertificateCheck `
        -WebSession $authCookie2 `
        -Form $form

$token = ($res.token).replace("`n", "")
$data = "{""keep_grid_ip"": false, ""mode"": ""FORCED"",""token"": ""$token""}"


Invoke-WebRequest `
        -Uri "https://infobloxsvr/wapi/v2.6/fileop?_function=restoredatabase" `
        -Method Post `
        -ContentType 'application/json' `
        -AllowUnencryptedAuthentication `
        -SkipCertificateCheck `
        -WebSession $authCookie2 `
        -Body $data
 

 

This results in an error 

"Error": "AdmConDataError: None (IBDataError: IB.Data:Failed: Restore Database in Forced mode)",
"code": "Client.Ibap.Data",
"text": "Failed: Restore Database in Forced mode"

 

 I get the same error using Curl. It works fine using the GUI, so I know the backup file is OK.

Not sure where to go to troubleshoot this now. Any assistance you can give appreciated. 

Re: fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"

Moderator
Moderator
Posts: 246
2962     0

I'd reccomend turning on full debugging ("set debug all on" at the CLI) and try again. After you try, pull the support bundle from the gridmaster and take a look at /var/log/messages and other logfiles, to see if something sticks out.  It should tell you why it wasn't willing to complete the upgrade.

Re: fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"

Member
Posts: 3
2962     0

Thanks for your reply MRichard.

Running 'set debug all on' gave me a bit more error information from the api call which gave me a clue as to where the issue was. It was in the file upload step, I think my form data wasn't quite right.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You