Restore Failed: Error while trying to get data from uapi/whmapi

JetBackup 5 relies on the use of Panel API to fetch the necessary data to backup and restore certain items. In some cases, a restore may fail when a backup item being restored using Panel API results in an error. To help troubleshoot the issue, please use Debug Mode found in Settings -> General -> Debug Mode. Debug Mode will log more details about the specific API call that failed during the process. Please work with a system administrator to ensure that the API commands are able to run on your server with no issues. 

One common whmapi error we see during restores is the following:

Error while trying to get data from whmapi1 "listaccts" function . Error: No accounts found

This error may occur when there was an issue running the cPanel restorepkg script when restoring the account. You can check the log for the cPanel restorepkg script via WHM at Transfers -> Review Transfers and Restores. Please check these logs for any information on why the account was not created during the restore.

Another common uapi error we have seen during restores is the following:

Error while trying to get data from uapi. Error: The name “DATABASE_NAME” does not begin with the required prefix “USERNAME_”

There are a few potential options for why the databases in the backup for that account don't have the exact prefix that cPanel/WHM's API is requiring:

  1. The database was created with a manually specified prefix. (with WHM Tweak Setting Require a username prefix on names of new databases and database users requirement disabled.)
  2. The account was created when cPanel had different prefixing requirements for MySQL and/or before prefix requirements were enforced. (This feature appears to have been added in 2014 per blog.cpanel.net )
  3. The main account name was changed in the past, which changed the required prefix.
  4. The account was created on a server using MariaDB, then later restored/transferred to a server using MySQL. cPanel/WHM software has different prefix requirements depending on whether MySQL or MariaDB is used.

In our experience, option d) is the most likely in this case because cPanel's UAPI is requiring the first 8 characters of the account name as the prefix (maximum prefix length for MySQL), but the database that's being restored includes the full account name as a prefix. (as allowed with MariaDB)

As a temporary workaround, it is safe to temporarily disable it from WHM Home > Tweak Settings > “Require a username prefix on names of new databases and database users” to OFF, then re-enable once the restore completes.

Another common uapi error we have seen during restores is the following:

Your addon domain limit of 0 addon domains has been reached

This error normally only occurs when Custom account limits attempt to overwrite the package limits.

For example, if the account limits were set to "Custom Values", such as the "Max Addon Domains" being set to 0, while the package limits allowed for 5 Addon Domains, JetBackup would have already set the "Max Addon Domains" to 0 before it was able to restore any domains.

As part of the restore process, the "Panel Config" is restored before any other items. Then, any custom account limits are applied after setting the package/restoring Panel Config, because the custom limits must overwrite the package values.

There are a couple of options for restoring an account if this occurs:

  • If the account was already partially restored, you can remove the "Panel Config" Backup Item from the final "Items To Restore" screen by clicking "Remove Items". Once an account is no longer an orphan, it's unnecessary to always include the Panel Config in the restore.
  • You can use the "Change account owner and/or package" option when restoring an orphaned account to set the package to a "catch-all" package that has no limits on addon-domains in case the account had custom limits when backed up.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Orphan Accounts Missing

Sometimes terminated accounts will not appear in the Orphan Accounts Section. Please verify the...

cPanel Email Account Already Exists

There are times when restoring email accounts will result in the following error: [ERROR] Error...

cPanel Email Files/Folders Restored With Incorrect Permissions

There are some cases a restore of cPanel Accounts can result in the following error when trying...

Database Restore Failed - Please DISCARD the tablespace before IMPORT

When restoring databases JetBackup attempts to drop the database tables before starting the...

Directory Restore Fills Partition

There are some cases where a Directory Restore can cause the partition the restored directory is...