SOLVED SOLVED: FreePBX Reload not working

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Hi all,

I am running the 1.7.5.5.2 PIAF Silver install with FreePBX 2.6.0.3. I am having a problem, though. Whenever I try to reload changes, I get "Error: Did not receive valid response from server." Now I know this is covered a lot on the FreePBX site, but all of the bug reports were closed b/c of "worksforme". As I watch the CLI, if I have the CLI open and then hit the Continue With Reload button, Asterisk dies but then comes back up. Also, I noticed some status output a little bit ago that mentioned something like Safe Asterisk, but I missed CopyandPasting it.
I also noticed a lot of this.
What do I need to do to fix this?
It was working fine not even an hour ago - I just added an entry for MOH in extensions_custom.conf and changed the MOH category in FreePBX and then went to reload. I have tried rebooting to no avail..
statustofile
Thanks,
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Same thing, Asterisk dies and FreePBX isn't any the wiser.
Aha! I got the strange thing in the SSH window again!
Code:
/usr/sbin/safe_asterisk: line 118: 14731 Killed                  nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} >&/dev/${TTY} < /dev/${TTY}
Asterisk ended with exit status 137
Asterisk exited on signal 9.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Bumpity..bumpity...bump...
I still have yet to fix this. Can't seem to find out whats wrong. Anyone have any ideas?
--
On another, unrelated, note - I was looking at the HTTPD log files and I think these may help:
Code:
[Mon Nov 15 01:19:11 2010] [error] [client 192.168.4.128] PHP Warning:  mysql_result() [<a href='function.mysql-result'>function.mysql-result</a>]: Unable to jump to row 0 on MySQL result index 96 in /var/www/html/admin/modules/customco$
[Mon Nov 15 01:20:34 2010] [error] [client 192.168.4.128] Mon, 15 Nov 2010 01:20:34 -0500 - Unable to connect to manager localhost:5038 (111): Connection refused, referer: http://192.168.4.2/admin/config.php?type=setup&display=index
[Mon Nov 15 01:20:37 2010] [error] [client 192.168.4.128] Mon, 15 Nov 2010 01:20:37 -0500 - Unable to connect to manager localhost:5038 (111): Connection refused, referer: http://192.168.4.2/admin/config.php?type=setup&display=index
[Mon Nov 15 01:21:05 2010] [error] [client 192.168.4.128] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/admin/common/php-asmanager.php on line 194, referer: http://192.168.4.2/admin/config.php?type=set$
[Mon Nov 15 01:11:43 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15
[Mon Nov 15 01:11:46 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:11:49 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:11:51 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:11:53 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:11:54 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:12:42 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:12:51 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:12:51 2010] [error] [client 192.168.4.128] PHP Notice:  Undefined index:  product_selected in /var/www/html/admin/modules/endpointman/templates/compiled/advanced_settings_poce_1282368214.php on line 27, referer: http://19$
[Mon Nov 15 01:12:54 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:12:56 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:10 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:12 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:13 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:26 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:28 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:31 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:36 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:39 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:47 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:13:50 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:14:04 2010] [error] [client 192.168.4.128] PHP Notice:  Use of undefined constant phpversion - assumed 'phpversion' in /var/www/html/admin/modules/endpointman/config.php on line 15, referer: http://192.168.4.2/admin/confi$
[Mon Nov 15 01:20:34 2010] [error] [client 192.168.4.128] Mon, 15 Nov 2010 01:20:34 -0500 - Unable to connect to manager localhost:5038 (111): Connection refused, referer: http://192.168.4.2/admin/config.php?type=setup&display=index
[Mon Nov 15 01:20:37 2010] [error] [client 192.168.4.128] Mon, 15 Nov 2010 01:20:37 -0500 - Unable to connect to manager localhost:5038 (111): Connection refused, referer: http://192.168.4.2/admin/config.php?type=setup&display=index
[Sun Nov 14 17:30:09 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: PHP_SELF in /var/www/html/maint/configedit/phpconfig.php on line 186, referer: http://192.168.4.2/admin/config.php?type=tool&display=configedit
[Sun Nov 14 17:30:09 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: PHP_SELF in /var/www/html/maint/configedit/phpconfig.php on line 186, referer: http://192.168.4.2/admin/config.php?type=tool&display=configedit
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: PHP_SELF in /var/www/html/maint/configedit/cls_phpconfig.php on line 99, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: PHP_SELF in /var/www/html/maint/configedit/cls_phpconfig.php on line 99, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: PHP_SELF in /var/www/html/maint/configedit/cls_phpconfig.php on line 99, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: PHP_SELF in /var/www/html/maint/configedit/cls_phpconfig.php on line 99, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: linenumber in /var/www/html/maint/configedit/cls_phpconfig.php on line 167, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: linenumber in /var/www/html/maint/configedit/cls_phpconfig.php on line 177, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Sun Nov 14 17:30:12 2010] [error] [client 192.168.4.126] PHP Notice:  Undefined variable: linenumber in /var/www/html/maint/configedit/cls_phpconfig.php on line 182, referer: http://192.168.4.2/maint/configedit/phpconfig.php
[Mon Nov 15 01:21:05 2010] [error] [client 192.168.4.128] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/admin/common/php-asmanager.php on line 194, referer: http://192.168.4.2/admin/config.php?type=set$
[
Yes, I do know they are not in order - I was CandPing through the log.
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
Check the following files for matching passwords for the mysql admin:

/etc/amportal.conf (AMPMGRUSER=admin/AMPMGRPASS)

and /etc/asterisk/manager.conf (admin/secret)
 

VaHam

Member
Joined
Feb 29, 2008
Messages
74
Reaction score
9
Check the following files for matching passwords for the mysql admin:

/etc/amportal.conf (AMPMGRUSER=admin/AMPMGRPASS)

and /etc/asterisk/manager.conf (admin/secret)

Also if your using remote access to modify the following in /etc/asterisk/manager.conf

;permit=127.0.0.1/255.255.255.0 (probably is this)
permit=192.168.0.0/255.255.255.0 (set to whatever is appropriate for your lan)
 

ronaldgibson

New Member
Joined
Apr 14, 2008
Messages
16
Reaction score
0
I'm running 1.7.5.5.3 Asterisk 2.4, FreePBX 2.6.0.3 & Zaptel A400P card. On my installs I had to "make install" Zaptel again because the drivers did not load, and missing.
Mine halts when I make a couple of changes within a few minutes of each other. Sometimes it is two changes, and other times three changes that halt the system. I was able to SSH and saw that fail2ban was at 84% once in a while. I disabled free2ban and still the same. Thought it might be a hard drive, swapped the drive and made a new install.
I have to reset the computer each time. The saving configurations banner comes up, click on that and get a server error in the dialog box. I close and re-open the browser and now it's ready.
It's stuck now so, next time I'll give it a few minutes. It takes a while to reload because I have three IVR's that have 125+ entries. My main IVR has 10, second has 125, third has 137, fourth has 8, fifth has 8 and the sixth IVR has 164. These point to recordings for playback. 360-215-1566 & 206-279-2791. Lots of work went into this.

UPDATE 11/19/2010:
It's best if I do all of my changes first, then apply the changes. I also had CPU#0 stuck for 10s! on the monitor.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Check the following files for matching passwords for the mysql admin:

/etc/amportal.conf (AMPMGRUSER=admin/AMPMGRPASS)

and /etc/asterisk/manager.conf (admin/secret)

Both match up - and are defaults.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
So what I have now learned is that this is an ASTERISK issue, not FreePBX. If I issue a "reload" at the CLI, Asterisk restarts. Normally when I do that, it just does everything like processing changes etc without actually restarting Asterisk. Any other ideas?
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Tried to do a manual amportal restart a minute ago and got this never-ending (until I did an AMPORTAL KILL) loop:
Code:
root@piaf-home:~ $ amportal restart



STOPPING ASTERISK


Asterisk Stopped

STOPPING FOP SERVER
SETTING FILE PERMISSIONS
Permissions OK

STARTING ASTERISK
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
Asterisk Started

STARTING FOP SERVER

-----------------------------------------------------
The FOP's server (op_server.pl) could not start!
Please correct this problem
-----------------------------------------------------
root@piaf-home:~ $ mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.

root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 

root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 

root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ 
root@piaf-home:~ $ mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.

root@piaf-home:~ $ 

root@piaf-home:~ $ root@piaf-home:~ $ 
root@piaf-home:~ $ mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
asterisk
Asterisk already running on /var/run/asterisk/asterisk.ctl.  Use 'asterisk -r' to connect.
'root@piaf-home:~ $ 'mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
I really don't wanna reinstall, but I will if I have to. Any ideas? anyone?

--
More logs..
Code:
root@piaf-home:/var/log/asterisk $ amportal restart



STOPPING ASTERISK


Asterisk Stopped

STOPPING FOP SERVER
[COLOR=Red]/usr/sbin/safe_asterisk: line 118: 17006 Killed                  nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} >&/dev/${TTY} < /dev/${TTY}[/COLOR]
Asterisk ended with exit status 137
Asterisk exited on signal 9.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
SETTING FILE PERMISSIONS
Permissions OK

STARTING ASTERISK
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.

http://lists.digium.com/pipermail/asterisk-bugs/2009-October/060641.html
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
You have to kill safe_asterisk. I've often wondered about the value of it. It's a script with a purpose is to restart Asterisk if it detects that Asterisk has stopped running. I've run into a similar situation and found that killing safe_asterisk helped. From the linux command prompt:

ps -ax

Find the pid of safe-asterisk

kill -9 <pid>
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
I have had a race condition occur using "amportal restart". I've since only use "amportal stop" then "amportal start" instead.

In /etc/asterisk/manager_custom.conf, do you have the following?

[phpconfig]
secret = php[onfig
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

[phpagi]
secret = phpagi
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
In /etc/asterisk/manager.conf, this is what I have:

[admin]
secret = amp111
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

In /etc/amportal.conf:

# AMPDBHOST: the host to connect to the database named 'asterisk'
AMPDBHOST=localhost

# AMPDBUSER: the user to connect to the database named 'asterisk'
# AMPDBUSER=asteriskuser

# AMPDBENGINE: the type of database to use
AMPDBENGINE=mysql

# AMPDBPASS: the password for AMPDBUSER
# AMPDBPASS=amp109

# AMPENGINE: the telephony backend engine to use
AMPENGINE=asterisk

# AMPMGRUSER: the user to access the Asterisk manager interface
AMPMGRUSER=admin

# AMPMGRPASS: the password for AMPMGRUSER
AMPMGRPASS=amp111
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Same here - although what I have also discovered is that this is an asterisk issue, rather than freepbx. If I do amportal restart, sometimes I get the error, sometimes not. I always get the error from Freepbx. If I type "reload" at the asterisk CLI, it dies and comes back up.
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
. If I do amportal restart, sometimes I get the error, sometimes not.

That's why I do an "amportal stop" then wait and then do an "amportal start". The restart seems to stop and then tries to start asterisk before all the programs have stopped.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Aah. So what exactly does FreePBX do when you do a "Apply Configuration changes"?
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
So what exactly does FreePBX do when you do a "Apply Configuration changes"?

Rewrites all the configuration files for asterisk from its database, and issues an asterisk reload.

Joe
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
And I'm pretty sure that it's the reload that is the problem.
See this for a more visual interpretation.
 

Members online

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
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