Ticket #5839 (closed Bugs: fixed)

Opened 1 year ago

Last modified 2 weeks ago

AstDB Backup/Restore

Reported by: huleuxm Assigned to:
Priority: major Milestone: 2.11
Component: Backup & Restore Version: 2.10-branch
Keywords: backup restore AstDB Cc:
Confirmation: Pending Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description (Last modified by mbrevda)

AstDB restore does not seems to work.

I made the test with only astdb, my backup size is 38mb

but when running "asterisk -rx "database show" > dbdata.txt" on primary and secondary server the database is not the same.

Here's the output from the backup :

Saving Backup 3...done!
Intializing Backup 3
Connecting to remote server...
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
Prossesing received file...
Storing backup...
Running post-backup hooks...
Restoring backup...
/bin/tar: ./etc/freepbx.conf: Cannot open: File exists
/bin/tar: Error exit delayed from previous errors
Running post-backup hooks...
Backup successfully completed!

Attachments

writetimeout.diff.patch (4.0 kB) - added by mbrevda on 06/13/12 06:52:35.

Change History

05/19/12 13:18:58 changed by mbrevda

what is the output of the following? What version of Asterisk are you on?

asterisk -rx 'database show'| wc -l

05/21/12 02:00:17 changed by huleuxm

the output of "asterisk -rx 'database show'| wc -l" is 6228

i'm running on FreePBX Fremework 2.10.0.7

05/21/12 02:02:44 changed by huleuxm

On primary server "asterisk -rx 'database show'| wc -l" returns 8307

05/21/12 07:30:23 changed by mbrevda

  • description changed.

You did not specify your version of Asterisk. There is a known issue with the AMI and large datasets, see here for more details: https://issues.asterisk.org/jira/browse/ASTERISK-19678.

It's not clear if your issue is the same or not - in the past we only say it with 35k+ lines. Catch me on irc if you want to test.

05/21/12 07:33:36 changed by huleuxm

Sory, i'm on asterisk 1.8.12.0

05/21/12 08:46:52 changed by mbrevda

Sounds like it might be the asterisk bug. Catch me in IRC and we can test

05/21/12 10:00:22 changed by mbrevda

  • status changed from new to closed.
  • resolution set to wontfix.

Confirmed as asterisk issue mentioned above

4:53 PM <mbrevda> huleuxm: connecting via ssh to your SERVER is fine. THEN telnet to 127.0.0.1 5038
4:53 PM <mbrevda> the exact ami command (after authenticating) is: ACTION: COMMAND\ncommand: database show
4:54 PM <huleuxm> yep
New messages
4:56 PM <huleuxm> ok I connected sucessfully and executed the command, I get " --END COMMAND--" then "Connection closed by foreign host."
4:56 PM <huleuxm> and of course i got the db dump before the end command

05/21/12 13:41:47 changed by p_lindheimer

  • priority changed from blocker to major.
  • status changed from closed to reopened.
  • confirmation changed from Unreviewed to Pending.
  • resolution deleted.

We'll leave the ticket open pending the Asterisk fix so we don't lose track of this and in case we end up having to do some sort of workaround on this issue:

https://issues.asterisk.org/jira/browse/ASTERISK-19678

05/22/12 05:57:14 changed by huleuxm

I think i found two problems :

1/ database values with spaces does not seems to be imported but are present in the astdb file in archive.

2/ when running a simple astdb backup i can't restore it. I got this error:

Saving Backup 2...done! Intializing Backup 2 Connecting to remote server... Prossesing received file... Storing backup... Running post-backup hooks... Restoring backup...

Fatal error: Cannot use string offset as an array in /var/www/html/admin/modules/backup/functions.inc/restore.php on line 603

06/13/12 06:52:35 changed by mbrevda

  • attachment writetimeout.diff.patch added.

06/13/12 06:53:24 changed by mbrevda

Attached is a patch that allows a writetimeout to be set for the ami connection. This should be able to eliminate the issue

06/13/12 10:52:38 changed by huleuxm

thanks for it, i'll try it soon

06/18/12 06:26:53 changed by huleuxm

I made the changes but I did them on a running system so I manualy made the changes in files and added the line in database. I can't reboot the server now but I'll do it tonight.

But I think the problem is in the restore part, I made a simple astDB backup and I got my outboundcid in the tgz but none of them when runnin "show database" in asterisk console.

06/18/12 07:12:37 changed by mbrevda

You do not need to restart/reboot anything after applying the patch (just ensure your permission are correct if editing as root: amportal chown). Just run a regular backup, and then have a peek inside to see if the astdb is backed up (you need to unserialize them)

The issue SEEMS like its in a restore as the data isnt being restored. In truth, its not being restored because it was never backed up - and that is the crux of the issue.

06/18/12 07:23:42 changed by huleuxm

Ok then the backup is ok now.

Does the restore part will be implemented? If yes, any idea about when?

Thanks for everything ;)

06/18/12 07:27:34 changed by mbrevda

The restore part has been implemented since day one. There were no changes needed for restore.

06/18/12 07:32:32 changed by huleuxm

I've this error when restoring

Saving Backup 3...done! Intializing Backup 3 Connecting to remote server... Prossesing received file... Storing backup... Running post-backup hooks... Restoring backup...

Fatal error: Cannot use string offset as an array in /var/www/html/admin/modules/backup/functions.inc/restore.php on line 603

06/18/12 08:14:55 changed by mbrevda

Please open a separate ticket for individual issues

06/18/12 11:48:22 changed by mbrevda

(In [14149]) re #5879, #5839 - add bootstrap hook; write writetimeout to mamanger.conf; cosmetics

06/18/12 11:53:21 changed by mbrevda

  • status changed from reopened to closed.
  • resolution set to fixed.

