Forum

Thread tagged as: Problem, Blog

Blog assets disappearing

Hello.

I'm having some issues with one Perch installation. It has been updated several times.

For reasons unknown, after some time blog assets disappear.

First gets deleted the Perch generated something-w720.xxx and something-w100h100.xxx the something@x2.xxx and the original file are not deleted. But ofcourse Perch cannot show the assets on page since those are gone. They still are shown in the admin side, so when I open the blog post and save it, then different sizes gets re-generated and are back online.

In some cases also the originals are deleted. Haven't been able to conclude when.

I posted a while back on the forum that I get empty email from cron with scheduled task. That's also pretty strange, cause I don't get it when I run the task from a browser or from terminal with php -command. So only when it's run via. crontab. Could this have something to do with it?

In database perch2_blog_index the deleted images show, but not in the perch2_resources table.

It's also good to note that this started to happen around middle of march. I don't remember what version upgrade was at hand then. This problem only concerns new posts - before march 10th.

Can you figure out what's wrong?

Here's the diagnostics:

Perch is up to date
PHP 5.5.9-1ubuntu4.9 is up to date
MySQL 5.5.5-10.0.15-MariaDB-1~trusty is up to date
Image processing available
SUMMARY INFORMATION

Perch: 2.8.5, PHP: 5.5.9-1ubuntu4.9, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.5), assets (2.8.5), categories (2.8.5), perch_blog (4.6), perch_forms (1.8.3), perch_mailchimp (2.0.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_mailchimp', ); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /data/www/www.xxxxxx.fi/perch
PERCH_CORE: /data/www/www.xxxxxx.fi/perch/core
PERCH_RESFILEPATH: /data/www/www.xxxxxx.fi/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 20M, Max POST 8M, Memory: 512M, Total max file upload: 8M
Resource folder writeable: Yes
HTTP_HOST: www.xxxxxx.fi
DOCUMENT_ROOT: /data/www/www.xxxxxx.fi
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Karri Karttunen

Karri Karttunen 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me your extended diagnostics report?

Sure thing, Drew.

Here it is:


Perch: 2.8.5 Production mode: Production (100) Installed apps: content (2.8.5), assets (2.8.5), categories (2.8.5), perch_blog (4.6), perch_forms (1.8.3), perch_mailchimp (2.0.1) DB driver: PDO DB tables: perch2_blog_authors, perch2_blog_categories, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_categories, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_mailchimp_campaigns, perch2_mailchimp_history, perch2_mailchimp_log, perch2_mailchimp_stats, perch2_mailchimp_subscribers, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_scheduled_tasks, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 3 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_mailchimp', ); ?> Scheduled tasks for perch_mailchimp: update_list_stats (60 mins) Scheduled tasks for perch_blog: delete_spam_comments (1440 mins) Editor plug-ins: markitup, ckeditor, redactor H1: 25f6cb2ee36d4642f9f684dbbc24d4dc L1: 5bdb098e4815a527c2e8582abcb93730 headerColour: #ffffff content_singlePageEdit: 0 helpURL: hideBranding: 1 content_collapseList: 1 lang: en-gb update_2.2.10: done latest_version: 2.8 headerScheme: light siteURL: https://www.xxxxxx.fi dashboard: 1 perch_blog_post_url: /blog/post.php?s={postSlug} perch_blog_slug_format: %D-%M-%Y-{postTitle} perch_blog_akismet_key: content_hideNonEditableRegions: 1 perch_blog_comment_notify: 0 perch_blog_update: 5.0 on_sale_version: 2.8.5 update_2.3.4: done perch_mailchimp_secret: e28a2c1b37f88ddf09de8855c71e50fd perch_mailchimp_update: 2.0 perch_mailchimp_api_key: 3bdc6454e974ed794b978676babbb7f1-us3 perch_mailchimp_list_id: 9a9d625d8f perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug} update_2.4.2: done update_2.4.3: done perch_blog_max_spam_days: 7 content_frontend_edit: 0 update_2.4.5: done logoPath: /perch/resources/logo.png update_2.4.9: done update_2.7.5: done hide_pwd_reset: 0 update_2.7.3: done update_2.7.4: done update_2.8.2: done update_2.8.5: done PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: pur PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: pur_myymala PERCH_DB_PREFIX: perch2_ PERCH_TZ: Europe/Helsinki PERCH_EMAIL_FROM: info@xxxxxx.fi PERCH_EMAIL_FROM_NAME: xxxxxx PERCH_LOGINPATH: /perch PERCH_PATH: /data/www/www.xxxxxx.fi/perch PERCH_CORE: /data/www/www.xxxxxx.fi/perch/core PERCH_RESFILEPATH: /data/www/www.xxxxxx.fi/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_SCHEDULE_SECRET: joukopouko PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /data/www/www.xxxxxx.fi/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS PHP: 5.5.9-1ubuntu4.9 Zend: 2.5.0 OS: Linux SAPI: apache2handler Safe mode: not detected MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $ MySQL server: 5.5.5-10.0.15-MariaDB-1~trusty Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, SPL, iconv, mbstring, session, posix, Reflection, standard, shmop, SimpleXML, soap, sockets, Phar, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, apache2handler, mysqlnd, PDO, apcu, curl, gd, imagick, json, mcrypt, memcache, mysql, mysqli, pdo_mysql, readline, ssh2, tidy, mhash, apc, Zend OPcache GD: Yes ImageMagick: Yes PHP max upload size: 20M PHP max form post size: 8M PHP memory limit: 512M Total max uploadable file size: 8M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: No QS_SrvConn: 6 QS_AllConn: 6 QS_ConnectionId: 14297862144129730630728 HTTP_HOST: www.xxxxxx.fi HTTP_CONNECTION: keep-alive HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36 HTTP_REFERER: https://www.xxxxxx.fi/perch/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_ACCEPT_LANGUAGE: fi,en-US;q=0.8,en;q=0.6 HTTP_COOKIE: cmssb=0; PHPSESSID=t22edu10ulu44s0coc5q49e7i5; _gat=1; _ga=GA1.2.964268558.1418654199; cmsa=1 HTTP_DNT: 1 PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin SERVER_SIGNATURE: <address>Apache/2.4.7 (Ubuntu) Server at www.xxxxxx.fi Port 80</address> SERVER_SOFTWARE: Apache/2.4.7 (Ubuntu) SERVER_NAME: www.xxxxxx.fi SERVER_ADDR: 217.119.32.195 SERVER_PORT: 80 REMOTE_ADDR: 85.76.40.122 DOCUMENT_ROOT: /data/www/www.xxxxxx.fi REQUEST_SCHEME: http CONTEXT_DOCUMENT_ROOT: /data/www/www.xxxxxx.fi SERVER_ADMIN: asiakaspalvelu@oleva.fi SCRIPT_FILENAME: /data/www/www.xxxxxx.fi/perch/core/settings/diagnostics/index.php REMOTE_PORT: 11612 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_NAME: /perch/core/settings/diagnostics/index.php PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1429786219,19 REQUEST_TIME: 1429786219
Drew McLellan

Drew McLellan 2638 points
Perch Support

You're missing the resource log table, somehow. Can you try running the update again?

/perch/core/update/?force=update

Well, that is odd. It did have in the beginning perch2_resource_log, but I guess that's not that then?

Here's after the force update:

PERCH INFORMATION

Perch: 2.8.5
Production mode: Production (100)
Installed apps: content (2.8.5), assets (2.8.5), categories (2.8.5), perch_blog (4.6), perch_forms (1.8.3), perch_mailchimp (2.0.1)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_categories, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_categories, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_mailchimp_campaigns, perch2_mailchimp_history, perch2_mailchimp_log, perch2_mailchimp_stats, perch2_mailchimp_subscribers, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_scheduled_tasks, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 3
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_blog',
        'perch_forms',
        'perch_mailchimp',
    );
