SQL Error after enabling the module.
dsegonds - October 31, 2007 - 22:12
| Project: | SEO Checklist |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Description
Hello,
Thank you for this module. It is promising. However, I had to disable it since I got the following errors right after using it.
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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'term_access'))) in /home/xxx/public_html/drupal/includes/database.mysql.inc on line 172.
any clues?

#1
I got the following 3 errors when installing the latest version
# user warning: Table 'seo_subgroup' already exists query: CREATE TABLE `seo_subgroup` ( `id` tinyint(4) NOT NULL auto_increment, `group_id` tinyint(4) NOT NULL default '0', `name` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) in /Users/MartinC/WebSites/hospcrew_20071030/includes/database.mysql.inc on line 172.# user warning: Table 'rastarr_hosp20071030.hospseo_subgroup' doesn't exist query: INSERT INTO hospseo_subgroup VALUES (1, 2, 'The second most important thing you can do'), (2, 2, 'Choose one:') in /Users/MartinC/WebSites/hospcrew_20071030/includes/database.mysql.inc on line 172.
# user warning: Table 'rastarr_hosp20071030.seo_checklist' doesn't exist query: INSERT INTO `seo_checklist` (`id`, `group_id`, `subgroup_id`, `name`, `module`, `download`, `enable`, `configure`, `order_id`) VALUES (1, 1, 0, 'Page Title Module', 'page_title', 'http://drupal.org/project/page_title', '?q=admin/build/modules', '?q=admin/settings/page_title', 1), (2, 2, 1, 'Clean URLs - Activate (Usually automatic but double check!)', '', '', '', '?q=admin/settings/clean-urls', 1), (3, 2, 1, 'Find URL Alias Module', 'find_path', '
#2
I'm using Drupal 5.3,
I, too, am getting error messages.
This is what I see when logged in as a normal user (non-admin):
user warning: 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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 5 AND na.realm = 'og_subscriber'))) in /home/.chagall/testing12/wellnessgame.com/includes/database.mysql.inc on line 172.
This is what I see when I log out:
user warning: 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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public'))) in /home/.chagall/testing12/wellnessgame.com/includes/database.mysql.inc on line 172.
After I disable the SEO Checklist module, the error messages go away.
I have Organic Groups enabled. If I disable it, I get the following error message while still logged in:
user warning: 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 '= '1') AND (.og_type = '0') ORDER BY node_title ASC LIMIT 0, 10' at line 1 query: SELECT DISTINCT(node.nid), node.title AS node_title, node.changed AS node_changed FROM node node WHERE (node.status = '1') AND (.currentuidsimple = '1') AND (.og_type = '0') ORDER BY node_title ASC LIMIT 0, 10 in /home/.chagall/testing12/wellnessgame.com/includes/database.mysql.inc on line 172.
If I re-enable OG, the error message goes away.
After I log out, I get a slightly different error message than the one when I was previously logged out:
user warning: 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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) in /home/.chagall/testing12/wellnessgame.com/includes/database.mysql.inc on line 172.
After disabling, uninstalling, and deleting both the SEO Checklist and OG modules from my test web site, I still have the following when logged in to my admin account:
user warning: 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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) in /home/.chagall/testing12/wellnessgame.com/includes/database.mysql.inc on line 172.
I'm purging my test site and starting over until this gets sorted out.
#3
Hi All,
I am Ganesh, working on this project. I am not getting, the actual reason for all these issues. I have already tested this module in 5.1, 5.2 and also on 5.3 version however didn't get any such database issue.
Could you please elaborate steps you followed? or exactly when did you get this problem?
Please uninstall module once and reinstall it.
For uninstalling module follow these steps:
Go to the admin/site building/Module page disable SEOChecklist module.
At the top of same module page you will find two tabs list and uninstall. Please click on uninstall, check SEOChecklist module and confirm uninstall SEOChecklist module.
#4
I don't know about the errors other seo checklist users noted on this page, but I can duplicate the error I posted in #2 above. I was able to recreate the error after having completely purged all my files, directories, and database, and starting with a fresh install of Drupal 5.3 and a new (empty) database.
I only have three contributed modules installed at this time:
1) seo checklist
2) organic groups
3) views
I enabled them.
On seo checklist, I clicked on the "Check" button to the right of "Check for already Installed Modules". I didn't do anything else on that page. It automatically put a "check" in the box to the left of "Check for already Installed Modules" (see screenshot -SEO- Checklist - Wellness Game_1194466306281.png).
I then went through the process of setting up organic groups by following its README file. Organic groups requires the Views contributed module (and its Views RSS) to be enabled. When I clicked "Save configuration" on the modules page, it automatically (I believe) enabled "Views UI" that is part of the "Views" module (see screenshot Modules - Wellness Game_1194465724453.png).
I logged out.
I then got this error message again (see screenshot Wellness Game_1194465170890.png):
user warning: 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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public'))) in /home/.chagall/testing12/wellnessgame.com/includes/database.mysql.inc on line 172.
After I log back in to my admin account, the error message disappears (see screenshot Wellness Game_1194465371906.png).
So it appears, at least in my situation, that seo checklist and organic groups do not play nicely together. I'm removing seo checklist and going to simply follow its excellent guidance by following it off of the OpenOffice word document I saved its text into.
I'm suspecting that seo checklist has some issue on line 172 that is causing issues. I'm not a developer and that is about as much as I can help you with. Good luck! You might want to try asking on IRC's #drupal-support or some other appropriate Drupal channel on IRC.
#5
And by the way, if you want to know what my test site is running on, visit:
http://wellnessgame.com/phpInfo.php
I'm now going to, again, purge my test site files, directories, and database to work on other things which means I won't be able to help in recreating this issue due to time constraints on my end. However, I feel somewhat confident that you have enough to go on to fix things.
Thanks!
#6
Am also seeing SQL errors when installing. The steps to reproduce are pretty simple: 1. download and untar module; 2. Enable module. As soon as the module is enable the following errors are returned:
user warning: Table 'seo_subgroup' already exists query: CREATE TABLE `seo_subgroup` ( `id` tinyint(4) NOT NULL auto_increment, `group_id` tinyint(4) NOT NULL default '0', `name` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) in /home/liam/public_html/stockdrupal/includes/database.mysqli.inc on line 151.user warning: Table 'stockdrupal.twf_seo_subgroup' doesn't exist query: INSERT INTO twf_seo_subgroup VALUES (1, 2, 'The second most important thing you can do'), (2, 2, 'Choose one:') in /home/liam/public_html/stockdrupal/includes/database.mysqli.inc on line 151.
user warning: Table 'stockdrupal.seo_checklist' doesn't exist query: INSERT INTO `seo_checklist` (`id`, `group_id`, `subgroup_id`, `name`, `module`, `download`, `enable`, `configure`, `order_id`) VALUES (1, 1, 0, 'Page Title Module', 'page_title', 'http://drupal.org/project/page_title', '?q=admin/build/modules', '?q=admin/settings/page_title', 1), (2, 2, 1, 'Clean URLs - Activate (Usually automatic but double check!)', '', '', '', '?q=admin/settings/clean-urls', 1), (3, 2, 1, 'Find URL Alias Module', 'find_path', 'http://drupal.org/project/find_path', '?q=admin/build/modules', '', 2), (4, 2, 2, 'Simple: URLify Module', 'urlify', 'http://drupal.org/project/urlify', '?q=admin/build/modules', '?q=admin/settings/urlify', 1), (5, 2, 2, 'Powerful: Pathauto Module', 'pathauto', 'http://drupal.org/project/pathauto', '?q=admin/build/modules', '?q=admin/settings/pathauto', 2), (6, 2, 1, 'Global Redirect Module', 'globalredirect', 'http://drupal.org/project/globalredirect', '?q=admin/build/modules', '', 3), (7, 3, 0, 'Get a Google Account - You''ll need this for several of the steps that follow - <a href=''https://www.google.com/accounts/NewAccount''>https://www.google.com/accounts/NewAccount</a>', '', '', '', '', 1), (8, 3, 0, 'Get a Yahoo Account - You''ll need this for steps that follow - <a href=''http://www.yahoo.com/r/m7''>http://www.yahoo.com/r/m7</a>', '', '', '', '', 2), (9, 4, 0, 'Google Analytics Module', 'google_analytics', 'http://drupal.org/project/google_analytics', '?q=admin/build/modules', '?q=admin/settings/googleanalytics', 1), (10, 4, 0, 'Sign in to your Google Analytics Account - <a href=''http://www.google.com/analytics''>http://www.google.com/analytics</a>', '', '', '', '', 2), (11, 4, 0, 'Create an Analytics for your website', '', '', '', '', 3), (12, 4, 0, 'Paste Google Analytics code into Google Analytics Module', '', '', '', '', 4), (13, 4, 0, 'Authenticate your site with Google Analytics', '', '', '', '', 5), (14, 5, 0, 'Excerpt Module', 'excerpt', 'http://drupal.org/project/excerpt', '?q=admin/build/modules', '', 1), (15, 5, 0, 'Meta Tags Module (AKA Nodewords)', 'nodewords', 'http://drupal.org/project/nodewords', '?q=admin/build/modules', '?q=admin/content/nodewords', 2), (16, 5, 0, 'Scheduler Module', 'scheduler', 'http://drupal.org/project/scheduler', '?q=admin/build/modules', '', 3), (17, 5, 0, 'Safe HTML Module', 'safehtml', 'http://drupal.org/project/safehtml', '?q=admin/build/modules', '?q=admin/settings/filters/1', 4), (18, 5, 0, 'Search 404 Module', 'search404', 'http://drupal.org/project/search404', '?q=admin/build/modules', '?q=admin/settings/search404', 5), (19, 6, 0, 'Validate your site - <a href=''http://validator.w3.org/''>http://validator.w3.org/</a>', '', '', '', '', 1), (20, 6, 0, 'Check your links - <a href=''http://validator.w3.org/checklink''>http://validator.w3.org/checklink</a>', '', '', '', '', 2), (21, 7, 0, 'XML Sitemap Module', 'gsitemap', 'http://drupal.org/project/gsitemap', '?q=admin/build/modules', '?q=admin/settings/gsitemap', 1), (22, 7, 0, 'Login to Google Webmaster Tools - <a href=''http://www.google.com/webmasters/tools''>http://www.google.com/webmasters/tools</a>', '', '', '', '', 2), (23, 7, 0, 'Authenticate your site with Google', '', '', '', '', 3), (24, 7, 0, 'Submit your XML Sitemap to Google - <a href=''www.google.com/webmasters/sitemaps/''>www.google.com/webmasters/sitemaps/</a>', '', '', '', '', 4), (25, 7, 0, 'Login to Yahoo Site Explorer Account - <a href=''https://siteexplorer.search.yahoo.com/''>https://siteexplorer.search.yahoo.com/</a>', '', '', '', '', 5), (26, 7, 0, 'Authenticate your site with Yahoo', '', '', '', '', 6), (27, 7, 0, 'Submit your XML Sitemap to Yahoo - <a href=''https://siteexplorer.search.yahoo.com/submit''>https://siteexplorer.search.yahoo.com/submit</a>', '', '', '', '', 7), (28, 7, 0, 'Submit your XML Sitemap to MSN - <a href=''http://search.msn.com/docs/submit.aspx''>http://search.msn.com/docs/submit.aspx</a>', '', '', '', '', 8), (29, 7, 0, 'If appropriate, submit your company to Google Local - <a href=''www.google.com/webmasters/sitemaps/''>https://www.google.com/local/add/login</a>', '', '', '', '', 9), (30, 8, 0, 'Digg This Module', 'diggthis', 'http://drupal.org/project/diggthis', '?q=admin/build/modules', '?q=admin/settings/diggthis', 1), (31, 8, 0, 'Service Links Module', 'service_links', 'http://drupal.org/project/service_links', '?q=admin/build/modules', '?q=admin/settings/service_links', 2), (32, 8, 0, 'Trackback Module', 'trackback', 'http://drupal.org/project/trackback', '?q=admin/build/modules', '?q=admin/settings/trackback', 3), (33, 9, 0, 'Captcha Module', 'captcha', 'http://drupal.org/project/captcha', '?q=admin/build/modules', '?q=admin/user/captcha', 1), (34, 9, 0, 'Akismet Module', 'akismet', 'http://drupal.org/project/akismet', '?q=admin/build/modules', '?q=admin/settings/akismet', 2), (35, 9, 0, 'http:BL Module', 'httpbl', 'http://drupal.org/project/httpbl', '?q=admin/build/modules', '?q=admin/settings/httpbl', 3), (36, 9, 0, 'Spam Module', 'spam', 'http://drupal.org/project/spam', '?q=admin/build/modules', '?q=admin/settings/spam', 4), (37, 10, 0, 'Google Proxy Hacking Protector Module', 'antiproxyhack', 'http://drupal.org/project/antiproxyhack', '?q=admin/build/modules', '', 1), (38, 10, 0, 'Path Redirect Module', 'path_redirect', 'http://drupal.org/project/path_redirect', '?q=admin/build/modules', '', 2) in /home/liam/public_html/stockdrupal/includes/database.mysqli.inc on line 151.
Looking at this, my problem seems to be because the database abstraction is not being used correctly. I've not got time to look at the code, but if you want to test this setup a site with shared tables and table prefixes.
#7
yep.. this innocnet looking module was the reason behind all the mysql errors i got. my drupal site which was working fine until i installed this module, the site started to act crazy and for guest users it started to display this error
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 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: select linked_seo from seo_checklist where id=1 INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'term_access'))) in /home/techtree/public_html/drupal/includes/database.mysql.inc on line 172.after i uninstalled it.. everything is back to normal. :)
so long seo module.
#8
Great intentions by the author though.
I nabbed all the info on some of the needed modules from the screen shot in post #4 above.
Hopefully the author can iron out the bugs so others don't get slammed.
#9
Thanks for the feedback. We've rewritten part of the module to hopefully address this issue. Walt, I tried using OG with this new version following your steps and I didn't get any errors. Hopefully that means that it's resolved now. I'm uploading to the repository now. Although I'm still new at this so give me an hour or two to figure it out. Thanks! I'll attach the file here, too, if you don't want to wait.
#10
Please reopen this case if the new file does not fix the problem for you. Thanks!
#11
Hi, I'm reopening this issue because I've just come across it again.
This module was working fine until an update (to version 6.x-2.0) came through today, which triggered it off. This is what I got:
user warning: Duplicate entry 'sites/all/modules/seo_checklist/seochecklist.module' for key 1 query: INSERT INTO system (name, info, type, filename, status, throttle, bootstrap) VALUES ('seochecklist', 'a:10:{s:4:\"name\";s:15:\"\"SEO\" Checklist\";s:11:\"description\";s:52:\"A Search Engine Optimization checklist for Drupal 6.\";s:4:\"core\";s:3:\"6.x\";s:7:\"package\";s:15:\"\"SEO\" Checklist\";s:7:\"version\";s:7:\"6.x-2.0\";s:7:\"project\";s:13:\"seo_checklist\";s:9:\"datestamp\";s:10:\"1249685460\";s:12:\"dependencies\";a:0:{}s:10:\"dependents\";a:0:{}s:3:\"php\";s:5:\"4.3.5\";}', 'module', 'sites/all/modules/seo_checklist/seochecklist.module', 0, 0, 0) in /var/www/development/habitathq/includes/module.inc on line 147.#12
I also have the same error on upgrading from the now unsupported beta3
#13
Exactly the same thing happened to my installation after trying to upgarde from 1.0-beta3 to 2.0.
#14
To upgrade from pre 2.x versions of the module, you must delete the entries relating to the module from your database. That means that you will lose all SEO Checklist data when you upgrade. (That will not be the case going forward but it's an unfortunate side effect of jumping from 1.x to 2.x.)
Follow these steps:
1. Backup your database & print off the SEO Checklist page from the admin screen. (This is to be sure you have a copy of your old data.)
2. Uninstall the module on the admin/modules page.
3. Go into your site's database and find the table called "system".
4. Delete the row whose "name" field has the value "SEOchecklist".
From the console it would be something like:
mysql> use ;
mysql> DELETE FROM 'system' WHERE 'name'='SEOchecklist';
You could also do this from a graphical manager like Webmin or phpMyAdmin.
5. Delete the old module from your sites/all/modules directory.
6. Install the new module and turn it on.
#15
ok - I was lazy and only read the readme.txt in the download.