Forum

Thread tagged as: Error, Installation

Errors upon Upgrading from 2.0.6 to 2.5.2

Hi,

Just upgraded from 2.0.6 to 2.5.2 and got the following errors upon logging into Perch. Not sure what to do about these.

Andrew

Software Update The following error occurred: ALTER TABLE perch2_resources ADD resourceCreated DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00' AFTER resourceType SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER resourceCreated SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceAWOL TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER resourceUpdated SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD INDEX idx_awol (resourceAWOL) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceTitle CHAR(255) NULL DEFAULT NULL AFTER resourceAWOL SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceFileSize INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceTitle SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceWidth INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceFileSize SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceHeight INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceWidth SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceCrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER resourceHeight SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceDensity FLOAT NOT NULL DEFAULT '1' AFTER resourceCrop SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceTargetWidth INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceDensity SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceTargetHeight INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceTargetWidth SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceMimeType CHAR(64) NULL DEFAULT NULL AFTER resourceTargetHeight SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD FULLTEXT INDEX idx_search (resourceTitle) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceInLibrary TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER resourceMimeType SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD INDEX idx_library (resourceInLibrary) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist

Andrew Rossborough

Andrew Rossborough 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like you have some tables missing from your install. Was this upgraded from Perch 1 or anything like that?

Nope, straight from Perch 2.0.6. I should add the site seems to be working fine. No missing content that I can see. Just wanted to check what these errors were and if they're going to cause me problems.

OK so I am seeing some some interesting characters in my content. For example ' is displaying as ’.

Something to do with the MarkItUp! Editor?

OK now things have started to break!

I installed the Twitter app and imported some tweets. That all seemed to work. Then I edited my index.php file to add the tweets to the homepage and uploaded this. When I returned to perch the original errors posted above appeared again, and when I clicked 'continue' I could see that a number of pages had lost their navigation structure (appearing alongside pages they should have been subpages of). When I clicked into Page Details I got the following error:

The page attribute template (templates/pages/attributes/default.html) could not be found.

I can add that folder from the perch 2.5.2 zip I downloaded, but the navigation structure is still broken as described above.

Any thoughts?

Andrew

I should also add that the Twitter settings and Tweets I imported have also disappeared.

I've manually fixed the navigation structure and restored the missing twitter data, but I'm still concerned about those errors and if they'll cause me problems in the future.

Also still seeing the issue with special characters displaying incorrectly.

Any help you could provide would be greatly appreciated.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you follow the "note about database connections"? https://grabaperch.com/update/v2-1

No, that'll teach me to skip versions! Thanks, that's fixed the special character issue. Do you think I need to do anything else about those errors above?

Looks like it's having trouble finding the perch2_resources table. When I log into phpmyadmin I can see that table but it's empty.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You should be good to copy the templates/pages/attributes folder from the download to your site. That should clear that message.

What's the next error you're getting?

Sorry, yes I've done that already. The errors I'm referring to are in the first post. I got them when I upgraded from 2.0.6 to 2.5.2. I've posted them again below.

Software Update The following error occurred: ALTER TABLE perch2_resources ADD resourceCreated DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00' AFTER resourceType SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceUpdated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER resourceCreated SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceAWOL TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER resourceUpdated SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD INDEX idx_awol (resourceAWOL) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceTitle CHAR(255) NULL DEFAULT NULL AFTER resourceAWOL SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceFileSize INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceTitle SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceWidth INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceFileSize SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceHeight INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceWidth SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceCrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER resourceHeight SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceDensity FLOAT NOT NULL DEFAULT '1' AFTER resourceCrop SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceTargetWidth INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceDensity SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceTargetHeight INT(10) UNSIGNED NULL DEFAULT NULL AFTER resourceTargetWidth SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceMimeType CHAR(64) NULL DEFAULT NULL AFTER resourceTargetHeight SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD FULLTEXT INDEX idx_search (resourceTitle) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD resourceInLibrary TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER resourceMimeType SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist The following error occurred: ALTER TABLE perch2_resources ADD INDEX idx_library (resourceInLibrary) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bartonch_stage.perch2_resources' doesn't exist

Drew McLellan

Drew McLellan 2638 points
Perch Support

So the error is Table 'bartonch_stage.perch2_resources' doesn't exist but you're saying that the table does exist?

Yep, it's definitely there!

Drew McLellan

Drew McLellan 2638 points
Perch Support

If the table is empty, are you able to delete it? I wonder if it may have become corrupt.

Perch should recreate it if it's missing.

I was able to delete it ok. How do I get Perch to recreate it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Just refresh the page that's showing the error. If that doesn't work, run this in PHPMyAdmin:

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 DEFAULT CHARSET=utf8;

Thanks Drew, that worked.

Drew McLellan

Drew McLellan 2638 points
Perch Support

All set now?