CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Insufficient permissions to webform_civicrm_forms
Pages: [1]

Author Topic: Insufficient permissions to webform_civicrm_forms  (Read 1213 times)

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Insufficient permissions to webform_civicrm_forms
September 08, 2014, 11:35:34 am
Hi, I'm posting here since the issue appears related to the Webform/Civicrm table, but I'm not sure how.  If the issue is better located elsewhere, I'll be happy to move it.

I'm trying to access Administer > Localization > Address Settings with my super user account (Drupal user 1).  When I click on the menu link (/civicrm/admin/setting/preferences/address?reset=1), I get the below screen (I've switched out my db username and Drupal database name):

Code: [Select]
DB Error: insufficient permissions
Error Details
Database Error Code: SELECT command denied to user 'civicrm_db_default_user'@'localhost' for table 'webform_civicrm_forms', 1142
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -26
    [message] => DB Error: insufficient permissions
    [mode] => 16
    [debug_info] => SELECT cforms.nid, node.title FROM drupal_db.webform_civicrm_forms cforms
JOIN drupal_db.node ON cforms.nid = node.nid AND node.status = 1  [nativecode=1142 ** SELECT command denied to user 'civicrm_db_default_user'@'localhost' for table 'webform_civicrm_forms']
    [type] => DB_Error
    [user_info] => SELECT cforms.nid, node.title FROM drupal_db.webform_civicrm_forms cforms
JOIN drupal_db.node ON cforms.nid = node.nid AND node.status = 1  [nativecode=1142 ** SELECT command denied to user 'civicrm_db_default_user'@'localhost' for table 'webform_civicrm_forms']
    [to_string] => [db_error: message="DB Error: insufficient permissions" code=-26 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT cforms.nid, node.title FROM drupal_db.webform_civicrm_forms cforms
JOIN drupal_db.node ON cforms.nid = node.nid AND node.status = 1  [nativecode=1142 ** SELECT command denied to user 'civicrm_db_default_user'@'localhost' for table 'webform_civicrm_forms']"]
)

I'm not sure how the Webform CiviCRM table on my Drupal database is related to the CiviCRM Address Settings.  And I'm not sure how to resolve.  I tried yesterday giving my Civicrm db user the sufficient permissions in the Drupal database, but the permissions got all messed up and I had to delete my user and start over (I'm admittedly a newbie in the SQL realm).  That was not fun.  I've been able to access the Address Settings screen before (it's probably been months since the last time, so a lot has transpired since then).  We're on Drupal 7, CiviCRM 4.4.6, Webform 7.x-4.0-rc4, Webform CiviCRM Integration 7.x-4.8.

Any ideas anybody on how to get back my Address Settings screen?  Thanks!

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 09, 2014, 02:29:19 am
Quote
I'm not sure how the Webform CiviCRM table on my Drupal database is related to the CiviCRM Address Settings

Me either but lets put that to one side for a second.

It looks like you CiviCRM db user is being asked to access to Drupal DB, which seems reasonable to me.
http://wiki.civicrm.org/confluence/display/CRMDOC/Drupal+Installation+Guide+for+CiviCRM+4.4+-+Drupal+6#DrupalInstallationGuideforCiviCRM4.4-Drupal6-6.RuntheInstaller doesn't clearly state whether this is necessary. It does say
Quote
CiviCRM may be configured to use your existing Drupal database, or a separate (new) database. Using a separate database is generally preferred - as it makes backups and upgrades easier. The installer will create a new database for CiviCRM automatically if you enter a database name that doesn't already exist on your database server AND the database user you enter has permission to create databases. In case the installer does not automatically create a new database, simply create a new one following the same process as creating a new database for Drupal. Note that if you plan to use the Drupal Views module to display CiviCRM data within your Drupal pages, and if you are going to use separate databases for Drupal and CiviCRM, you need to ensure that your Drupal database user has SELECT permissions for your CiviCRM database.

That isn't a definitive answer. Once we find out the answer it would be great if you could update the docs, please :)

Bottom line, this is a MySQL permissions issue and if you gave those users permission to access both databases, the problem would go away.  In which case you might as well just have one user than can access both databases.  That is what I always do, anyway.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 09, 2014, 02:31:06 am
Quote
I tried yesterday giving my Civicrm db user the sufficient permissions in the Drupal database, but the permissions got all messed up and I had to delete my user and start over (I'm admittedly a newbie in the SQL realm).  That was not fun.

Sorry - you might have to try again - always easier the second time and good to learn in any case :)

That or work out why the CiviCRM user is trying to query a drupal table.

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Insufficient permissions to webform_civicrm_forms
September 09, 2014, 01:38:20 pm
does turning webform_civicrm module off remove the problem temporarily?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 09, 2014, 10:10:23 pm
Gentlemen, thanks so much for your thoughtful responses.  Pete, you nailed a short-term fix.  I turned off the webform_civicrm module for a few minutes and was able to access the address settings screen to make the change I needed.  The moment I turned the module back on, the error came up again.

Michael, thank you for your encouragement. It appears that unless upgrading to Webform 4.0 (from 4.0-rc4) fixes my issue, I'll have to get back on the horse and tackle the slippery world of MySQL permissions.  Here's to learning!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Insufficient permissions to webform_civicrm_forms
September 09, 2014, 10:12:53 pm
this won't help other than to confirm that there are many sites running civicrm and webform and webform_civicrm that are not having this issue - and i would be surprised if there were any db permissions that would trip w_c up specifically
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 09, 2014, 10:20:17 pm
I suspect you're right, Pete. This one threw me for a loop, and it just doesn't seem to be a code-based/caused issue.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 10, 2014, 04:12:34 am
Quote
tackle the slippery world of MySQL
yeah - have the same user for civicrm and drupal should definitley fix
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Insufficient permissions to webform_civicrm_forms
September 10, 2014, 12:38:09 pm
Ah ha! I thought I recognized that code. Here it is:
https://github.com/sgladstone/com.pogstone.fancytokens/blob/master/fancytokens.php#L106
Try asking your question on the new CiviCRM help site.

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 10, 2014, 01:04:26 pm
Coleman!!! Yes!!! I had just installed the Fancy Tokens extension last week. Just disabled it and everything came back.  Thank you, thank you, thank you!

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 11, 2014, 05:06:23 am
I will update the README for my "fancy tokens" extension so that the database user permission requirement is mentioned.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 11, 2014, 06:28:39 am
Readme has been updated. See https://github.com/sgladstone/com.pogstone.fancytokens/blob/master/README.md
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Insufficient permissions to webform_civicrm_forms
September 11, 2014, 08:44:39 am
Thank you, Sarah!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Insufficient permissions to webform_civicrm_forms

This forum was archived on 2017-11-26.