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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Synchronize Users - error, 'users' table doesn't exist
Pages: [1]

Author Topic: Synchronize Users - error, 'users' table doesn't exist  (Read 4478 times)

fm

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 1
Synchronize Users - error, 'users' table doesn't exist
March 26, 2010, 12:17:32 pm
I just received the message below while configuring "Synchronize Users to Contacts" on a fresh installation. Any idea what I goofed up, or how I can get around this? This is a Drupal 6.16 installation with CiviCRM 3.1.3

Sorry. A non-recoverable error has occurred.
DB Error: no such table

Database Error Code: Table '<civicrm db>.users' doesn't exist, 1146

Return to home page.

Error Details:


Code: [Select]
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT uid, mail, name FROM users where mail != '' [nativecode=1146 ** Table '<civicrm db>.users' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT uid, mail, name FROM users where mail != '' [nativecode=1146 ** Table '<civicrm db>.users' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT uid, mail, name FROM users where mail != '' [nativecode=1146 ** Table '<civicrm db>.users' doesn't exist]"]
)
[/code]

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Synchronize Users - error, 'users' table doesn't exist
March 26, 2010, 04:19:35 pm
It should be looking in your Drupal DB for that table. Seems like you pointed CiviCRM to the CiviCRM database and not the Drupal database when prompted for the Drupal database datasource info. Check this setting in sites/default/civicrm.settings.php:

define( 'CIVICRM_UF_DSN'          , 'check this value' );
Protect your investment in CiviCRM by  becoming a Member!

fm

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 1
Re: Synchronize Users - error, 'users' table doesn't exist
March 26, 2010, 09:45:00 pm
You are correct. It looks like I goofed up exactly that. Can I just substitute the correct info for the Drupal db on that line, or do I need to also change data elsewhere?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Synchronize Users - error, 'users' table doesn't exist
March 30, 2010, 10:44:14 am
Changing that line should fix things.
Protect your investment in CiviCRM by  becoming a Member!

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Synchronize Users - error, 'users' table doesn't exist
April 09, 2010, 05:14:24 pm
i actually have the correct db there, and it gives me the error also. Any ideas why?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Synchronize Users - error, 'users' table doesn't exist
April 10, 2010, 07:21:46 am
Might want to double check both the value and that you're looking at the right civicrm.settings.php file (to 'prove it' - if this is NOT a production site, you can try breaking the syntax in that file by removing a semi-colon and see that you got a fatal error trying to load a civicrm page). If that doesn't clarify, paste the exact error here.
Protect your investment in CiviCRM by  becoming a Member!

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Synchronize Users - error, 'users' table doesn't exist
April 10, 2010, 07:54:23 am
I caused a syntax error, just as expected. so, i can conclude it is the correct civicrm settings file.

is there a db prefix for .users i should be entering into my drupal settings file? if not, then is there any reason you can imagine why civicrm wouldn't be able to find the drupalDB.users table?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Synchronize Users - error, 'users' table doesn't exist
April 10, 2010, 11:56:54 am
It is possible to have prefixes on your Drupal tablenames. So check your Drupal DB schema or your drupal settings file for that, and if you're using a prefix you need to update this setting in CiviCRM from Administer >> Configure >> Global Settings >> CMS Integration screen.
Protect your investment in CiviCRM by  becoming a Member!

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Synchronize Users - error, 'users' table doesn't exist
April 11, 2010, 07:30:36 am
there is no prefix set for that, because at line 79 of the settings file, it is commented out.
/ *
...
 *   $db_prefix = array(
 *     'default'   => 'main_',
 *     'users'     => 'shared_',
 *     'sessions'  => 'shared_',
 *     'role'      => 'shared_',
 *     'authmap'   => 'shared_',
 *   );
...
*/

But, i'm still confused about why the user sync wouldn't work. drupal is able to get the civicrm data in views just fine... which means at least drupal knows civicrm's tables (due to the long string of civicrm prefixes set in the settings file)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Synchronize Users - error, 'users' table doesn't exist
April 11, 2010, 07:50:02 am

you might want to dive into the code and check whats happening (CRM/Core/BAO/UFMatch.php). Alternatively hire someone from http://civicrm.org/professional/ to help you figure things out for this and the civiroles module questions

lob
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

thollowood

  • Guest
Re: Synchronize Users - error, 'users' table doesn't exist
April 12, 2010, 04:05:57 pm
You might want to look in http://www.yoursite.org/civicrm/admin/setting/uf?reset=1  and see what the Drupal Users Table Name is.

Usually it is" Users".  Based on what I saw in your post, you might have a multi-site drupal setup and therefore a different filename such as "shared_users" in your drupal database.

You can look it up to be sure,  or just try changing it to shared_users and see if it works. (Just remember to reset it and check your tables if it doesn't) .

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Synchronize Users - error, 'users' table doesn't exist
April 12, 2010, 04:12:03 pm
FIXED!~
thanks for the replies everyone.

users is the default for drupal, so, technically in the cms integration field, 'users' is correct... And for some reason the string in the civi settings file wasn't being read correctly. so i copy pasted the string from the drupal settings file and stuck it in civi. It then worked perfectly after clearing all caches.  there must have been some sort of typo or inconsistency between them that i wasn't noticing...but even so, i'm confused as to why civicrm would have allowed the install if it wasn't correct.

i copied: mysqli://username:password@localhost/databasename from drupal's settings file,
pasted it inside: define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true');

Also, the drupal one was encrypted (?) and the civi field is not by default, which is kinda strange.

DougAnderson

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
Re: Synchronize Users - error, 'users' table doesn't exist
April 16, 2010, 04:36:30 pm
I have this problem too.

I have followed all the suggestions and still have the same problem. The database names all appear to be in the correct place.

The users table does exist and has data in it.

I'm fairly new to this but when I look in php-myadmin all the drupal files are prefaced with drupal_ i.e drupal_users, and the civicrm files are prefaced civicrm_ . I'm assuming this is normal but nothing else seems to work.

Everything else on the site seems to work, although it's a bit slow.

Doug

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Re: Synchronize Users - error, 'users' table doesn't exist
April 16, 2010, 04:39:01 pm
you can help the slowness bit by clearing all the site caches (look at the devel module) or also go to Site Configuration > Performance, scroll to the bottom, clear cache.

DougAnderson

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
Re: Synchronize Users - error, 'users' table doesn't exist
April 17, 2010, 10:20:46 am
Following up on my own comment. I added drupal_ in front of users under Global Settings > CMS integration and it now works. So my users file is dxxxxxx.drupal_users

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Synchronize Users - error, 'users' table doesn't exist

This forum was archived on 2017-11-26.