An unexpected error occurred.

Permalink Browser Info Environment
This add-on has downed a site I'm working on. The error seems common now that I'm reading the other issues posted here. What can be done to resolve this?

An unexpected error occurred.
An exception occurred while executing 'select COUNT(*) as c from PagePassword where cID=? UNION select COUNT(*) as c from PagePassword where `recursive`=1' with params ["59"]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'taberc5_sci.PagePassword' doesn't exist

Type: Pre-Sale
Status: In Progress
tabercreative
View Replies:
hanicker replied on at Permalink Reply
hanicker
Hi. It seems that the installation didn't create the needed mysql tables.
If you have access to the mysql server (eg. through phpmyadmin) can you try running
CREATE TABLE IF NOT EXISTS PagePassword (cID INT UNSIGNED NOT NULL, passwordID INT UNSIGNED NOT NULL, `recursive` INT DEFAULT NULL, PRIMARY KEY(cID, passwordID)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `PagePasswordPasswords` (
  `passwordID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `value` longtext COLLATE utf8_unicode_ci,
  PRIMARY KEY (`passwordID`)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

If not possible can you pm me a temporary ftp access so that I can try to run them manually?
Thanks

Regards
tabercreative replied on at Permalink Reply
tabercreative
That worked! Thanks for getting back so quickly on this. Very helpful.
tabercreative replied on at Permalink Reply 1 Attachment
tabercreative
I made the same changes to the production site and got the following error. Any ideas?

An unexpected error occurred.
An exception occurred while executing 'select COUNT(*) as c from PagePassword where cID=? UNION select COUNT(*) as c from PagePassword where recursive=1' with params ["59"]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'recursive=1' at line 1
hanicker replied on at Permalink Reply
hanicker
The production server is using MariaDB instead of Mysql

Which version of c5 are you using?
If it is lower than 5.7 you may want to try replacing files with
https://www.dropbox.com/s/fhdqdn4gx67psof/page_password.zip?dl=0...

Regards
tabercreative replied on at Permalink Reply
tabercreative
I experienced the same failure to install on both servers. Unfortunately, we're running almost the latest c5 version:

# concrete5 Version
Core Version - 8.4.0
Version Installed - 8.4.0
Database Version - 20180524000000

# PHP Version
7.1.7
hanicker replied on at Permalink Reply
hanicker
Hi, the last version should work correctly. Can you please try replacing all files with this package?
https://www.dropbox.com/s/fhdqdn4gx67psof/page_password.zip?dl=0...

Thanks
Regards
tabercreative replied on at Permalink Reply
tabercreative
Sorry, I misunderstood what you said about c5 being lower than 5.7.

I used that package and still got the error. Then I uninstalled and deleted all tables in the DB, reinstalled and it worked!

Thanks for your help!
hanicker replied on at Permalink Reply
hanicker
It's strange, the last version should work correctly. Can you try
replacing all files with this package?
https://www.dropbox.com/s/fhdqdn4gx67psof/page_password.zip?dl=0...

Thanks
Regards


2018-07-25 1:28 GMT+02:00 concrete5 Community <[email protected]>:
taocode replied on at Permalink Reply 1 Attachment
taocode
I've encountered this error when upgrading the database from Maria DB 10.3.7 to 10.5. Without digging too deeply, it seems that 'recursive' is now a reserved word like 'number' or 'integer'. In my case, adding escaped single quotes around \'recursive\' solved the error.

My modifications to "page_password/src/Models/PagePasswordModel.php"
Line 94: 
            $r = $db->query('select COUNT(*) as c from PagePassword where cID=? UNION select COUNT(*) as c from PagePassword where \'recursive\'=1', array($cID));
Line 124:
            $r = $db->query('select value from PagePassword,PagePasswordPasswords where cID=? AND PagePassword.passwordID=PagePasswordPasswords.passwordID union select value from PagePassword,PagePasswordPasswords where cID in ('.implode(',', $cIDs).') AND PagePassword.passwordID=PagePasswordPasswords.passwordID AND \'recursive\'=1', array($cID));


Or see the attached file for the diff/patch.

Mark
rich5 replied on at Permalink Reply 1 Attachment
rich5
Hi I'm seeing this error when I try and install page password.
hanicker replied on at Permalink Reply
hanicker
Hi, can you please try installing this package instead?
https://drive.google.com/file/d/1hNPcs4AesiNL4g9dpFW77uDMZdpRCnUL/vi...
Thanks
rich5 replied on at Permalink Reply
rich5
Thanks that works. 👍

concrete5 Environment Information

Can't view. Site is down

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.