Forum

Thread tagged as: Problem, Error, Installation

Uploaded asset does not save, can't see any assets after upgrade.

Recently upgraded from Perch 2.08 to Perch Perch: 2.8.13

There were a couple of warnings on upgrade - have seen similar ones before and ignored with all being well. But this time the thing that is not working is uploading Assets. It starts uploading, completes but shows nothing, no thumb no asset saved.

Also, no current resources are showing in Assets.

If I go to Assets "app" I see these errors with debug turned on:

Debug Message
SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='77624445be04dcfce8e8a5b2971b536c' LIMIT 1
UPDATE perch2_users SET userHash='4045e7840f6e28b62575daea1bfa38c4' WHERE userID='1'
SELECT p.privKey FROM perch2_user_privileges p
SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
Adding: MailChimp
SELECT SQL_CALC_FOUND_ROWS DISTINCT r1.*, r2.resourceFile AS thumb, r2.resourceWidth AS thumbWidth, r2.resourceHeight AS thumbHeight, r2.resourceDensity AS thumbDensity FROM perch2_resources r1 LEFT OUTER JOIN perch2_resources r2 ON r2.resourceParentID=r1.resourceID AND r2.resourceKey='thumb' AND r2.resourceAWOL!=1 WHERE r1.resourceKey='orig' AND r1.resourceAWOL=0 ORDER BY r1.resourceUpdated DESC, r1.resourceID DESC LIMIT 0, 30
Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'r2.resourceWidth' in 'field list'
SELECT FOUND_ROWS() AS `count`
SELECT DISTINCT resourceType FROM perch2_resources WHERE resourceAWOL=0 AND resourceType !="" ORDER BY resourceType ASC
Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'resourceAWOL' in 'where clause'
SELECT DISTINCT resourceBucket FROM perch2_resources WHERE resourceAWOL=0 AND resourceType !="" ORDER BY resourceType ASC
Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'resourceAWOL' in 'where clause'
Queries: 6
Memory: 2.0886

When I checked error logs, I see:

(13)Permission denied: /home/xxx/public_html/stage/cms/resources/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: https://stage.xxx.com.au/cms/core/apps/assets/

Never seen this before, not sure what Perch needs with htaccess file but I set folder permissions on resources folder to 666.

I saved install warnings as a PDF if you want to see - can email.

Any help much appreciated!

Cheers, Stuart.

Stuart Farrell

Stuart Farrell 0 points

  • 6 years ago

FYI - the images do actually save on the server - can see them in FTP. They are getting processed to as per template settings...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you try rerunning the update? This time please note any message you get rather than just clearing them.

/perch/core/update/?force=update

OK, done... these are the messages:


