Bug 1253248 - php-55-centos7 docker image has a wrong session.save_path value
php-55-centos7 docker image has a wrong session.save_path value
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Image (Show other bugs)
3.x
Unspecified Unspecified
unspecified Severity medium
: ---
: 3.x
Assigned To: Ben Parees
Wenjing Zheng
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-13 06:23 EDT by Evgheni Dereveanchin
Modified: 2015-09-08 16:14 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-08 16:14:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Evgheni Dereveanchin 2015-08-13 06:23:23 EDT
Description of problem:

the value of session.save_path in /opt/rh/httpd24/root/etc/httpd/conf.d/php55-php.conf of the php-55-centos7 image is set to a value that is only writable by root and apache user. This will work with a standard docker installation but not when OSEv3 pods are used in non privileged mode. 


Version-Release number of selected component (if applicable):
https://hub.docker.com/r/openshift/php-55-centos7/

How reproducible:
always

Steps to Reproduce:
1. create a simpe test app using the session_start() PHP function:
 $ oc new-app https://github.com/derdanu/ose-php-session.git
2. build the app
 $ oc start-build ose-php-session
3. expose the service externally
 $ oc expose svc ose-php-session --hostname=ose-php-session.demo.lan
4. Open the URL in a browser


Actual results:

Warning: session_start(): open(/opt/rh/php55/root/var/lib/php/session/sess_1234567890abcdefg123456789, O_RDWR) failed: Permission denied (13) in /opt/openshift/src/index.php on line 3

Warning: Unknown: open(/opt/rh/php55/root/var/lib/php/session/sess_1234567890abcdefg123456789, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/opt/rh/php55/root/var/lib/php/session) in Unknown on line 0

Expected results:

session info is saved and no warnings are displayed

Additional info:

Please check https://github.com/openshift/sti-php/issues/51 with accompanying pull requests
Comment 2 Evgheni Dereveanchin 2015-08-13 08:15:45 EDT
I want to note that both php-55-rhel7 and php-55-centos7 images seem to be affected by this issue.
Comment 3 Ben Parees 2015-08-18 09:46:18 EDT
fix has been merged here:
https://github.com/openshift/sti-php/pull/53
Comment 4 Wenjing Zheng 2015-08-19 02:39:28 EDT
No such error for php-55-centos7 image, but below errors appears when test with latest php-55-rhel7 image with image id 0ed1e1484110:
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: session_start(): open(/tmp/sessions/sess_nqd4qbblgit9k7trbrmldg9le1, O_RDWR) failed: Permission denied (13) in /opt/app-root/src/index.php on line <i>3</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0042</td><td bgcolor='#eeeeec' align='right'>238032</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/opt/app-root/src/index.php' bgcolor='#eeeeec'>../index.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0043</td><td bgcolor='#eeeeec' align='right'>238080</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.session-start' target='_new'>session_start</a>
(  )</td><td title='/opt/app-root/src/index.php' bgcolor='#eeeeec'>../index.php<b>:</b>3</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: Unknown: open(/tmp/sessions/sess_nqd4qbblgit9k7trbrmldg9le1, O_RDWR) failed: Permission denied (13) in Unknown on line <i>0</i></th></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp/sessions) in Unknown on line <i>0</i></th></tr>
</table></font>
Comment 5 Ben Parees 2015-08-19 11:36:03 EDT
fix is here:
https://github.com/openshift/sti-php/pull/54
Comment 6 Wenjing Zheng 2015-08-20 04:10:43 EDT
Verified on latest php-55-rhel7 with image id 32a4c60d1dcc.

Note You need to log in before you can comment on or make changes to this bug.