No GUI, No Voice mail, database corrupt

Hi, I have a recent install (3 months ago) of freepbx. Installed using full ISO ver 1.811.210.57 64bit.
It is installed on a vmware box running vmware ESXi5.0.0,469512

All was working fine until two weeks ago when it all stopped working (possibly from log files filling up hard drive?) Got the system working again after deleting logfiles, but voicemail is not accessible and when trying to get to the web front end, we get this fatal error, and no gui:

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/index.php:18 include_once()
[0]: /etc/freepbx.conf

I’m totally new to freepbx, can someone please help. Or at least point me in the right direction

Thanks so much,
Mark

Production system, response urgently requested.
Thanks,
Howard

Can you check that MySQL is actually running (service mysqld status)? If the database has become corrupted you can check this using myisamchk. The asterisk DB is kept in /var/lib/mysql/asterisk (I think!). If you go to this folder and do:

myisamchk *.MYI

See if there are any errors. If not the DB is OK.

If mysqld is not running try to start it: service mysqld start

If this fails check why. There should be something in /var/log/messages.

Lee

Have you done a cold reboot of the server? Had this happen recently. The centos file system had gone into read only mode because of file corruption. An fsck may fix it, but unfortunately mine was due to a bad hard drive and we had to rebuild the system.

Just for those few who want to learn to be wise virgins, w5waf et al.

Next time and before you need it post-mortem perhaps enableing the bin log data in my.cnf will save your ass next time, you will be able to rebuild your tables to the point in time before you screwed them up (full disk,but you need to pereempivly check for that condition), hd controller glicth, sunspot activity, random piracy or other acts of the gods of the internet, however you managed to do break it.

start with adding something like:-

log-bin = /var/lib/mysql/bin.log

then massage your deployment to suit the binlog stuff

finish you homework, which might well include (ubiq/google mysql recovery) and thus sites like

http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

Good luck, but seriously you guys, please read the ducumentation of the software that you personally choose to install, came with :slight_smile:

Such basic steps WILL, I hope, behoove you . . . .

Dicko

Caveate Implementor

Hi w5waf - Yes, cold reboot was done. no change

leemason - yes, “pid 29524 is running…”

#MYISAMCHK *.MYI Yields these results (abbreviated slightly).

Checking MyISAM file: timegroups_groups.MYI
Data records: 0 Deleted blocks: 0

  • check file-size
  • check record delete-chain
  • check key delete-chain
  • check index reference
  • check data record references index: 1
  • check data record references index: 2
  • check record links

Checking MyISAM file: trunk_dialpatterns.MYI
Data records: 1 Deleted blocks: 0

  • check data record references index: 1

Checking MyISAM file: trunks.MYI
Data records: 9 Deleted blocks: 0

  • check data record references index: 1

Checking MyISAM file: users.MYI
Data records: 14 Deleted blocks: 0

  • check record links

So it looks like the DB is in ok shape? I’m not sure there.

dicko - yes, I am trying to learn all the systems here; but i inherited it when the staff was cut. I do get great help from the previous SE here, but he’s busy too. And I will make those changes
Thanks,

You could be overcomplicating this.

Make sure you have the DB credentials in /etc/asterisk/freepbx.conf match mysql.

I would just look at the credentials in that file and reset them in mysql like this:

Mysql (press enter)

Then enter these two commands, at the end of the line hit the semicolon not return.

GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY ‘dbpassword’

GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY ‘dbpassword’

I forgot if it is exit or quit to get out, remember to use the semicolon not return.

Then do an ‘amportal restart’

With any luck you will be all set.

I do not know of a FreePBX distro that turns that on, (perhaps not surprising as mostly they are derivitative) nobody knows the parentage anymore, (probably asterisk@home 0.1 or something)), most have obvoiusly not suffered as we have. This not actually a blessing ,sooner or later it can happen to any of us, I suggest you all metephoriclly trim your wicks :slight_smile:

It is but one line that has saved my more than once since I RTFM all those years ago

:slight_smile:

Huh?

Very simply skyking . . .

If in my.cnf if you have a line that states:-

log-bin = /any/place/in/the/world/that/you/can/write/to

then you can recover from a catastrophic FU, from that very same place,and from the instant before something FU’ed

If you don’t have that, then you will have to be restore the mysql tables from your last known good backup, be that mondorestore, FreePBX backup, whatever, I will bet you dollars to donuts that will not be timely for 99% of our beloved users if at all possible.

the binary log will just absolutely be more up to date if actually set, That is it’s purpose, no?

for example reference w5waf’s need to reintall everything, and he is not the dullest tool in this shed, so to you, playfully, I will respond “Duh” :wink:

dicko