Debug Message SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 SHOW TABLES LIKE 'perch2_resource_log' ALTER TABLE `perch2_resources` ADD `resourceCreated` DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00' AFTER `resourceType` ALTER TABLE `perch2_resources` ADD `resourceUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `resourceCreated` ALTER TABLE `perch2_resources` ADD `resourceAWOL` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `resourceUpdated` ALTER TABLE `perch2_resources` ADD INDEX `idx_awol` (`resourceAWOL`) ALTER TABLE `perch2_resources` ADD `resourceTitle` CHAR(255) NULL DEFAULT NULL AFTER `resourceAWOL` ALTER TABLE `perch2_resources` ADD `resourceFileSize` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `resourceTitle` ALTER TABLE `perch2_resources` ADD `resourceWidth` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `resourceFileSize` ALTER TABLE `perch2_resources` ADD `resourceHeight` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `resourceWidth` ALTER TABLE `perch2_resources` ADD `resourceCrop` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `resourceHeight` ALTER TABLE `perch2_resources` ADD `resourceDensity` FLOAT NOT NULL DEFAULT '1' AFTER `resourceCrop` ALTER TABLE `perch2_resources` ADD `resourceTargetWidth` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `resourceDensity` ALTER TABLE `perch2_resources` ADD `resourceTargetHeight` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `resourceTargetWidth` ALTER TABLE `perch2_resources` ADD `resourceMimeType` CHAR(64) NULL DEFAULT NULL AFTER `resourceTargetHeight` ALTER TABLE `perch2_resources` ADD FULLTEXT INDEX `idx_search` (`resourceTitle`) ALTER TABLE `perch2_resources` ADD `resourceInLibrary` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `resourceMimeType` ALTER TABLE `perch2_resources` ADD INDEX `idx_library` (`resourceInLibrary`) CREATE TABLE IF NOT EXISTS `perch2_resource_tags` ( `tagID` INT(10) NOT NULL AUTO_INCREMENT, `tagTitle` VARCHAR(255) NOT NULL DEFAULT '', `tagSlug` VARCHAR(255) NOT NULL DEFAULT '', `tagCount` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`tagID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CREATE TABLE IF NOT EXISTS `perch2_resources_to_tags` ( `resourceID` int(10) NOT NULL DEFAULT '0', `tagID` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`resourceID`,`tagID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED CREATE TABLE IF NOT EXISTS `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 DEFAULT '0', `resourceID` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`logID`), KEY `idx_resource` (`resourceID`), KEY `idx_fk` (`itemFK`,`itemRowID`), UNIQUE KEY `idx_uni` (`appID`,`itemFK`,`itemRowID`,`resourceID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('assets.create','Upload assets',1) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'assets.create' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('assets.manage','Manage assets',2) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'assets.manage' for key 'idx_key' CREATE TABLE IF NOT EXISTS `perch2_categories` ( `catID` int(10) NOT NULL AUTO_INCREMENT, `setID` int(10) unsigned NOT NULL, `catParentID` int(10) unsigned NOT NULL DEFAULT '0', `catTitle` char(64) NOT NULL DEFAULT '', `catSlug` char(64) NOT NULL DEFAULT '', `catPath` char(255) NOT NULL DEFAULT '', `catDisplayPath` char(255) NOT NULL DEFAULT '', `catOrder` int(10) unsigned NOT NULL DEFAULT '0', `catTreePosition` char(255) NOT NULL DEFAULT '000', `catDynamicFields` text NOT NULL, PRIMARY KEY (`catID`), KEY `idx_set` (`setID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 CREATE TABLE IF NOT EXISTS `perch2_category_sets` ( `setID` int(10) NOT NULL AUTO_INCREMENT, `setTitle` char(64) NOT NULL DEFAULT '', `setSlug` char(64) NOT NULL DEFAULT '', `setTemplate` char(255) NOT NULL DEFAULT 'set.html', `setCatTemplate` char(255) NOT NULL DEFAULT 'category.html', `setDynamicFields` text, PRIMARY KEY (`setID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('categories.create','Create new categories',1) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'categories.create' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('categories.delete','Delete categories',2) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'categories.delete' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('categories.manage','Manage categories',3) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'categories.manage' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('categories.sets.create','Create category sets',4) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'categories.sets.create' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('categories.sets.delete','Delete category sets',5) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'categories.sets.delete' for key 'idx_key' CREATE TABLE IF NOT EXISTS `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 DEFAULT '0', `resourceID` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`logID`), KEY `idx_resource` (`resourceID`), KEY `idx_fk` (`itemFK`,`itemRowID`), UNIQUE KEY `idx_uni` (`appID`,`itemFK`,`itemRowID`,`resourceID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ALTER TABLE `perch2_content_regions` ADD `regionUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `regionEditRoles` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'regionUpdated' ALTER TABLE `perch2_content_items` ADD `itemUpdated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `itemSearch` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'itemUpdated' ALTER TABLE `perch2_content_items` ADD `itemUpdatedBy` CHAR(32) NOT NULL DEFAULT '' AFTER `itemUpdated` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'itemUpdatedBy' ALTER TABLE `perch2_pages` ADD `pageTemplate` CHAR(255) NOT NULL DEFAULT '' AFTER `pageAttributeTemplate` ALTER TABLE `perch2_pages` ADD `templateID` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `pageTemplate` ALTER TABLE `perch2_pages` ADD `pageSubpageTemplates` VARCHAR(255) NOT NULL DEFAULT '' AFTER `templateID` ALTER TABLE `perch2_pages` ADD `pageCollections` VARCHAR(255) NOT NULL DEFAULT '' AFTER `pageSubpageTemplates` CREATE TABLE IF NOT EXISTS `perch2_category_counts` ( `countID` int(10) unsigned NOT NULL AUTO_INCREMENT, `catID` int(10) unsigned NOT NULL, `countType` char(64) NOT NULL DEFAULT '', `countValue` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`countID`), KEY `idx_cat` (`catID`), KEY `idx_cat_type` (`countType`,`catID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ALTER TABLE `perch2_categories` CHANGE `catDisplayPath` `catDisplayPath` CHAR(255) NOT NULL DEFAULT '' DROP INDEX `idx_uni` ON `perch2_resource_log` ALTER IGNORE TABLE `perch2_resource_log` ADD UNIQUE INDEX `idx_uni` (`appID`, `itemFK`, `itemRowID`, `resourceID`) ALTER TABLE `perch2_users` ADD `userPasswordToken` CHAR(255) NOT NULL DEFAULT 'expired' AFTER `userMasterAdmin` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'userPasswordToken' ALTER TABLE `perch2_users` ADD `userPasswordTokenExpires` DATETIME NOT NULL DEFAULT '2015-01-01 00:00:00' AFTER `userPasswordToken` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'userPasswordTokenExpires' SHOW TABLES LIKE 'perch2_resource_log' SELECT COUNT(*) FROM perch2_resource_log SHOW TABLES LIKE 'perch2_content_index' CREATE TABLE IF NOT EXISTS `perch2_content_index` ( `indexID` int(10) NOT NULL AUTO_INCREMENT, `itemID` int(10) NOT NULL DEFAULT '0', `regionID` int(10) NOT NULL DEFAULT '0', `pageID` int(10) NOT NULL DEFAULT '0', `itemRev` int(10) NOT NULL DEFAULT '0', `indexKey` char(64) NOT NULL DEFAULT '-', `indexValue` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`indexID`), KEY `idx_key` (`indexKey`), KEY `idx_val` (`indexValue`), KEY `idx_rev` (`itemRev`), KEY `idx_item` (`itemID`), KEY `idx_keyval` (`indexKey`,`indexValue`), KEY `idx_regrev` (`regionID`,`itemRev`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 CREATE TABLE IF NOT EXISTS `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 '', PRIMARY KEY (`resourceID`), UNIQUE KEY `idx_file` (`resourceBucket`,`resourceFile`), KEY `idx_app` (`resourceApp`), KEY `idx_key` (`resourceKey`), KEY `idx_type` (`resourceType`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ALTER TABLE `perch2_content_items` ADD INDEX `idx_regrev` USING BTREE (itemID, regionID, itemRev) Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_regrev' ALTER TABLE `perch2_content_items` ADD INDEX `idx_order` USING BTREE (itemOrder) Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_order' ALTER TABLE `perch2_content_regions` ADD INDEX `idx_key` USING BTREE (regionKey) Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_key' ALTER TABLE `perch2_content_regions` ADD INDEX `idx_path` USING BTREE (regionPage) Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_path' ALTER TABLE `perch2_page_templates` ADD `templateNavGroups` VARCHAR(255) NULL DEFAULT '' AFTER `templateReference` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'templateNavGroups' CREATE TABLE IF NOT EXISTS `perch2_navigation` ( `groupID` int(10) NOT NULL AUTO_INCREMENT, `groupTitle` varchar(255) NOT NULL DEFAULT '', `groupSlug` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`groupID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 CREATE TABLE IF NOT EXISTS `perch2_navigation_pages` ( `navpageID` int(10) unsigned NOT NULL AUTO_INCREMENT, `pageID` int(10) unsigned NOT NULL DEFAULT '0', `groupID` int(10) unsigned NOT NULL DEFAULT '0', `pageParentID` int(10) unsigned NOT NULL DEFAULT '0', `pageOrder` int(10) unsigned NOT NULL DEFAULT '1', `pageDepth` tinyint(10) unsigned NOT NULL, `pageTreePosition` varchar(64) NOT NULL DEFAULT '', PRIMARY KEY (`navpageID`), KEY `idx_group` (`groupID`), KEY `idx_page_group` (`pageID`,`groupID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC ALTER TABLE `perch2_user_privileges` ADD UNIQUE INDEX `idx_key` (`privKey`) Invalid query: SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('content.navgroups.configure','Configure navigation groups',7), ('content.navgroups.create','Create navigation groups',8), ('content.navgroups.delete','Delete navigation groups',9) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'content.navgroups.configure' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('content.pages.create.toplevel','Add new top-level pages',3) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'content.pages.create.toplevel' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('content.pages.delete.own','Delete pages they created themselves',4) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'content.pages.delete.own' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('content.templates.configure','Configure master pages',6) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'content.templates.configure' for key 'idx_key' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('content.pages.republish','Republish pages', 12) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'content.pages.republish' for key 'idx_key' ALTER TABLE `perch2_pages` ADD `pageAccessTags` VARCHAR(255) NOT NULL DEFAULT '' AFTER `pageNavOnly` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pageAccessTags' ALTER TABLE `perch2_pages` ADD `pageCreatorID` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `pageAccessTags` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pageCreatorID' ALTER TABLE `perch2_pages` ADD `pageModified` DATETIME NOT NULL DEFAULT '2014-01-01 00:00:00' AFTER `pageCreatorID` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pageModified' ALTER TABLE `perch2_pages` ADD `pageAttributes` TEXT NOT NULL AFTER `pageModified` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pageAttributes' ALTER TABLE `perch2_pages` ADD `pageAttributeTemplate` VARCHAR(255) NOT NULL DEFAULT 'default.html' AFTER `pageAttributes` Invalid query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'pageAttributeTemplate' INSERT INTO `perch2_user_privileges` (`privKey`, `privTitle`, `privOrder`) VALUES ('content.pages.attributes','Edit page titles and attributes',6) Invalid query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'content.pages.attributes' for key 'idx_key' CREATE TABLE IF NOT EXISTS `perch2_user_role_privileges` ( `roleID` int(10) unsigned NOT NULL, `privID` int(10) unsigned NOT NULL, PRIMARY KEY (`roleID`,`privID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 DELETE FROM perch2_settings WHERE settingID='update_2.8.13' AND userID=0 LIMIT 1 INSERT INTO perch2_settings(settingID,settingValue,userID) VALUES('update_2.8.13','done',0) Queries: 79
Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you get any messages other than debug information?

Yes, just "Successfully updated to version 2.8.13."

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the issue persist?

Issue was persisting but slightly differently - the placeholder on upload was now showing in Assets but the image was still broken in CMS and in front end.

So I changed the folder permissions on "resources" to 755 and it now works!!

Can we expect current images already uploaded show up in Assets? Should we force another update to do this??

I saved an Event and the images on this entry then showed up in Assets. So I assume the best option is to do a "Republish"?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try a republish and see if that helps.

Global republish didn't work.... but publishing individual pages does - it updates Assets with any images used on page. A bit annoying but it's a small site so all good.

So that force update did the trick, in combination with permission check/change on folder.

Thanks!