eZ Community » Forums » General » Cannot open log file for writing
expandshrink

Cannot open log file for writing

Cannot open log file for writing

Monday 06 January 2014 10:53:47 pm - 9 replies

I am trying to find out why my upgrade from 4.2 to 4.3 only lets me log in once.
Each second attempt to login tells me:
You are not allowed access (front-end) or:
You do not have permission to access  (back-end).

The debug output says:
Error: eZTemplate:ezhttp
Unknown post variable 'AdminSiteaccessURI'

Error: eZDebug::writeFile
Cannot open log file 'var/log/error.log' for writing
The web server must be allowed to modify the file.
File logging for 'var/log/error.log' is disabled.

A look at 'var/log.error.log' shows me that it IS being written to, but it says:
Couldn't create the log file "var/ezwebin_site/log/storage.log

A look at the permissions on the /log/ dir shows the same permissions as on my live server (4.1.3) , and if I change my ezpublish symbolic link back from Ezpublish 4.3 to 4.2 (which uses the same var) it will work correctly as normal, eg, I can log in and out as I desire.

I am using httpd-2.2.25 and php 5.3.0 on ezpublish 4.3

Edit:
Bizzare. I can't even view the storage.log files in var/ezwebin_site/log without being root.
On my live server I can, and it has exactly the same same owner and permissions......

 

Modified on Tuesday 07 January 2014 12:48:34 am by cousin mosquito

Tuesday 07 January 2014 3:30:09 pm

Is SELinux running?

Wednesday 08 January 2014 12:57:23 am

Quote from Betsy Gamrat :

Is SELinux running?

Yes. SELinux is running. I had to google it : )

We changed some permissions on:
/opt/local/httpd-2.2.25/htdocs/ezpublish-4.1.3/var/log/error.log so that it could be written to.
Permission on this (dev server) -rw-rw-r--  1 cmsadmin daemon     63913 Jan  8 10:49 error.log
Permissions on the live server -rw-rw----   1 cmsadmin cmsadmin     436 Oct 13 17:00 error.log

 

Now I get no errors in my ezwebin_site_admin debug, but I can still only login once. I am denied when I try to login a second time. I seem to have full functionality during my login and the good news is that my gui has appeared in the text editing area at last. Maybe it has finally seen the ezjscore extension ?

 

That was short lived, it appears that running all my cache and ini clearing commands is having no effect when I run them in 4.3.0
I found this out when I accidently ran them in 4.1.3.

 

Now, in order to get a (single) login I need to do a full purge in 4.1.3
If I want to turn my debug off or on, I have to clear the ini's from 4.1.3
Remember my ezpublish symlink points to 4.3.0

 

Now I have lost my editing gui's again (after the 4.1.3 purgings) and also my ezwebin_site_admin editing interface gui. It has no css at all, but I am still getting my one login : ) 4.1 to 4.2 was a breeze compare to this.

 

I am not sure if it relevant but my /var/ is a symlink and it still resides in the structure of 4.1.3.
It has 13 gig in it and I dont have the room to copy it. Should I move it to reside in 4.3.0 ?

Thanks for trying to help Betsy.

Modified on Wednesday 08 January 2014 12:58:15 am by cousin mosquito

Wednesday 08 January 2014 3:18:08 am

Quote from cousin mosquito :
Quote from Betsy Gamrat :

Is SELinux running?

Yes. SELinux is running. I had to google it : )

We changed some permissions on:
/opt/local/httpd-2.2.25/htdocs/ezpublish-4.1.3/var/log/error.log so that it could be written to.
Permission on this (dev server) -rw-rw-r--  1 cmsadmin daemon     63913 Jan  8 10:49 error.log
Permissions on the live server -rw-rw----   1 cmsadmin cmsadmin     436 Oct 13 17:00 error.log

 

Now I get no errors in my ezwebin_site_admin debug, but I can still only login once. I am denied when I try to login a second time. I seem to have full functionality during my login and the good news is that my gui has appeared in the text editing area at last. Maybe it has finally seen the ezjscore extension ?

 

That was short lived, it appears that running all my cache and ini clearing commands is having no effect when I run them in 4.3.0
I found this out when I accidently ran them in 4.1.3.

 

Now, in order to get a (single) login I need to do a full purge in 4.1.3
If I want to turn my debug off or on, I have to clear the ini's from 4.1.3
Remember my ezpublish symlink points to 4.3.0

 

Now I have lost my editing gui's again (after the 4.1.3 purgings) and also my ezwebin_site_admin editing interface gui. It has no css at all, but I am still getting my one login : ) 4.1 to 4.2 was a breeze compare to this.

 

I am not sure if it relevant but my /var/ is a symlink and it still resides in the structure of 4.1.3.
It has 13 gig in it and I dont have the room to copy it. Should I move it to reside in 4.3.0 ?

Thanks for trying to help Betsy.

Ok, I moved the var from 4.1.3 to 4.3.0 (all 13 gigs of it) and now all my cache/ini/template clearing moves work, and I still have no editing interfaces, BUT!!! I can ALSO log in and out at will. Thats got to be some kind of progress.

Note to self. Using a symlink to var is dodgy.

If I can just figure out what is stopping my ezwebin_site_admin gui and editing guis from loading.

Wednesday 08 January 2014 3:12:04 pm

I'm not sure this is the issue, but if I can't see a reason for permission issues when SELinux is running, I reset the default security context and that often resolves the issue:

http://wiki.centos.org/HowTos/SEL...7443e1aad7a1d1c87f6a4dc73a964b38224b

With respect to the symlinks, I'm assuming you had +FollowSymlinks on with Apache.

For local development, I confess I make the user account the owner of the files and set the permissions 777.  In a production environment, with suPHP/userdir access, I think the default privileges work fine.

