TUTORIAL Restarted machine now getting DB error

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
I have a new box,that I restarted, now I cant connect. When I try to go to freepbx administration, I get the error. Everything was wqorking perfectly before the restart:
Code:
FATAL ERROR
 
DB Error: connect failed
 
Trace Back
 
/var/www/html/admin/libraries/db_connect.php:63 die_freepbx()
  [0]: DB Error: connect failed
 
/var/www/html/admin/bootstrap.php:98 require_once()
  [0]: /var/www/html/admin/libraries/db_connect.php
 
/etc/freepbx.conf:9 require_once()
  [0]: /var/www/html/admin/bootstrap.php
 
/var/www/html/admin/config.php:109 include_once()
  [0]: /etc/freepbx.conf
Status shows mysql and asterisk offline. I am running PIAF 2.0.6.4 and ipbx 11.7

When I do amportal start I get the following error:
Code:
/usr/local/sbin/amportal: line 46: [FATAL]: command not found
 
/var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in '/etc/asterisk' is set to  but the directory
does not exists. Attempting to create it with: 'mkdir -p '
 
mkdir: missing operand
Try `mkdir --help' for more information.
**** ERROR: COULD NOT CREATE  ****
Attempt to execute 'mkdir -p ' failed with an exit code of 1
You must create this directory and the try again.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,221
You might want to use phpMyAdmin to rebuild all of the asterisk database tables. Sounds like something got corrupted either from a faulty shutdown or perhaps a disk drive that's about to go south.
 

Newtham

New Member
Joined
Dec 26, 2013
Messages
2
Reaction score
0
I had almost the same problem, on the same day, as ghurty. I can load the initial PBX in a Flash web panel from my Asterisk box, but when I click on the FreePBX Administration button, I get this screen (attached). After poking around, I found that my hard drive is completely full, which is causing MySQL to fail. I am not sure why the hard drive filled up. It is over 100GB, and we don't use the system heavily, and always erase voicemails, etc. I guess a database filled up with junk(?). The hard drive seems to be working OK, but I'm not 100% sure of it.

Since I can't access the FreePBX Admin area, I can't run phpMyAdmin though it.

I had a friend set this system up for my business, and, while I can follow a lot of what is going on, I am no expert– and my friend has moved away. Does anyone have any guesses as to why this happened, and how I can keep it from happening again? Also, how do I fix it? My thought was just to restore everything from my backup, but is there an easier way? Can I access phpMyAdmin (or some other useful tool) from the command line?

Sorry for the newbie question, but I'm in a tight spot since this is for our business. Right now I can only make and take calls, but no new voicemails, etc. The system is basically stuck in a static position, with an old outgoing message.

Thanks for any advice!!!

Robert
 

Attachments

  • Screen shot 2013-12-28 at 7.34.18 PM.png
    Screen shot 2013-12-28 at 7.34.18 PM.png
    66.8 KB · Views: 14

Newtham

New Member
Joined
Dec 26, 2013
Messages
2
Reaction score
0
OK, I got it.

My mondo backups were the problem, apparently. I had been backing up to a USB thumb drive, per this document:
http://pbxinaflash.org/docs/175x/diskbackup.pdf
(Yes, I know it's old, but it works.) Actually my friend set it up, but it looks like he followed these steps.
However, the USB drive seemed to caused the PBX to hang on reboot, so I had removed it from the USB port. This caused the mondo backups to be stored in the /backup folder, and not be erased like normal.

I erased the backup ISOs in the /backup folder, as well as in the /mnt/usbmondo folder, and this cleared up a *lot* of room on the hard drive, which allowed MySQL to run, and therefore everything else.

I'm working on altering the backup scheme so this hopefully won't happen again. I'm going to try to change the boot order in BIOS to stop the hanging problem. If that doesn't work, I guess I'll probably just turn off the automatic backups and backup manually when needed.

Helpful threads:
http://pbxinaflash.com/community/in...full-how-and-where-to-delete-temp-files.9993/
http://pbxinaflash.com/community/index.php?threads/db-error-connect-failed.7628/
 

cj6814

New Member
Joined
Oct 27, 2008
Messages
12
Reaction score
0
I have a new box,that I restarted, now I cant connect. When I try to go to freepbx administration, I get the error. Everything was wqorking perfectly before the restart:
Code:
FATAL ERROR
 
DB Error: connect failed
 
Trace Back
 
/var/www/html/admin/libraries/db_connect.php:63 die_freepbx()
  [0]: DB Error: connect failed
 
/var/www/html/admin/bootstrap.php:98 require_once()
  [0]: /var/www/html/admin/libraries/db_connect.php
 
/etc/freepbx.conf:9 require_once()
  [0]: /var/www/html/admin/bootstrap.php
 
/var/www/html/admin/config.php:109 include_once()
  [0]: /etc/freepbx.conf
Status shows mysql and asterisk offline. I am running PIAF 2.0.6.4 and ipbx 11.7

When I do amportal start I get the following error:
Code:
/usr/local/sbin/amportal: line 46: [FATAL]: command not found
 
/var/lib/asterisk/bin/freepbx_engine: line 98: [FATAL]: command not found
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in '/etc/asterisk' is set to  but the directory
does not exists. Attempting to create it with: 'mkdir -p '
 
mkdir: missing operand
Try `mkdir --help' for more information.
**** ERROR: COULD NOT CREATE  ****
Attempt to execute 'mkdir -p ' failed with an exit code of 1
You must create this directory and the try again.



Ghurty,

Did you fix this? I have the exact problem and would love to know what you did.

Thanks,
 

Members online

No members online now.

Forum statistics

Threads
25,812
Messages
167,763
Members
19,241
Latest member
bellabos
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top