Error on Warm Spare Backup

Hello all,

I am trying to get my servers set up to use the Warm Spare backup. I run into what seems to be the same error, on two different servers, at different times in the process.

Server 1
I was able to get all the config done following this guide (https://wiki.freepbx.org/pages/viewpage.action?pageId=185631299) and create the backup. When I run the backup, it seems like it completes the backup, but on the restore, I get the following error:

Warmspare enabled for this backup
We Have triggered an API to restore the backup on Spare Server

In json_decode.php line 7:
                
  Syntax error

This is what that json_decode.php file looks like:

 [[email protected] Json]# cat json_decode.php
    <?php
    namespace FreePBX\modules\Backup\Json;

    function json_decode($json, $assoc = false, $depth = 512, $options = 0) {
            $data = \json_decode($json, $assoc, $depth, $options);
            if (JSON_ERROR_NONE !== json_last_error()) {
                    throw new \JsonException(json_last_error_msg(),json_last_error());
            }
            return $data;

I don’t know what this file is supposed to look like, so I don’t know where the error is. I have a pair of test servers that I got this working on. When I look at this file on the working server, it looks the same as the server where this is not working.

Server 2

I am creating the backup job. When I get to the last part of the backup config, which is where you can “Get Warm Spare Token”, I get a similar error. When I look at the file that is in question on this server, it looks the same as the other two that I look at.

The error that I get when I press ‘Get Warm Spare Token’ says "Syntax error File:/var/www/html/admin/modules/backup/Json/json_decode.php:7

try this and let us know if it changes

there is an option on warm spare to communicate via API or SSH

change your job to SSH and see if the issue persists

Thank you for your recommendation Chris.

The backup finished but it looks like the restore had an error now. Here is the error message I got:

Performing Remote Maintenance
Could not login with username: root, host: 10.129.7.203
Finished Remote Maintenance
Saving to selected Filestore locations
Could not login with username: root, host: 10.129.7.203
Finished Saving to selected Filestore locations
There were errors during the backup process
	Could not login with username: root, host: 10.129.7.203
	Could not login with username: root, host: 10.129.7.203
There were warnings during the backup process
	The module callback returned no data, No backup created
	The module callerid returned no data, No backup created
	The module calllimit returned no data, No backup created
	The module conferencespro returned no data, No backup created
	The module miscdests returned no data, No backup created
	The module phonebook returned no data, No backup created
	The module setcid returned no data, No backup created
	The module ttsengines returned no data, No backup created
Warmspare enabled for this backup
We are running Restore command on Spare Server
Response from Warmspare Server 
backup transactionid:1d6ccddb-e079-4b65-965a-32df52f01e03
Restorestatus :Error running Restore on Spare Server

It looks like it can not login to the spare server. In the config guide that I followed, it has you run this command to see if the primary is able to login to the secondary:

ssh -i /home/asterisk/.ssh/id_rsa [email protected]

When I run this command, it successfully logs me into the spare server without any credentials, so I know it can login to the spare as root.

hmm

take look at the log for the restore on the warm spare, iirc logged to backup.log in /var/log/asterisk

look for you transaction id

hi @jbj92

Please try the following

  1. ssh to primary server ( root user)
  2. run the command: su asterisk
  3. ssh -i /home/asterisk/.ssh/id_rsa [email protected]
    make sure that on 3rd step you are getting the access to secondary server with out any prompt message

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.