Jump to content

Page not loading on 1 site but loads on other


FrancisChung
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 by FrancisChung
Additional question
Link to comment
Share on other sites

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...

  • Like 1
Link to comment
Share on other sites

@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. 

Link to comment
Share on other sites

@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.

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...