503 Service Unavailable

zenPhoto 1.6.8 on Netfirms webhosting server PHP 8.4.7 MySQL 5.7.44

host platform "gets real busy" ??? when caching new photos ?

create a test directory
create an empty database
copy zp1.6.8 to test directory
run setup ../zptest/zp-core/setup.php

setup seems to work fine, db written, license acknowledged, admin user created
logout from admin

login to admin ../zptest/zp-core/admin.php
move site to test mode
View gallery - looks OK empty gallery

Albums > New Album > Our Cars
View gallery - looks OK gallery with empty album
click on album Our Cars - looks OK no photos to display

FTP 35 jpg files to zptst/albums/Our-Cars
View gallery - looks OK gallery with 1 thumbnail displayed
click on album Our Cars - (a random?) 6 images are displayed and the rest are gray blocks and url in browser show circle like the page is waiting or somethig

The page does let me select Admin and go back to the admin page

If I now go back to the View Gallery I am back at the Gallery with 1 album shown and same thumbnail
Clicking on the thumbnail I get the same album with the same few thumbnails displayed and most of the photos gray blocks and the browser url circling like the page is busy.

This all works fine on MAMP so I assume this is some sort of server issue. Unfortunately I only have FTP access to the server and no access to apache or php logs, etc (as far as I know).

I am looking for any clues as to what to ask the webhosting support team for

P.S. after waiting minutes at the album the URL spinning stops and the page has changed from gray blocks to image titles with broken image icons

Clicking on any of the images (ones with thumbnails or with bronken image icon) and no image is displayed only the image title

next and prev navigate through the image titles but no images are ever displayed

accessing the public URL gives fancy upgrade message

Gallery is undergoing an upgrade

Please return later

Now go back to admin and open the site
When I click Apply the URL spinner happens again
https://italiancarclubottawa.ca/zptst/zp-core/utilities/maintenance_mode.php?XSRFToken=2e03bc3ef7a6f14fffd1d1f8cab8e3b936d823b1

After about 2 minutes I get
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

If I try to go to the admin page
https://italiancarclubottawa.ca/zptst/zp-core/admin.php

I can enter my username and password but it just sits there with the URL spinning

If I go to the public URL
https://italiancarclubottawa.ca/zptst
I get the same fancy site upgrade message - no waiting

