Upgrading to 2.8.0.4 gives many problems

After upgrading to 2.8.0.4 (Asterisk 1.4.38) :

Telephony does work but i get lots of problems :

inside asterisk log :

lots of : WARNING[3684] manager.c: read() failed: Bad file descriptor

When cliking the orange bar to reload FreePBX :

[FATAL] Failed to get engine_info retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: ERROR-UNABLE-TO-PARSE

CDR display does not work and give the error :

YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL!

Asterisk Info Panel does not work.

Backups do not works.

I’ve checked the hard disk and Mysql databases. they seem ok.

Any idea to solve this ?

[Mon Dec 27 15:21:27 2010] [error] [client 192.168.1.4] PHP Warning: Unknown: open(/var/lib/php/session/sess_fi3tl02673c7gn344tianhq755, O_RDWR) failed: Permission denied (13) in Unknown on line 0, referer: http://192.168.1.4/admin/config.php
[Mon Dec 27 15:21:27 2010] [error] [client 192.168.1.4] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0, referer: http://192.168.1.4/admin/config.php

and /var/lib/php/session is owned by asterisk. Do you want to move this to /tmp?

This is the content of /var/lib/php/session:

-rw------- 1 asterisk asterisk 653 Dec 9 17:38 sess_0oq0j5ur9kpkjdnlfjt1vifqi6
-rw------- 1 asterisk asterisk 655 Dec 9 20:52 sess_1m52t92chiitnco6lariljqpq0
-rw------- 1 asterisk asterisk 654 Dec 6 14:57 sess_3jhkfd8rdi90ithkqomrqo3lm6
-rw------- 1 asterisk asterisk 481 Dec 10 11:59 sess_55f8hn4fa2hdsf2219hgfdd6d2
-rw------- 1 asterisk asterisk 654 Dec 13 17:29 sess_egv55hsr7e7hc7qjnn64bkhit5
-rw------- 1 asterisk asterisk 654 Dec 13 20:25 sess_gama90471k49p7bteljiuie4r3
-rw------- 1 asterisk asterisk 480 Dec 13 18:14 sess_hhoerpjiq74mjr2mm3b596dlr5
-rw------- 1 asterisk asterisk 600 Dec 2 13:28 sess_mrjiakq1mfi06bgosvts4h2vi7
-rw------- 1 asterisk asterisk 654 Dec 13 12:35 sess_vn64tr17o0gkfld7om5t8s8i81

is this what you want to be rwxrwxrwx?

Ok, finally found it.

/var/lib/php/session changed ownership from root:asterisk to root:apache.

restore it, and everything come back to normal.

Thanks,

Ok,

I found it, /var/lib/php/session ownership was changed from root:asterisk to root:apache.

As soon as I put it back it started to work again.

Thanks,

that would do it.

that isn’t always adequate, there are other places such as /etc/php.d/*.ini where php variables can be set.

I have this inside /etc/php.d/elastix.ini (and no other php.ini file after locating it) :

;Enable greater limits for FreePBX
upload_max_filesize = 20M
memory_limit = 100M

;Elastix changes httpd daemon user to asterisk. Move PHP session dir back to /tmp

session.save_path = “/tmp”

php does not override that setting, but there are multiple places where php.ini settings can be set, I suspect that is the case with you, that it is being overridden by a setting elsewhere.

Try to run updatedb, when that is finished run locate php.ini.
It will list all places where php.ini is located.
If you don’t have updatedb or locate, try to install them with yum install mlocate

I remeber i did this certainly before the problem did appear :

yum install bind-utils

But i’m not sure at all this was the reason of the problem.

After the problem did appear, i’ve updated PHP and Apache, because i thought it was a compatibility problem with latest version of FreePBX.

Updating PHP and Apache did not solve it.

Yes the session directory /var/lib/php/session did had the apache ownership after apache / php update, but anyway and strangely, my /tmp directory is used for session files.

I do not understant why, because inside php.ini /var/lib/php/session is set for session files.

Inside /etc/php.ini i have :

session.save_path = “/var/lib/php/session”

I ask myself if apache would not bypass php.ini, or perhaps there is another php.ini, or FreePBX can overide this setting ?

you definitely want to look elsewhere, as FreePBX doesn’t have anything to do with changing that.

errors with permissions changing related to session directories has traditionally been from yum updates.

The most common one in the past was the session directory changing ownership to apache in the past, when apache was running as user asterisk, creating similar problems…

I think i’ve found the problem.

It seems that apache is now writing session files in the /tmp directory.

This directory was not writable from asterisk user. So i’ve changed permission of tmp to rwxrwxrwx and all was working again.

It is strange that session files come inside /tmp, because inside /etc/php.ini, the session.save_path is defined to /var/lib/php/session.

Something is strange… Perhaps that another php.ini is present elsewhere ?

I would be happy to have feedback from other users about this.

Did you do a “yum update”?
Do you use a distro of some sort?

We do not change apache settings, that must have been done by some other script.

It’s possible this has been changed by another script, but i can’t remember one i run on the machine since the problem did appear after 2.8.0.4 upgrade.

We’ll see if other users have the same problem on Centos 5 (Elastix).