session -> access denied

Bug #327084 reported by Svein Hansen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gemeinschaft (by Amooma)
New
Undecided
Unassigned
Satega
Fix Released
Medium
bernhard
php5 (Debian)
New
Undecided
Unassigned
php5 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

This may be a kohana bug. Occurs now and then.

An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator.

>system/libraries/Session.php [160]:

session_start() [function.session-start]: ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)
Stack Trace
>system/libraries/Session.php [160]:
session_start( )
>system/libraries/Session.php [66]:
Session_Core->create( )
>system/libraries/Session.php [38]:
Session_Core->__construct( )
>application/controllers/satega.php [15]:
Session_Core::instance( )
>application/controllers/musicserver.php [7]:
Satega_Controller->__construct( )
MusicServer_Controller->__construct( )
>system/core/Kohana.php [269]:
ReflectionClass->newInstance( )
Kohana::instance( )
>system/core/Event.php [209]:
call_user_func( Array
(
    [0] => Kohana
    [1] => instance
)
 )
>system/core/Bootstrap.php [55]:
Event::run( system.execute )
>index.php [122]:
require( system/core/Bootstrap.php )

Revision history for this message
bernhard (bernhardredl) wrote :

as i mentioned in the forum. A possible solution is:

sudo chown www-data /var/lib/php5

Revision history for this message
bernhard (bernhardredl) wrote :

maybe we should take care of this in our install script?

Revision history for this message
bernhard (bernhardredl) wrote :

according to :
http://forum.kohanaphp.com/comments.php?DiscussionID=565

Frustratingly, if you do receive this error, you'll only get it once every hundred page loads on average. Which points to the cause of the problem: automatic session garbage collection. In Debian and Ubuntu, /var/lib/php5, where the session data is stored, has permissions of drwx-wx-wt and should only be cleaned by a cron script.

OFFICIAL solution:
To prevent this error, you should switch off garbage collection in session config and let debian/ubuntu cron job clean up the session files.
$config['gc_probability'] = 0;

Changed in satega:
assignee: nobody → bernhardredl
importance: Undecided → Medium
milestone: none → milestone0.1
status: New → Confirmed
Revision history for this message
bernhard (bernhardredl) wrote :

Rev 72 trunk

Changed in satega:
status: Confirmed → Fix Released
Revision history for this message
Philipp Kempgen (philipp-kempgen) wrote :
Revision history for this message
Philipp Kempgen (philipp-kempgen) wrote :

In gemeinschaft-amooma:
session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in htdocs/gui/srv/queuestatus.php on line 112

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

With the default permissions on /var/lib/php5, and the default configs (session.gc_probablity=0), you should not see this error. If an application is generating its own .ini settings, then it will have this issue, and it should be changed to disable gc_probability, and ensure that the cron job is cleaning up after it.

Marking Invalid in php5.

Changed in php5 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.