Reply
Highlighted
Accepted Solution

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

lyona
Techie
Posts: 3
301     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"

Adviser
Posts: 93
302     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"

lyona
Techie
Posts: 3
302     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 
Do you mean 

Recommended for You