06/19/12 11:23:44 changed by p_lindheimer

(In [14152]) add 2.10.1 upgrade dir, migration for writetimeout re #5839, and remove some advanced settings that are no longer used

07/11/12 17:22:22 changed by p_lindheimer

(In [14253]) Merged revisions 13971-13972,13979,14026,14031,14048-14049,14052,14054,14060,14082,14119,14128,14133-14135,14148-14149,14151-14153,14159,14205,14218 via svnmerge from http://www.freepbx.org/v2/svn/freepbx/branches/2.10

........

r13971 | p_lindheimer | 2012-04-14 10:56:49 -0700 (Sat, 14 Apr 2012) | 1 line

don't make manager creds readonly now that they are auto updated when changed

........

r13972 | p_lindheimer | 2012-04-14 11:43:05 -0700 (Sat, 14 Apr 2012) | 1 line

fixes #5716 and fixes #5763 set reasonable timeouts with wget, port 5060 is still an issue and the server needs to be checked as something has changed there

........

r13979 | p_lindheimer | 2012-04-17 17:12:25 -0700 (Tue, 17 Apr 2012) | 1 line

this is supplied by core now

........

r14026 | p_lindheimer | 2012-04-27 13:18:08 -0700 (Fri, 27 Apr 2012) | 1 line

fixes #5742 conflict with html ID on Advanced Settings page breaks abiliity to change this one setting, will go live with next framework module update

........

r14031 | mbrevda | 2012-04-30 07:58:12 -0700 (Mon, 30 Apr 2012) | 1 line

fixes #5743 by namsepacing ari css stuff

........

r14048 | p_lindheimer | 2012-05-03 07:19:25 -0700 (Thu, 03 May 2012) | 1 line

fixes #5533 harmless warning message by not checking the filesize of the log file the first time if it does not exists yet

........

r14049 | p_lindheimer | 2012-05-03 08:54:56 -0700 (Thu, 03 May 2012) | 1 line

check if dbug file exists before calculatin size to remove otherwise harmless warning message re #5533

........

r14052 | p_lindheimer | 2012-05-04 08:26:35 -0700 (Fri, 04 May 2012) | 1 line

revert r12549 merged in error as well as remove undefined index all re #5692 which may fix issues but needs testing

........

r14054 | p_lindheimer | 2012-05-04 09:12:50 -0700 (Fri, 04 May 2012) | 1 line

don't duplicate this first setting re #5692

........

r14060 | p_lindheimer | 2012-05-07 15:03:50 -0700 (Mon, 07 May 2012) | 1 line

revert accidental checkin of part of r13972 re #5812

........

r14082 | p_lindheimer | 2012-05-18 15:16:54 -0700 (Fri, 18 May 2012) | 1 line

incorrect parsing of REQUEST variable results in streamlined ajax path's not being honored

........

r14119 | mbrevda | 2012-05-30 00:10:38 -0700 (Wed, 30 May 2012) | 1 line

function to recursivly remove a directory

........

r14128 | p_lindheimer | 2012-06-11 08:21:11 -0700 (Mon, 11 Jun 2012) | 1 line

fixes #5874 variable name typo

........

r14133 | p_lindheimer | 2012-06-14 11:22:37 -0700 (Thu, 14 Jun 2012) | 1 line

remove some advanced settings no longer valid

........

r14134 | p_lindheimer | 2012-06-14 12:37:43 -0700 (Thu, 14 Jun 2012) | 1 line

makes spnosor image and associated link configurable as is freepbx image

........

r14135 | p_lindheimer | 2012-06-14 12:39:02 -0700 (Thu, 14 Jun 2012) | 1 line

closes #5833 USEDEVSTATE defaults to true

........

r14148 | p_lindheimer | 2012-06-15 13:19:15 -0700 (Fri, 15 Jun 2012) | 1 line

fixes #5646 reload Asterisk after initial start if using Dynamic Hints to get over Asterisk bug where #exec fails on first startup

........

r14149 | mbrevda | 2012-06-18 08:48:21 -0700 (Mon, 18 Jun 2012) | 1 line

re #5879, #5839 - add bootstrap hook; write writetimeout to mamanger.conf; cosmetics

........

r14151 | mbrevda | 2012-06-19 05:36:10 -0700 (Tue, 19 Jun 2012) | 1 line

syntaxt error

........

r14152 | p_lindheimer | 2012-06-19 08:23:43 -0700 (Tue, 19 Jun 2012) | 1 line

add 2.10.1 upgrade dir, migration for writetimeout re #5839, and remove some advanced settings that are no longer used

........

r14153 | GameGamer?43 | 2012-06-19 15:10:37 -0700 (Tue, 19 Jun 2012) | 1 line

closes #5885 - check recordings in cdr prior to enabling or disabling the delete button

........

r14159 | p_lindheimer | 2012-06-27 16:51:15 -0700 (Wed, 27 Jun 2012) | 1 line

don't take out the description or it doesn't show up in module admin when not online

........

r14205 | p_lindheimer | 2012-06-30 13:11:53 -0700 (Sat, 30 Jun 2012) | 1 line

Creating release 2.10.1

........

r14218 | p_lindheimer | 2012-06-30 13:30:57 -0700 (Sat, 30 Jun 2012) | 1 line

remove some of the security auditing code that got checked in error and not used or ready

........

05/06/13 17:53:22 changed by miken32

FYI this addition of "writetimeout" to manager.conf creates a warning in Asterisk:

[May 6 17:43:01] WARNING[869]: manager.c:1053 authenticate: Invalid writetimeout value at line 11

This is a system upgraded from 2.9; under advanced settings I see "Asterisk Manager Write Timeout" is is set to 5000, but the file shows no value.