Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-10-07 22:03:11

mikewren
Member
Registered: 2016-09-09
Posts: 13

Errror: session_start(): open(./backlight/framework/../data/sessions/

I've found Backlight to be wonderfully portable, rsyncing the web path between a staging and production environment was completely painless until now.

I have encountered a hiccup recently when attempting to implement on a server stack with Nginx on CentOS; below is the error message the browser spits out:

session_start(): open(./backlight/framework/../data/sessions/sess_bc0o36kfrehq8bpgsaet32j7k3, O_RDWR) failed: Permission denied (13)|#0 [internal function]: ErrorHandler::handleError(2, 'session_start()...', '/usr/share/ngin...', 74, Array) #1 /usr/share/nginx/html/backlight/framework/helpers/AuthHelper.php(74): session_start() #2 /usr/share/nginx/html/backlight/framework/init.php(120): AuthHelper::handleSession() #3 /usr/share/nginx/html/index.php(19): require_once('/usr/share/ngin...') #4 {main}|URL: /index.phpUnknown: open(./backlight/framework/../data/sessions/sess_bc0o36kfrehq8bpgsaet32j7k3, O_RDWR) failed: No such file or directory (2)|Unknown|0

I've tried changing permissions (777) to no avail - are there any other steps I should take,  can't find a lot of guidance in the forums re: Nginx as a http daemon for Backlight.  I've tried with Apache on this CentOS VM as well, same result.

Thanks for any help or hints, I'm kind of out of ideas.

Offline

#2 2016-10-07 22:17:07

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

Hi Mike, bear in mind that we only support Nginx on a best-effort basis...

Have you tried 755 on data and data/sessions?

Backlight saves sessions under backlight/data/sessions primarily because we encountered many support issues with broken configurations on hosts when attempting to save to the default location.  As a temporary fix, the location can be changed back to the default by disabling the ini_set('session.save_path') line in backlight/framework/helpers/AuthHelper.php.  to do so, edit that line (line 65) and add // at the start so that it looks like:

//ini_set('session.save_path', CORE_DATA_DIR.'/sessions');

Offline

#3 2016-10-08 11:46:33

mikewren
Member
Registered: 2016-09-09
Posts: 13

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

Thanks for the suggestions, Ben! I validated the permissions are correct (tried both 755 and 777) on data and data/sessions and still no dice, the error persisted.

I disabled Nginx and installed Apache on the same CentOS VM again to eliminate the server daemon as a possible source of the error, and same error was displayed even with Apache.

One of our sysadmins suggested SElinux could be the cause - SElinux is enabled by default on RHEL distros like CentOS. Once SElinux was disabled and the VM rebooted, Backlight functions as expected, no errors.

If there's any way to catch this condition (SElinux) and produce some more useful debug/error reporting it might save you on support queries as Backlight continues to move into the enterprise/commercial market.

Also, I didn't see php-xml on the list of Backlight dependencies; searching the forums for "php-xml" returns no results. While attempting to install on my CentOS VM I received a (different than above) non-specific error message telling me to contact support.  I was able to trace it back to the lack of php-xml package in my environment.  Once the php-xml package was downloaded and installed, all is perfect.

Thanks again for wonderfully useful product and super quick support!

Offline

#4 2016-10-08 11:57:44

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

Hi Mike, I'm glad that you got it going, and thanks for the kind words! We try to cater to as many environments as possible, but we really can't add checks for esoteric environments.  We make the assumption that if you're hosting on your own custom environment that you know what you're doing and will take the necessary steps to set it up as needed.
On SELlinux, a quick search suggests there isn't a reliable way of detecting that it is installed via PHP.  I'm not keen on attempting to run shell_exec within Backlight.  I'll look to see whether we can enable a flag under env.php that can be used for this purpose.
I would be interested to know whether SElinux causes other problems beyond AuthHelper.  To test this, you'd need to re-enable SElinux and comment-out the ini_set line mentioned above.

Offline

#5 2016-10-15 03:58:55

mikewren
Member
Registered: 2016-09-09
Posts: 13

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

Ben wrote:

we really can't add checks for esoteric environments

I understand - but even just a quick note/caveat in the documentation or installation notes about a default config CentOS LAMP stack not working without disabling SElinux would have saved me hours of troubleshooting.

I don't have direct control over my CentOS VM, can't easily turn it back on without getting other folks involved.  Next time another VM is spun up, I'll check this out.

Offline

#6 2016-10-15 07:04:17

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

This reply is mostly redundant, see reply further down

-----

Hi Mike, I can't possibly be aware of all environments in order to add notes like that, prior to customers like yourself encountering issues. Noted on CentOS and SELinux in general. 

Have you found any details about why SELinux denied writing to backlight/data/sessions?  I wonder if it was just a matter of changing the permissions or ownership of that directory rather than disabling SELinux entirely.

Did you get past the sessions directory error?  Were you able to publish to that instance, or was the sessions error a showstopper?  If you were able to publish then that implies the permissions error was limited to data/sessions.  Otherwise, it's likely that SELinux would have caused permissions errors on writing files to all directories under backlight/data, including databases, and also files under galleries/.

Offline

#7 2016-10-15 07:08:30

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

I'll install CentOS to test out SELinux. Which version of CentOS are you using?

Offline

#8 2016-10-15 12:20:07

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

Hi Mike, I have installed Backlight on a minimal CentOS 7 with SELinux enabled.

To make the directories writeable, run this command on each of the data and galleries directories (changing the path as needed):

chcon -R -t httpd_sys_rw_content_t /var/www/html/backlight/data/

This needs to be performed after Backlight has been uploaded, and needs to be performed again if you delete and re-upload the respective directories.

Beyond that, the normal permissions need to be set.  Either of these two approaches works in my testing:

chmod 777 /var/www/html/backlight/data

or

chmod 775 /var/www/html/backlight/data
chgrp -R apache /var/www/html/backlight/data

Since this was a minimal CentOS install, I needed to run the following to get Apache and the required modules installed:

sudo yum install httpd php php-pdo php-xml

Offline

#9 2016-10-15 12:36:06

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Errror: session_start(): open(./backlight/framework/../data/sessions/

Offline

Board footer

Powered by FluxBB