System Migration - strange cache and log errors

Hope someone can help (still waiting on support pack to come through).


i migrated (backup/restore script) our dev matrix onto our new prod server. seems to have migrated okay except now im getting permission denied errors for the cache dir and data/private/log/ dir.


    Warning: fopen(/usr/local/web/mysource_matrix/data/private/logs/error.log) [function.fopen]: failed to open stream: Permission denied in /usr/local/web/mysource_matrix/core/include/general.inc on line 1057
    
    Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/web/mysource_matrix/core/include/general.inc on line 1058
    
    Warning: Unable to Write to log file /usr/local/web/mysource_matrix/data/private/logs/error.log [SYS0051] in /usr/local/web/mysource_matrix/core/include/locale_manager.inc on line 504


now i know both cache and data dirs are owned by apache (apache.apache), they have the right permissions to be able to write but im getting issues on the error.log file and the cache dir.

any thoughts from matrix gurus? the filepath and subdomains are setup exactly as our dev server. im at a lost whether its a matrix issue or some wierd php/apache issue.

PS - if i add a /_nocache to any page it renders fine so i know that the DB is okay, the data dir is okay and at least the application is able to deliver pages.

There are a few things you need to do when moving a system, one of which is truncating the SQ_CACHE table (ie. clearing the Matrix cache). Apart from that, try a few of the obvious things:

  • does apache run as the apache user on the new system?
  • do the specific files the error is happening on have the correct permissions?



    I wouldn't think you have to use system_move_update.php because as you've said, Matrix is installed in the same location. Unless there is some sort of symlinking involved?

[quote]Hope someone can help (still waiting on support pack to come through).


i migrated (backup/restore script) our dev matrix onto our new prod server. seems to have migrated okay except now im getting permission denied errors for the cache dir and data/private/log/ dir.


    Warning: fopen(/usr/local/web/mysource_matrix/data/private/logs/error.log) [function.fopen]: failed to open stream: Permission denied in /usr/local/web/mysource_matrix/core/include/general.inc on line 1057
    
    Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/web/mysource_matrix/core/include/general.inc on line 1058
    
    Warning: Unable to Write to log file /usr/local/web/mysource_matrix/data/private/logs/error.log [SYS0051] in /usr/local/web/mysource_matrix/core/include/locale_manager.inc on line 504


now i know both cache and data dirs are owned by apache (apache.apache), they have the right permissions to be able to write but im getting issues on the error.log file and the cache dir.

any thoughts from matrix gurus? the filepath and subdomains are setup exactly as our dev server. im at a lost whether its a matrix issue or some wierd php/apache issue.

PS - if i add a /_nocache to any page it renders fine so i know that the DB is okay, the data dir is okay and at least the application is able to deliver pages.[/quote]

recheck the permissions on the log file /usr/local/web/mysource_matrix/data/private/logs/error.log - as it says it cant write to it. Although the dirs might be owned correctly, did you do a recursive chown/chmod??

trust me permissions was the first thing i tried (will try again tomorrow). would i need to truncate the table if i used the backup/restore scripts? i thought they would give me a replicate of my dev install. ill try truncating but its got me and our tame seasoned unix admin stumped.


one concern, i tried running step 2, 3 compile locate just in case it solved the problem - i noticed it wrote to the error.log but this was using php-cli not apache php. and if i put /_nocache on any page it displayed fine. that tells me the system is able to render pages. of course the login throws same errors.



if i cant get anywhere im back to a fresh install to see if it can access that log file.



cheers

There are two problems: first, Matrix is experiencing an error. Second, it can't write that error to the log.


I'm guessing the first error is because of the cache. I believe you do normally need to clear the cache table when moving systems.

still trying to isolate my problem - so far i have ruled out a migration issue. i did a clean install using gpl version and same problem with permission denied on cache and log directories.


must be a red hat / apache / php / postgres setup issue. as i mentioned cli php can access/write to the log.



i just noticed we were using php 5.2.5 on our dev server but with red hat we followed the matrix website and went with 5.1.6 (recommended for red hat systems) - anyone know if this could/may cause our problem?

It's a bit of a long shot, but you're not running suexec are you? It's enabled on some RedHat systems, and could cause a permissions problem if not configured correctly.

can you post an "ls -la" of your log files directory here?


We use redhat, and you have to get the file permissions correct in addition to the user and group owners being set.

seems a gold star belongs to daniel - removed the suexec module and with a few minor changes it looks like permission problems have disappeared. thanks for all the suggestions folks.


spoke too soon - session issues fixed - log permission issues still broken :frowning:

nailed it - turns out we had selinux causing the problem - by default it prevents writing to log files (and probably cache dir) it they are outside the standard web directory (/var/www/). hope this helps someone else and saves them two days of scratching heads!