Forum

Thread tagged as: Problem, Error

Assets Disappearing

Hello,

I have a group of pages that are referencing a master template page. On some of those pages, a page banner image was uploaded. I began working on another region template of that page and everything seemed fine. Except that all of a sudden page banners are disappearing or can't be found for these pages.

I checked the source code in the browser and the path to the images are correct. I tried to remove and then re-upload one of the images and got a blank asset with a name, but no image thumbnail. So I checked my php error log, this is the last entry:

[20-Aug-2014 21:45:59 America/Chicago] PHP Warning: filesize(): stat failed for C:\xampp\htdocs\jlmarsh2014\cms\resources\class-banners\newsletter-w690h210.jpeg in C:\xampp\htdocs\jlmarsh2014\cms\core\lib\PerchFieldTypes.class.php on line 1002

I don't understand what is happening and its a bit frustrating to go back and replacing each asset individually. Also I have the following template, but when I try to upload an image from this template, in the assigned bucket I only see the original image, and a thumb image, but not the cropped image....which is the version of the image that the banners use.

<perch:content id="bannerimg" type="image" label="Banner Image" height="210" width="690" crop="true" bucket="class-banners" divider-before="Banner Settings" />
<perch:content id="pagedsc" type="textarea" editor="markitup" textile="true" html="true" label="Welcome or Introduction" size="s" />

Everything was working fine earlier. Here is m diagnostics summary:

Perch: 2.6, PHP: 5.4.16, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.6), assets (2.6), categories (2.6), perch_blog (4.1), perch_events (1.9), perch_gallery (2.8.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_events', 'perch_blog', 'perch_gallery' ); ?>
PERCH_LOGINPATH: /cms
PERCH_PATH: C:\xampp\htdocs\jlmarsh2014\cms
PERCH_CORE: C:\xampp\htdocs\jlmarsh2014\cms\core
PERCH_RESFILEPATH: C:\xampp\htdocs\jlmarsh2014\cms\resources
Image manipulation: GD
PHP limits: Max upload 10M, Max POST 20M, Memory: 128M, Total max file upload: 10M
Resource folder writeable: Yes
HTTP_HOST: marsh.dev
DOCUMENT_ROOT: C:/xampp/htdocs/jlmarsh2014
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

Please let me know if you need any other info.

Thank you, Joshua

Joshua Rodriguez

Joshua Rodriguez 2 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The stat failed is a bit worrying. That indicates that PHP can't read the image. Could be a permissions problem, or even a hardware failure. Do you have plenty of available space on the disk?

Yes, I have about 550GB free and 8GB of RAM installed. I'm going to restart my PC and cleanup a bit.

Now that I think about it. Could an older version of ckeditor be causing this problem? Its not being used in the region where the banner is uploaded, but it is on the same page. I had upgraded to version 4.3.1 from the Perch Plug-ins, but I think it wasn't until I went back to the previous version of 3.6.4 that this started happening.

I just don't see a connection between the plugin and why assets started disappearing.

Drew McLellan

Drew McLellan 2638 points
Perch Support

CKEditor doesn't log asset use. Are these assets added via CKEditor?

No they're not. The banner images are uploaded through an image field in a region called Profile. On the same page I have a region called 'News & Announcements' which uses ckeditor. I would prefer markitup, but the site is for an elementary school, so the faculty likes the ability to be creative at least with their news post (different fonts, colors, styles).

What's weird though is that when I started to test the News & Announcements region, I added some text and an image through ckeditor in that region, and after saving I reloaded my browser and noticed the page's banner image was displaying as a broken image. The image path was correct, so I checked my resources folder and noticed the cropped image was missing, but was there before with the original and thumb versions.

Then I noticed a few other cropped images for other page banners were missing too. So I deleted the images from the assets app and tried to re-upload the images. Now something else that happened was that I would upload an image, but after submitting the upload, no image was in the 'choose a file' field, so I would try again and on the second try the image would upload. When I returned to the Add/Edit section of Assets, I had two copies of the image, one displaying as expected and the other displaying a broken image. So I have to delete that one. This is consistent now for any image I upload in Assets...I have to upload twice and then delete the broken image copy.

But this all started after I added content through ckeditor. So I don't know what happened and much less how to fix it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn debug on and watch for errors as you upload?

Drew, everything is working again. I restarted my PC, xampp, cleared my cache and other routine PC cleanup...and everything seems to be working fine, but I'll definitely keep an eye on how the system is behaving.

I did turn debug on, and I guess since everything was working I didn't see any errors. I'm just worried that if I don't know what caused this issue, how will I be sure it won't be triggered again somehow?

I don't turn my PC off very often, its an updated PC with a Quad Core processor, etc....but with all the recent issues I've had, and posted some to the forums, while developing with Perch, almost always disappear once I move the site onto the live server, which has me thinking about a Mac somewhere down the road.

I'm thinking, like you mentioned, I must have hit some memory limit somewhere in my setup. I can't think of where though. Maybe I can just reboot more often? I do clear my cache and browser often while fine-tuning templates and css/js.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I usually work in Chrome when developing, and that has the option to turn off caching when the web inspector is open.