Sessions directories missing after upgrade to 16.10 and php 7.1 on Ubuntu 16.04 LTS

Bug #1670637 reported by Cristiano Cumer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

Hello,

I updated my mahara installation to 16.10. At the same time I did an upgrade to from Ubuntu 14.04 to 16.04 and to php 7.1.

Suddenly users where not able to login, I checked the error log and I found this:

2017/03/07 11:01:35 [error] 19414#19414: *100640 FastCGI sent in stderr: "PHP message: [WAR] 72 (auth/session.php:457) session_regenerate_id(): open(/data/maharadata/sessions/8/e/h/sess_8ehlbf3hbll0tjjiatl25d69i7, O_RDWR) failed: No such file or directory (2)

I checked the session store structure and just directories between 0 and f where there. I had to create the whole structure with all subdirectories from 0 to z.

I don't know if the session format comes form php 7.1 or from mahara, anyway the folder structure should be created accordingly to accomodate this format.

Tags: php7.1
summary: - Sessions directories missing after upgrade to 16.10
+ Sessions directories missing after upgrade to 16.10 and php 7.1 on
+ Ubuntu 16.04 LTS
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Cristiano,

Mahara only supports up to PHP 7.0 at this stage.

Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
tags: added: php7.1
Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Cristiano,

According to the PHP manual, http://php.net/manual/en/function.session-id.php

"Depending on the session handler, not all characters are allowed within the session id. For example, the file session handler only allows characters in the range a-z A-Z 0-9 , (comma) and - (minus)!"

So it sounds like we should allow more characters for the session paths.

Looking at http://php.net/manual/en/session.configuration.php#ini.session.sid-length it seems that a few new options were introduced in PHP 7.1

Currently our session bits_per_character is set to handle the option '4'

We will need to expand this so it handles option '5', and '6' as well

Cheers

Robert

Changed in mahara:
milestone: none → 17.10.0
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Robert Lyon (robertl-9)
Changed in mahara:
importance: Medium → High
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/7863

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/7863
Committed: https://git.mahara.org/mahara/mahara/commit/2d5e401bfa4ae8246252a6cef162ab7f49d280ab
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 2d5e401bfa4ae8246252a6cef162ab7f49d280ab
Author: Robert Lyon <email address hidden>
Date: Tue Jul 11 07:42:25 2017 +1200

Bug 1670637: Updating session options for PHP 7.1

behatnotneeded

Change-Id: I589cc42dd543ea4edfa418de8b85b711d3f0dd3e
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
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.