Problem
On local site version regular authorised users cannot access custom content type. This is after doing work on permissions, deleting and changing settings on various modules[0], then rolling back changes from a remote site version that worked.

Actions taken

  • Restore via BAM (via S3, from working remote to local)
  • Restore DB without compression (no changes to site files - via S3 again)
  • Download site DB without compression locally, drop local DB, create local DB, import mysql file
  • Same as previous but deleting the --comment lines at the start of the file.

You'd have thought the last two would have given me a fresh replica of the working remote, but it does not. Instead I get the following error when trying to view the custom content type as an authorised user (admin, or user/1 works):

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (c.nid = '1207')' at line 2: SELECT COUNT(*) AS expression FROM {comment} c INNER JOIN {node} n ON n.nid = .nid WHERE (c.nid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1207 ) in PagerDefault->execute() (line 74 of /usr/share/nginx/html/includes/pager.inc).

Have tried rebuilding permissions, repairing site tables (via optimize_db), clearing caches etc.

Is this something anyone's seen before?

EDIT: I have since also restored from Nodesquirrel and tried to reimport a dump into a new database (granting all privileges to existing user and flushing those privileges). Still no dice. Nothing else has changed, BAM restores used to work fine. If I have got extra tables or permissions issues hanging around in there, where could they be?

--
[0] - og_access, node_view_permissions - I couldn't see an edit tab on the group node, solved by adding edit link to a view elsewhere.

Comments

luxpir’s picture

Issue summary: View changes
mobius_time’s picture

I ran into the same error in Backup And Migrate 7.28. I updated the module to 7.31 and had the same problem.

The site works fine on the production server. When I use BAM to backup the DB and then import the DB onto my local system (via either BAM Restore or via phpMyAdmin), I get this error.

I've worked around this problem for right now by exporting the DB via phpMyAdmin on the production server, then importing the DB via phpMyAdmin on my local system.

mobius_time’s picture

Still getting the error when I log in as an administrator, even with my workaround. Think my problem is not related to BAM after all.

luxpir’s picture

Thanks for the update - we disabled a module (private_comments) and the problem went away. I'm suspicious that that was the only issue though, as it seemed to come at a time after playing with DB/restoring, not when updating/altering that module - it all worked fine previously.

Ardit Meti’s picture

I have this issue too #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TABLE IF EXISTS `backup_migrate_destinations`;
CREATE TABLE `backup_migrate' at line 2

couturier’s picture

Status: Active » Closed (works as designed)

This sounds like a local, manual work-around.