- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2019 02:46 AM
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.
Solved! Go to Solution.
Re: fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2019 08:11 AM
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"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2019 01:06 PM
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.
Re: fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 08:56 AM
Hi, I have exactly same issue. Did you managed to get it working?
Know anyone solution. I see a lot of discussion about this problem, but unfortunatelly I don't see any working solution. In my case I am using "NORMAL" mode and return message gives me error, which is:
{
"Error": "AdmConDataError: None (IBDataError: IB.Data:Restore Database : Grid Restore Failed - Extracting file failed, /storage/tmp/http_direct_file_io/req_id-UPLOAD-0115150156883218/errs)",
"code": "Client.Ibap.Data",
"text": "Restore Database : Grid Restore Failed - Extracting file failed, /storage/tmp/http_direct_file_io/req_id-UPLOAD-0115150156883218/errs"
}
I found out, that TOKEN looks weird. It includes a lot of "\n" characters, which looks suspicious.
I have used WAPI version 2.13.1 on NIOS 9.0.3
Thanks,
Michael.
Re: fileop?_function=restoredatabase fails with "Failed: Restore Database in Forced mode"
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 02:24 AM - edited 05-06-2024 02:44 AM
It seems like there's a problem with the file upload. Please ensure that no headers are used with the file upload block. In my Python script, I utilize the session class and directly employ requests to bypass headers from the session.
I have a functional Python script available. Check this out if you're interested:
https://github.com/Farseencbv/infoblox-python-scripts.git