We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • WHM API 1 Functions - background_mysql_upgrade_status
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the status of a background MySQL® or MariaDB® upgrade.

Important:

In cPanel & WHM version 76 and later, when you disable the MySQL/MariaDB role and remote MySQL is not already configured, the system disables this function.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/background_mysql_upgrade_status?api.version=1&upgrade_id=mysql_upgrade.20141108-172923
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/background_mysql_upgrade_status?api.version=1&upgrade_id=mysql_upgrade.20141108-172923
 Command Line
whmapi1 background_mysql_upgrade_status upgrade_id=mysql_upgrade.20141108-172923


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
	"data": {
		"error": 0,
		"log": "Starting process with log file at /var/cpanel/logs/mysql_upgrade.20141108-172923/unattended_background_upgrade.log\n Beginning 'MariaDB 10.0' upgrade...\nObtained version information from system.\nEnsuring the 'MariaDB100' repository is available and working.\ncheckyum version 22.3\nEnsuring that the package 'MariaDB-client' with version matching '10.0' is available.\nEnsuring that the package 'MariaDB-common' with version matching '10.0' is available.\nEnsuring that the package 'MariaDB-devel' with version matching '10.0' is available.\nEnsuring that the package 'MariaDB-server' with version matching '10.0' is available.\nEnsuring that the package 'MariaDB-shared' with version matching '10.0' is available.\nEnsuring that the package 'coreutils' is available.\nEnsuring that the package 'grep' is available.\nEnsuring that the package 'perl-DBI' is available.\n your MariaDB server version for the right syntax to use near '.`netcopya0I5KfqYTfHqJr` FOR UPGRADE' at line 1 when executing 'CHECK TABLE ... FOR UPGRADE'\nFATAL ERROR: Upgrade failed\nDone building configuration.\nHooks system enabled.\nChecking for and running RPM::Versions 'post' hooks for any RPMs about to be installed\nAll required 'post' hooks have been run\nRunning: /usr/local/cpanel/scripts/check_cpanel_rpms--targets=MySQL41,MySQL50,MySQL51,MySQL55,MySQL56,MariaDB100,MariaDB101 --fix\nRestarting mysql service.\nWaiting for 'mysql' to restart............................................................waiting for 'mysql' toinitialize .........finished.\n\u001b[1;32mMariaDB upgrade completed successfully\u001b[0m\n------------------------------------\nChecking for Ruby update...\nNo Ruby update required.\n------------------------------------\n",
		"error_log": "",
		"state": "success"
	},
	"metadata": {
		"version": 1,
		"reason": "OK",
		"result": "1",
		"command": "background_mysql_upgrade_status"
	}
}
 Output (XML)
<result>
    <data>
       <error>0</error>
       <log>Starting
 process with log file at 
/var/cpanel/logs/mysql_upgrade.20141108-172923/unattended_background_upgrade.log\nBeginning
 "MariaDB 10.0" upgrade...\nObtained version information from 
system.\nEnsuring the "MariaDB100" repository is available and 
working.\ncheckyum version 22.3\nEnsuring that the package 
"MariaDB-client" with version matching "10.0" is available.\nEnsuring 
that the package "MariaDB-common" with version matching "10.0" is 
available.\nEnsuring that the package "MariaDB-devel" with version 
matching "10.0" is available.\nEnsuring that the package 
"MariaDB-server" with version matching "10.0" is available.\nEnsuring 
that the package "MariaDB-shared" with version matching "10.0" is 
available.\nEnsuring that the package "coreutils" is 
available.\nEnsuring that the package "grep" is available.\nEnsuring 
that the package "perl-DBI" is available.\n your MariaDB server version 
for the right syntax to use near '.`netcopya0I5KfqYTfHqJr`  FOR UPGRADE'
 at line 1 when executing 'CHECK TABLE ...  FOR UPGRADE'\nFATAL ERROR: 
Upgrade failed\nDone building configuration.\nHooks system 
enabled.\nChecking for and running RPM::Versions 'post' hooks for any 
RPMs about to be installed\nAll required 'post' hooks have been 
run\nRunning: /usr/local/cpanel/scripts/check_cpanel_rpms 
--targets=MySQL41,MySQL50,MySQL51,MySQL55,MySQL56,MariaDB100,MariaDB101 
--fix\nRestarting mysql service.\nWaiting for "mysql" to restart 
............................................................waiting for "mysql" to initialize 
.........finished.\n\u001b[1;32mMariaDB upgrade completed 
successfully\u001b[0m\n------------------------------------\nChecking 
for Ruby update...\nNo Ruby update 
required.\n------------------------------------\n</log>
	   <error_log></error_log>
       <state>success</state>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>background_mysql_upgrade_status</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ReturnTypeDescriptionPossible valuesExample
upgrade_idstring

Required

The logfile's name.

Note:

 Log files exist in the /var/cpanel/logs/ directory.

A valid filename.
mysql_upgrade.20141108-172923

Returns

ReturnTypeDescriptionPossible valuesExample
errorinteger

An error code.

  • 0 — Successful upgrade.
  • -1 — Child process died from a signal.
  • 4 — MySQL upgrade failed error code.
  • 5 — Ruby upgrade failed error code.
  • 8 — EasyApache upgrade failed error code.
0
logstringThe upgrade's log file.A valid log file.
 Click to view...
Starting
 process with log file at 
/var/cpanel/logs/mysql_upgrade.20141108-172923/unattended_background_upgrade.log\nBeginning
 “MariaDB 10.0” upgrade...\nObtained version information from 
system.\nEnsuring the “MariaDB100” repository is available and 
working.\ncheckyum version 22.3\nEnsuring that the package 
“MariaDB-client” with version matching “10.0” is available.\nEnsuring 
that the package “MariaDB-common” with version matching “10.0” is 
available.\nEnsuring that the package “MariaDB-devel” with version 
matching “10.0” is available.\nEnsuring that the package 
“MariaDB-server” with version matching “10.0” is available.\nEnsuring 
that the package “MariaDB-shared” with version matching “10.0” is 
available.\nEnsuring that the package “coreutils” is 
available.\nEnsuring that the package “grep” is available.\nEnsuring 
that the package “perl-DBI” is available.\n your MariaDB server version 
for the right syntax to use near '.`netcopya0I5KfqYTfHqJr`  FOR UPGRADE'
 at line 1 when executing 'CHECK TABLE ...  FOR UPGRADE'\nFATAL ERROR: 
Upgrade failed\nDone building configuration.\nHooks system 
enabled.\nChecking for and running RPM::Versions 'post' hooks for any 
RPMs about to be installed\nAll required 'post' hooks have been 
run\nRunning: /usr/local/cpanel/scripts/check_cpanel_rpms 
--targets=MySQL41,MySQL50,MySQL51,MySQL55,MySQL56,MariaDB100,MariaDB101 
--fix\nRestarting mysql service.\nWaiting for “mysql” to restart 
……………………………………………………waiting for “mysql” to initialize 
………finished.\n\u001b[1;32mMariaDB upgrade completed 
successfully\u001b[0m\n------------------------------------\nChecking 
for Ruby update...\nNo Ruby update 
required.\n------------------------------------\n



error_logstring

The upgrade's error log file.

Note:

You can review MySQL upgrade error logs in the following location, where $TIME represents the time in Unix epoch time format:

/var/cpanel/logs/mysql_upgrade.$TIME/unattended_background_upgrade.error
A valid error log file.
 Click to view...
Starting
 The system failed to update MYSQL,\n------------------------------------\n
statestringThe upgrade's state.
  • success
  • failed
  • in progress
success