Comments

  • acrylian Administrator, Developer
    edited February 18

    host platform "gets real busy" ??? when caching new photos ?

    Of course it does, it is the most power and memory consuming task. As mentioned I do not recommend to upload hundreds or thousands of images at the time via ftp. It is likely overloading your server especially if these are large dimension images.

    Especially if this is rather shared hosting. Perhaps you over did this a little with your backend refreshing and your host shut it down temporarily.

    https://www.zenphoto.org/news/problems-with-albums-and-images/

    MAMP is good to simulate but not the same as a real server of course.

    You can pre-create cached images on MAMP and upload them, too if needed.

    The "Gallery is undergoing an upgrade" is the maintenance mode page which you can disable on the backend. It would not enable itself.

    Also review you logs.. You likely find some memory issues or similar.

  • Ok

    I started again and added photos 1 at a time for 10 photos and all was fine

    I then added 10 photos at a time and when I looked at the album it did the spinning URL (on Chrome) again (and eventually minutes later image broken icon)

    I guess my shared hosting is very CPU or memory limited or both.

    I have deleted the contents of the albums in the test builds on the hosting server and I still can't get back into the admin console to figure out what size thumbnails to generate in MAMP (times out).

    I am finding a number of different sizes in the cache/photo album directory

    I assume that the cache_html directory is not used for this?

    I guess I need help from the hosting company to unblock my user.

    This had been working in the past (on my 1.5.9 based site) from the same hosting company. It only broke as I tried to update zp before switching to PHP8

    For each event our club would have I would FTP up 100 photos or so and everything worked fine.

    Now I can't even upload 10 photos without the timeouts and remainder of cache images never being created ...

    I don't think it is feasible to offline generate the thumbnails everytime I need to add more than a few photos at a time...

    Are there specific asks I can make for the user CPU or memory quota (assuming that they are somehow restricting me on that)

    I guess the thumbnails are configured in Options > Theme
    except that those items don't seem to be able to be changed though I can change the cropped or not setting

  • FYI - according to the host support team there are 2 issues.

    "Currently, PHP 8.4 is set up for your website. I'm glad to inform you that our engineers identified the file /public_html/zp-data/.mutex/zP is causing the 503 Service Unavailable error."

    But I don't know what the cause of this could be. The file also gets recreated when accessing the admin panel. But working for now.

    Secondly they said this

    "Further, our engineers found that the following extensions have been enabled in the php.ini file, and these extensions, when added to php.ini, make the website not work properly. So I have now removed these extensions.

    extension=propro.so
    extension=raphf.so
    extension=ctype.so"

    I don't know exactly what "not work properly" means and the impact of removing those extensions but let's try adding some photos ...

  • acrylian Administrator, Developer

    The mutex file is to limit to processes like the image processing to help to not overload a server.

    Those three php extension are not required by Zenphoto and to my knowledge not used.

  • Here's an update. (I get for this post a message saying the Body is too long so maybe it will get truncated and I will have to post this in multiple pieces)

    I don't want this to sound like complaining because I like ZP a lot but I hope this is useful to the designers or others who may experience the issues I have.

    As you can imaging my first priority has been to get my site back online and I think I have achieved that - but it has been difficult.

    (FYI - I am an volunteer / not a professional in software or IT trying to help my local car club keep track of our history of car events by maintaining a photo album of activities and related announcements etc).

    I chose zenphoto (and zpBootstrap) 4 years ago when our old platform was too outdated to be updated and zp works well for our intended purpose.

    Something has changed in our hosting environment since 2022, as far as I can tell unrelated to them requiring me to move from PHP 7 to PHP8. As you know this also required me to move from my old zp1.5.9 to current 1.6.8.

    Knowing what I know now I could have done certain things differently but here's where I am.

    1. the upgrade from 1.5.9 to 1.6.8 did not work on PHP7
      (I don't know why and haven't had a chance to look into it - even from 1.5.9 to 1.6.0 did not work)

    2. I decided to do a fresh install of 1.6.8 on PHP8
      (there was minimal information to cut and paste from the 1.5.9 zenpage pages but over 3600 images to transfer in about 70 albums)

    3. whatever hosting changes have been made over time restrict zp from on-the-fly creating thumbnails to a small number at a time - maybe 5 or 10, I don't know exactly) There are many places where more than 10 images are displayed at once so online image cache generation was not going to work for me. (gallery display shows 12 thumbnails / album display shows 16 thumbnails / admin > albums > image order displays a thumbnail of all the images in an album - I know I can change the Options > Theme settings to display a different number but not the admin display and anyway I want the 12 and 16).

    Requiring any of those thumbs to be generated, en masse, in my hosting environment caused my zp to "lock-up" causing 503 Service Unavailable. The only way to recover appears to be to remove the zp-data/.mutex/zP file (which did cause some errors logged in debug log but nothing fatal as zp always recovered without other changes).

    After this the public site and admin panel would recover. Note that other parts of the public site would work - only things related to displaying images seemed to time-out.

    to be continued ...

  • part 2 - after spam filter delay

    1. offline cacheing or creating the images in another less resource constrained environment was fortunately possible for me though still difficult. I chose MAMP. I could not get zp to run on the PC version of MAMP. On my Apple mac I could only get zp1.6.8 to work on MAMP ver 6.9 and not any newer version of MAMP.

    2. my largest albums are around 200 images and that still took some time on MAMP but I learned not to watch the message that said it was done but rather wait for the cache manager page to fully update (on chrome for the circle to stop spinning)

    3. By default the zpBootstrap theme only created 6 thumbnails when using the cacheManager. It leaves out 2 important thumbs; w110 used by the Admin > Albums > Image order page and w135 used by the Gallery when displaying a thumb for the album. This meant manually generating these (doing those actions on MAMP to cause it to generate those thumbs - maybe there is a way to add more thumbnail definitions to the cache manager?)

    4. How do I stop zp from generating links in the cache? Even after I enabled Options > Image > cache the full image zp still seems to generate links for some files.

    There seems to be some interaction with Disable hotlinking. I disabled it (so allowed hotlinking) because otherwise seemed to cause the "time-out" in my host environment. Knowing now that it was probably more related to the thumb generation maybe I could enable it - not sure.

    Zenphoto works great for me as long as it does not need to create any thumbnails!

    Now that it seems to have all the thumbnails it needs is my site safe or will zp decide to re-generate thumbnails at some point?

    How can I have cacheManager generate those 2 additional thumbnails?

    What is the reason for generating links when the photo_1000.jpg thumb is available? It seems to generate a link called photo_FULL.jpg and only for some of the images. Is there some pre-processing of images that I should be doing to help things out? It seems that putting photos of size > 1000px into the album is pointless as that is the largest size image displayed (or do I misunderstand how albums and images are displayed?)

    Is there a way to generate the required cache images in a resource constrained (my guess at the cause of the issue) environment so I do not need to have an off-line setup like MAMP?

  • acrylian Administrator, Developer
    1. / 2. the upgrade from 1.5.9 to 1.6.8 did not work on PHP7

    Can't help much we primarily teset on PHP 8+ since for a long time. I know I upgraded much older installs to at least 1.5 or 1.6 install successfull. Even directly without the steps we recommend ourselves.

    There a numerous things that could be the reason here.

    1. whatever hosting changes have been made over time restrict zp from on-the-fly creating thumbnails to a small number at a time - maybe 5 or 10, I don't know exactly)

    That all is a matter of the host in combination with lots of images you have. I can only say I have various ZP installs on various standard hosts without any problem. Which of course are much smaller in size though.

    The limit here is server power. Apparently your server does not work with the default mutext settings. You can lower these on Options > Image > Caching concurrency

    If you are on shared hosting and don't have a virtual server or even your own your resources are always a bit limited.

    1. On my Apple mac I could only get zp1.6.8 to work on MAMP ver 6.9 and not any newer version of MAMP.

    Since I have it running on MAMP 7.2 something else must be different on your end I fear.

    1. I learned not to watch the message that said it was done but rather wait for the cache manager page to fully update (on chrome for the circle to stop spinning)

    The cachemanager has two modes. On some servers one works better than the other. It starts bascially individual parallel processes in the background so to speak limited by the mutext stuff mention above. Depending on the server power and the size (dimensions) of the images) they might take a while longer.

    Try to use smaller images. For example it makes a huge difference to use 1500x1500px or 2000x2000px images intead of 6000x6000px or whatever a camera originally produces.

    1. By default the zpBootstrap theme only created 6 thumbnails when using the cacheManager. It leaves out 2 important thumbs; w110 used by the Admin > Albums > Image order page and w135 used by the Gallery when displaying a thumb for the album.

    Then it possibly does not register the sizes correctly. Please open a ticket on the repo so we don't forget to check that when we get the chance.

    The admin sizes are default ones and can be enabled on tthe begging if using thte cachemanager.

    1. How do I stop zp from generating links in the cache? Even after I enabled Options > Image > cache the full image zp still seems to generate links for some files.

    You probably mean symlinks here. Those are generated if the cached images would be the same size as the original (or thte original is too small to create a larger size) to save space by not creating basically an duplicate.

    There seems to be some interaction with Disable hotlinking. I disabled it (so allowed hotlinking) because otherwise seemed to cause the "time-out" in my host environment.

    Some image proctection options specifially cause overhead and this here might be combination with your general performance issues.

    Is there a way to generate the required cache images in a resource constrained (my guess at the cause of the issue) environment so I do not need to have an off-line setup like MAMP?

    There is no other way sorry.

    Some user created an third party plugin that apparently worked better for him. It has not seen any update in three years but may still work. Try on your own risk:
    https://www.zenphoto.org/news/smartimagecache/

  • Thanks again for your quick replies

    Try to use smaller images. For example it makes a huge difference >to use 1500x1500px or 2000x2000px images intead of >6000x6000px or whatever a camera originally produces.

    None of my images are larger than 1500px on the longest side and only the recent ones anyways. Many of my older images are much smaller like 640x480 (that was the cameras we had back then).

    If my zpBootstrap theme limits Image Size to 1000 on the longest side (as Admin > Options > theme > Image size) is there any cases where a larger image would be displayed ?
    When using this theme with this limit should I pre-process the images I download to the Photos directory to be no larger than 1000px?

    Then it possibly does not register the sizes correctly. Please open >a ticket on the repo so we don't forget to check that when we get >the chance.

    The admin sizes are default ones and can be enabled on tthe >begging if using thte cachemanager.

    I am not against changing the code if you could point me to where I should have zpBootstrap tell "register" those 2 additional sizes to be generated.

    You probably mean symlinks here. Those are generated if the >cached images would be the same size as the original (or thte >original is too small to create a larger size) to save space by not >creating basically an duplicate.

    I do and does your answer mean that I can not disable the use of symlinks? I haven't looked at all 70 albums but it seems that the symlinks are only generated for the full image and has the name photo_FULL.jpg

    For online cache generation I will try Options > Image > Caching concurrency. First to make a backup of everything already working then to make some tests.

    Assuming I have all the image sizes cached that I need will zenphoto ever try to re-generate cache images on existing sites?

    As long as not then if I take care of generating all the needed images in cache before adding new images this seems workable.

  • acrylian Administrator, Developer

    When using this theme with this limit should I pre-process the images I download to the Photos directory to be no larger than 1000px?

    Only if it registers them to the cacheManager. That is done on the theme_options. Best is you open a ticket on the repo so the theme actually has it already. Have no check it.

    I do and does your answer mean that I can not disable the use of symlinks?

    I don't think we have an option for thatt as far as I remember offhand. You can disable symlinks on the server in case you can do that, e.g. via php.ini I think.

Sign In or Register to comment.