FrancisChung Posted May 25, 2017 Posted May 25, 2017 Hi PW Community, I have a problem where a page is loading up fine on my local dev machine + 1 of the test sites, but not on another test site. They have identical PW (2.8.35?) and codebase installed. The 2 sites are hosted on the same hosting provider, as well as our other sites. 1) Error Logs. There is nothing particularly strange logged on the PW Error log for all the sites. I am getting a "You must assign a template to the page before setting custom field values (title__data) [pageClass=Page, template=] (WireLog)" error, but I'm getting this error on working pages as well. However, there are some errors in our Hosting Provider's log. The error seems to point at some sort of permissioning issue regarding reading the image files? 1.a) File / Dir permissions of Images - I've checked file permissions on the normal and problematic sites. They are all identical 2) .htaccess - I've tried running the .htaccess file from the working site on the problematic site - No Luck 3) codebase - I've done 3 comparisons. They are identical on all sites. 4) wire directory - See above 5) Behaviour - So the problematic site loads up most of its page as expected without problems. It's just a couple that it has issues with. Problematic URL Example : http://kinder-reime.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/ Working URL : http://finger-spiele.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/ I've also attached the KIS Error Logs. Has anyone come across behaviour like this before and what would be the way forward to fix this? KIS.Error.Logs
gebeer Posted May 26, 2017 Posted May 26, 2017 Did you also check the owner:group for the images that are not loaded, e.g. /site/templates/img/square/kinderlieder-ueber-den-fruehling.jpg? I had an issue once with host europe where the owner:group of files were wrong after uploading through FTP. I needed to ask their support to change file ownership to default. In the logs it says: No such file or directory for the images that are problematic. Are you sure that they are there? And in your templates/php/site/SquareImage.php you could do a check like file_exists() before processing the images to avoid a crash in case the image is not there. 1
FrancisChung Posted May 26, 2017 Author Posted May 26, 2017 (edited) Hi @gebeer, thanks for the response. To answer your questions : 1) The owner / group of all the image files are the same. They belong to the owner / group name that bears the account name. 2) The files are definitely all there. I haven't checked all of them but I've spot checked about a dozen and they are there as expected. 3) Looks like I already have code file_exists check in SquareImage.php, albeit I'm checking for the full path, not the path that starts with /site/template ... Is there a PW API call that does a file check that takes in a path name that starts with /site/templates .... ? Edited May 26, 2017 by FrancisChung Additional question
gebeer Posted May 26, 2017 Posted May 26, 2017 3) when checking for file_exists, always use full path. Does it return false? If not, the file is readable. In the docs it says This function returns FALSE for files inaccessible due to safe mode restrictions. However these files still can be included if they are located in safe_mode_include_dir. So you might want to check for safe_mode. But you are saying other sites on the same server are running fine. So I guess its not safe_mode related 1+2) Did you compare file ownership and permissions with other sites installed on the server, anything unusual? Maybe have a look here to understand how permissions on host europe servers work: https://www.hosteurope.de/faq/webhosting/webpack/dateirechtestruktur/ Other than that I would have no clue either... 1
gebeer Posted May 26, 2017 Posted May 26, 2017 One more thing comes to mind: we aere always talking file permissions. Did you also check folder ownership/permissions?
FrancisChung Posted May 26, 2017 Author Posted May 26, 2017 @gebeer, I've checked the folders and they all have the same directory owner/group settings. I would imagine if there was a problem on the directory level, I would be seeing this issue all over the place and not a couple of specific pages. I've also spotted some bugs in the last 15minutes and have eliminated them so the only issues I see now are the permission issue(s) with the image files. I'm going to add some extra debugging, error handling to see if I can shed any more light into it.
FrancisChung Posted May 26, 2017 Author Posted May 26, 2017 @gebeer: I've managed to eliminate all errors that were displaying in the KIS Error logs. And the page still won't load ... At this point, the only thing left is to use the working site as a base and try updating its codebase + data and hope for the best.
FrancisChung Posted May 26, 2017 Author Posted May 26, 2017 I discovered an error with the config.php file in the following line $config->chmodDir = '0755'; // permission for directories created by ProcessWire It was set to '0' not '0755'. Alas, it wasn't the cause of my issue ... I've narrowed it down to it being something in the backend database. If I point the (not working) codebase to an older database, it seems to load up. Unfortunately, I've tried to compare the database dump scripts between the 2 databases and I can't make heads & tails sense out of it. Anyone has any suggestions for comparing 2 databases? Some custom code?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now