Forum

Thread tagged as: Problem

Assets go missing

Hi,

I have a problem. Many assets go missing on a live version of a site. When I save a blog post for example, the table 'perch2_resources' is updated and dozens of rows vanish. At the same time, those asset files go missing on the server in perch/resources. I have managed to get around this by restoring the said table from backup and re-syncing the deleted files back up to the server. It continues smoothly until I save a page / blog post in Perch and the error triggers again.

Any ideas Drew / Rachel / you guys?

Thanks Adam

Adam Menczykowski

Adam Menczykowski 1 points

  • 6 years ago

By the way I'm running:

Perch: 2.7.4, PHP: 5.4.34-0+deb7u1, MySQL: 5.5.40, with PDO

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can you post your Diagnostics Report please?

Sure thanks

Perch: 2.7.4
Production mode: Production (100)
Installed apps: content (2.7.4), assets (2.7.4), categories (2.7.4), perch_blog (4.5.4), perch_forms (1.8.2)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, 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_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 2

App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_forms',
        'perch_blog'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, ckeditor
H1: 79501c38136b68831b1840972ee22923
L1: 8e205bef2b576397cd3326c7ebe27773
headerColour: #fff8ef
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.7.3: done
latest_version: 2.5.3
on_sale_version: 2.7.6
headerScheme: light
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /perch/resources/House-Type-5.gif
perch_blog_update: 5.0
perch_blog_post_url: /blog/{postSlug}
perch_blog_slug_format: {postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
update_2.7.4: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: declutterme
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: sal@declutterme.london
PERCH_EMAIL_FROM_NAME: Sally Walford
PERCH_EMAIL_METHOD: smtp
PERCH_EMAIL_HOST: smtp.gmail.com
PERCH_EMAIL_AUTH: 1
PERCH_EMAIL_SECURE: ssl
PERCH_EMAIL_PORT: 465
PERCH_EMAIL_USERNAME: sal@declutterme.london
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/adammench/public/declutterme.london/public/perch
PERCH_CORE: /home/adammench/public/declutterme.london/public/perch/core
PERCH_RESFILEPATH: /home/adammench/public/declutterme.london/public/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
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: /home/adammench/public/declutterme.london/public/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.34-0+deb7u1
Zend: 2.4.0
OS: Linux
SAPI: apache2handler
Safe mode: not detected
MySQL client: 5.5.40
MySQL server: 5.5.40-0+wheezy1
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, SPL, iconv, json, mbstring, session, posix, Reflection, standard, shmop, SimpleXML, soap, sockets, Phar, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, apache2handler, PDO, gd, mcrypt, mysql, mysqli, pdo_mysql, ssh2, mhash
GD: Yes
ImageMagick: No
PHP max upload size: 200M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
HTTP_HOST: declutterme.london
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 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
HTTP_REFERER: https://declutterme.london/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,es;q=0.6
HTTP_COOKIE: PHPSESSID=fflil7bbp5gkgtt2oo9o4tlm42; _ga=GA1.2.1270708260.1413294443; cmsa=1
PATH: /usr/local/bin:/usr/bin:/bin
SERVER_SIGNATURE: <address>Apache/2.2.22 (Debian) Server at declutterme.london Port 80</address>
SERVER_SOFTWARE: Apache/2.2.22 (Debian)
SERVER_NAME: declutterme.london
SERVER_ADDR: 178.79.142.210
SERVER_PORT: 80
REMOTE_ADDR: 151.227.155.245
DOCUMENT_ROOT: /home/adammench/public/declutterme.london/public/
SERVER_ADMIN: adammenczykowski@gmail.com
SCRIPT_FILENAME: /home/adammench/public/declutterme.london/public/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 57864
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: 1420563205.482
REQUEST_TIME: 1420563205
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you see items from the Blog app being logged in your perch2_resource_log table?

Yes there are 8 rows in the perch2_resource_log table referring to two different postID's I think.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds about right. Do those change when the assets are cleaned up?

I'm not sure... how can I test this? It's still happening.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You say that there are 8 rows in the perch2_resource_log table referring to two different postIDs. Is that the same after this happens?

Is there a reason not to be running the current version?

Hi Drew,

After adding a blog post, the perch2_resources table is reset again (back down to 50 rows instead of 327) and images disappear from the server. However there are no new rows in perch2_resource_log referring to postIDs added.

What other tables affect perch2_resources?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Blog doesn't have resource clean-up. It logs use, but doesn't have the capability to remove anything.

Are you sure you didn't edit a content region?

It was a blog post. However where else could I look for discrepancies in the database if a content region was edited by the client also?

I have a feeling this spawns from workign on the site locally and remotely then syncing files / database thus causing conflicting errors. What tables could I check that would affect the resource clean up?

Thanks for your ongoing support

Drew McLellan

Drew McLellan 2638 points
Perch Support

How are you syncing the database?

I export it in Sequel Pro, then import again to the server the same way. All tables at once.

Any ideas why it could be resetting the resources table and removing the images?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you replacing the data or merging it?

Replacing it - at the same time as merging files from server to server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should be fine then.

OK. I agree. But can you think why the resources images and database table reset to an old version (less files / a smaller table) ?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me the output from these two queries?

SHOW CREATE TABLE `perch2_resources`;
SHOW CREATE TABLE `perch2_resource_log`;
CREATE TABLE `perch2_resources` (
  `resourceID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `resourceApp` char(32) NOT NULL DEFAULT 'content',
  `resourceBucket` char(16) NOT NULL DEFAULT 'default',
  `resourceFile` char(255) NOT NULL DEFAULT '',
  `resourceKey` enum('orig','thumb') DEFAULT NULL,
  `resourceParentID` int(10) NOT NULL DEFAULT '0',
  `resourceType` char(4) NOT NULL DEFAULT '',
  `resourceCreated` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
  `resourceUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `resourceAWOL` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `resourceTitle` char(255) DEFAULT NULL,
  `resourceFileSize` int(10) unsigned DEFAULT NULL,
  `resourceWidth` int(10) unsigned DEFAULT NULL,
  `resourceHeight` int(10) unsigned DEFAULT NULL,
  `resourceCrop` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `resourceDensity` float NOT NULL DEFAULT '1',
  `resourceTargetWidth` int(10) unsigned DEFAULT NULL,
  `resourceTargetHeight` int(10) unsigned DEFAULT NULL,
  `resourceMimeType` char(64) DEFAULT NULL,
  `resourceInLibrary` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`resourceID`),
  UNIQUE KEY `idx_file` (`resourceBucket`,`resourceFile`),
  KEY `idx_app` (`resourceApp`),
  KEY `idx_key` (`resourceKey`),
  KEY `idx_type` (`resourceType`),
  KEY `idx_awol` (`resourceAWOL`),
  KEY `idx_library` (`resourceInLibrary`),
  FULLTEXT KEY `idx_search` (`resourceTitle`)
) ENGINE=MyISAM AUTO_INCREMENT=328 DEFAULT CHARSET=utf8
CREATE TABLE `perch2_resource_log` (
  `logID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `appID` char(32) NOT NULL DEFAULT 'content',
  `itemFK` char(32) NOT NULL DEFAULT 'itemRowID',
  `itemRowID` int(10) unsigned NOT NULL,
  `resourceID` int(10) unsigned NOT NULL,
  PRIMARY KEY (`logID`),
  KEY `idx_resource` (`resourceID`),
  KEY `idx_fk` (`itemFK`,`itemRowID`),
  KEY `idx_uni` (`appID`,`itemFK`,`itemRowID`,`resourceID`)
) ENGINE=MyISAM AUTO_INCREMENT=371 DEFAULT CHARSET=utf8