?>

Scheduled tasks for perch_mailchimp: update_list_stats (60 mins)
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, ckeditor, redactor
H1: 25f6cb2ee36d4642f9f684dbbc24d4dc
L1: 5bdb098e4815a527c2e8582abcb93730
headerColour: #ffffff
content_singlePageEdit: 0
helpURL:
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.2.10: done
latest_version: 2.8
headerScheme: light
siteURL: https://www.pur-kauppa.fi
dashboard: 1
perch_blog_post_url: /blog/post.php?s={postSlug}
perch_blog_slug_format: %D-%M-%Y-{postTitle}
perch_blog_akismet_key:
content_hideNonEditableRegions: 1
perch_blog_comment_notify: 0
perch_blog_update: 5.0
on_sale_version: 2.8.5
update_2.3.4: done
perch_mailchimp_secret: e28a2c1b37f88ddf09de8855c71e50fd
perch_mailchimp_update: 2.0
perch_mailchimp_api_key: 3bdc6454e974ed794b978676babbb7f1-us3
perch_mailchimp_list_id: 9a9d625d8f
perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug}
update_2.4.2: done
update_2.4.3: done
perch_blog_max_spam_days: 7
content_frontend_edit: 0
update_2.4.5: done
logoPath: /perch/resources/logo.png
update_2.4.9: done
update_2.7.5: done
hide_pwd_reset: 0
update_2.7.3: done
update_2.7.4: done
update_2.8.2: done
update_2.8.5: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: pur
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: pur_myymala
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/Helsinki
PERCH_EMAIL_FROM: info@purkauppa.fi
PERCH_EMAIL_FROM_NAME: PUR-kauppa
PERCH_LOGINPATH: /perch
PERCH_PATH: /data/www/www.purkauppa.fi/perch
PERCH_CORE: /data/www/www.purkauppa.fi/perch/core
PERCH_RESFILEPATH: /data/www/www.purkauppa.fi/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_SCHEDULE_SECRET: joukopouko
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /data/www/www.purkauppa.fi/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.5.9-1ubuntu4.9
Zend: 2.5.0
OS: Linux
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $
MySQL server: 5.5.5-10.0.15-MariaDB-1~trusty
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, SPL, iconv, mbstring, session, posix, Reflection, standard, shmop, SimpleXML, soap, sockets, Phar, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, apache2handler, mysqlnd, PDO, apcu, curl, gd, imagick, json, mcrypt, memcache, mysql, mysqli, pdo_mysql, readline, ssh2, tidy, mhash, apc, Zend OPcache
GD: Yes
ImageMagick: Yes
PHP max upload size: 20M
PHP max form post size: 8M
PHP memory limit: 512M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
QS_SrvConn: 11
QS_AllConn: 11
QS_ConnectionId: 14298086706426211901778
HTTP_HOST: www.pur-kauppa.fi
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36
HTTP_REFERER: https://www.pur-kauppa.fi/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: fi,en-US;q=0.8,en;q=0.6
HTTP_COOKIE: cmssb=0; PHPSESSID=t22edu10ulu44s0coc5q49e7i5; _ga=GA1.2.964268558.1418654199; cmsa=1
HTTP_DNT: 1
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE: <address>Apache/2.4.7 (Ubuntu) Server at www.pur-kauppa.fi Port 80</address>
SERVER_SOFTWARE: Apache/2.4.7 (Ubuntu)
SERVER_NAME: www.xxxxxx.fi
SERVER_ADDR: 217.119.32.195
SERVER_PORT: 80
REMOTE_ADDR: 85.76.40.122
DOCUMENT_ROOT: /data/www/www.purkauppa.fi
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /data/www/www.purkauppa.fi
SERVER_ADMIN: asiakaspalvelu@xxxxxx.fi
SCRIPT_FILENAME: /data/www/www.xxxxxx.fi/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 54700
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1429808675,865
REQUEST_TIME: 1429808675
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, looks like it's now in place. Let me know if the problem continues after 24 hours.