Good luck!

Wednesday 08 January 2014 8:35:48 pm

Quote from cousin mosquito :

If I can just figure out what is stopping my ezwebin_site_admin gui and editing guis from loading.

Ok, it was ezjscore that was stopping my ezwebin_site_admin interface from loading with "decoration"  (css).

 

I renamed the ezjscore extension to something unintelligible and instantly my gui returned !

 

So my main gui (graphic user interface) is back, but I have no actual editing gui in either the back-end (ezwebin_site_admin) or the front-ends, just a code view of the content with no icons at the top of the editing area.

 

In a normal situation I would clear the user-info cache and it would reappear...

 

What is ezjscore used for? Anyone? Do I actually need it ?

Modified on Wednesday 08 January 2014 9:11:18 pm by cousin mosquito

Wednesday 08 January 2014 9:18:59 pm

Quote from Betsy Gamrat :

I'm not sure this is the issue, but if I can't see a reason for permission issues when SELinux is running, I reset the default security context and that often resolves the issue:

http://wiki.centos.org/HowTos/SEL...7443e1aad7a1d1c87f6a4dc73a964b38224b

With respect to the symlinks, I'm assuming you had +FollowSymlinks on with Apache.

For local development, I confess I make the user account the owner of the files and set the permissions 777.  In a production environment, with suPHP/userdir access, I think the default privileges work fine.

Good luck!

Hi Betsy, yes FollowSymlinks is on in Apache. I did have everything in ezjscore set to 777 for a while and just replaced the whole folder with the out of the box permissions to no avail. As I found out late yesterday, when I renamed it, it fixed many of my problems, except the text editing gui problem. Will get back to log-sifting to see if I can identify why my gui is gone : )

Edit

Here's my log error:
[ Jan 08 2014 21:06:02 ] [131.203.7.218] eZTemplate @ extension/ezoe/design/standard/templates/content/datatype/edit/ezxmltext_ezoe.tpl:43[8]:
Cannot retrieve attribute of a NULL

I am just double checking the vhosts file for apache and there is conflicting info for what the settings are.
The ezoe instruction is different than that given in the 4.2 to 4.3 upgrade stuff.

Modified on Wednesday 08 January 2014 11:14:14 pm by cousin mosquito

Friday 10 January 2014 9:57:56 am

The ezoe extension requires ezjscore - so that's why you don't have an edit gui.

As far as the other problems - it looks like separate unrelated problems to me.

The login problem - if I remember correctly, something was added to the login template (and logic) due to a security fix around that time.  Are you using custom login templates that need to be updated?   Did you also upgrade the ezwebin extension?  Did you upgrade all the settings files?  Migrate the necessary changes?

Permissions not being set correctly on cache files - is the mode incorrect for 'EZP_INI_FILE_PERMISSION' in the config.php file? Otherwise, are you on a BSD machine or some shared hosting that has you in a weird jail or is the mode environmental variable for the cmsadmin user set weird?

What user:group is your web server running as (I assume it's apache)?  Because that's who the cache files should be (and probably are) owned by.

Seeing as how there are a bunch of confusing problems (and if you haven't already done it), maybe it's best  to set up a dummy 4.3 ezwebin installation just to make sure everything is working well on the server side.

 

Tuesday 21 January 2014 4:48:21 am

Quote from Steven E Bailey :

The ezoe extension requires ezjscore - so that's why you don't have an edit gui.

As far as the other problems - it looks like separate unrelated problems to me.

The login problem - if I remember correctly, something was added to the login template (and logic) due to a security fix around that time.  Are you using custom login templates that need to be updated?   Did you also upgrade the ezwebin extension?  Did you upgrade all the settings files?  Migrate the necessary changes?

Permissions not being set correctly on cache files - is the mode incorrect for 'EZP_INI_FILE_PERMISSION' in the config.php file? Otherwise, are you on a BSD machine or some shared hosting that has you in a weird jail or is the mode environmental variable for the cmsadmin user set weird?

What user:group is your web server running as (I assume it's apache)?  Because that's who the cache files should be (and probably are) owned by.

Seeing as how there are a bunch of confusing problems (and if you haven't already done it), maybe it's best  to set up a dummy 4.3 ezwebin installation just to make sure everything is working well on the server side.

 

>> if I remember correctly, something was added to the login template (and logic) due to a security fix around that time.
 >> Are you using custom login templates that need to be updated?   Did you also upgrade the ezwebin extension? 
>> Did you upgrade all the settings files?  Migrate the necessary changes?

 

I did find a small change to the login.tpl, but changing it back had no obvious effect other than to stop the reported error log.
I did update ezwebin and do all the other changes as per the the instructions.

 

I am concentrating on the latest error. Maybe its a DB thing. This appears to be what is stopping me from doing consecutive logins.

 

Error: eZDBFileHandlerMysqlBackend::_fetch
The size of the fetched data '5349' does not match the expected size '5080' for the file 'var/ezwebin_site/cache/user-info/1/4/user-14.cache.php', aborting fetch.

 

When I compare these two files there is a bit of difference at the end of the tmp file referring to ezoe, the tmp version is 18 lines longer as the other file has no reference to ezoe in it.

user-14.cache.php.generating vs
user-14.cache7730tmp.php

Thanks Steven for your help so far. It has been very useful.

Edit.
>> What user:group is your web server running as
The webserver is running as what ever it runs at for the working instance of 4.1.3
All my installs are parallel, and were using the same var until I had problems with it not clearing properly.

Modified on Tuesday 21 January 2014 5:02:12 am by cousin mosquito

Saturday 05 April 2014 11:34:03 am

The reply has been removed because of violation of forum rules.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from