Hello, Drew. The Blog assets just dissappeared again. And once again it's only for the posts posted after march 10th.

This is very odd, since not all the assets dissappear. Just some of them. Also in the backend some are visible, some not. The ones that are visible in the backend reappear after saving also to the frontend.

Any other ideas?

Drew McLellan

Drew McLellan 2638 points
Perch Support

How are the assets being added in the blog?

They are added first via. assets manager and then selected from assets in the blog app.

Also I can't see any pattern here. So that it would always be certain images that are gone. The way I see it it's just random. Images uploaded at the same time, same format, same naming logic dissappear at different times from different fields.

So the information stays in the blog database, but images are removed from assets and server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure what's causing that, so let's just shut it off.

In your config.php file, add the following:

 define('PERCH_CLEAN_RESOURCES', false);

Ok, that's nice that you can do it so easily!

Thanks again, this is quite odd and no other Perch installation of mine does this.

Hope this helps. We'll see in a week or so. If you find the bug at some point then it's good to remember that it first appeard for me after march 10th update.

Just upgraded to 2.8.6 from 2.8.3 and I'm having the same problems within the Blog app. (Although I had one image randomly missing on the frontend for about a month now.)

Fatal error: Class 'PerchAssetFile' not found in /public/perch/core/lib/PerchImage.class.php on line 269

perch_blog (4.6)

  1. Noticed the image was missing on the front-end of the site.
  2. Went to post and the thumbnail preview was gone as well.
  3. Tried to remove. hit save... error.
  4. Tried to replace with another image in asset library. Hit save... error.
  5. Tried to upload new image and on complete vanished and not in assets library.

**Update***

I had a .gitignore for my core folder which did it's job apparently. When I copied over the new core folder it didn't get fully pushed. Checked the production server and it was missing lots of files.

Everything seems to working as expected 2.8.6 for blog assets & uploading.

I've also just seen this problem on a new installation of Perch. Five out of six blog assets (images) disappearing in one go.

Perch version: 2.8.8 Perch Blog version: 4.6

It's not a huge problem - I've implemented the PERCH_CLEAN_RESOURCES workaround which I think is fine for now. I just wanted to bring it to your attention. If you need any further info, let me know.