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 »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • DB Error with EmailProcessor.php : Table not found
Pages: [1]

Author Topic: DB Error with EmailProcessor.php : Table not found  (Read 2618 times)

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
DB Error with EmailProcessor.php : Table not found
January 24, 2011, 01:07:32 pm
Hello,

I'm having problems getting the emailprocessor.php working.  If I go to the following URL, entering the correct credentials for username, password, and mysitekey:

http://example.org/sites/all/modules/civicrm/bin/EmailProcessor.php?name=username&pass=password&key=mysitekey

I get a "DB Error: no such table" as seen in the attached screenshot.  When I try to click on the 'Error Details' nothing happens (this might be a civicrm bug?).  When I view the source, the problem says:

                                        <div class="crm-section">Database Error Code: Table 'caseye_drupal.users' doesn't exist, 1146</div>
                                        <div class="crm-section">Additional Details: <p><pre>Array

The correct table should really be caseye_drupal.drupal_users because the drupal tables are prefixed with drupal_.  I don't know where to define this prefix though.

One other thing, where am I supposed to put this line in my config file?:

Code: [Select]
define( 'CIVICRM_SITE_KEY', 'mysitekeyhere' );
   

currently I put it right above  the last section of code.  Not sure if this is correct, the manual didn't say:

Code: [Select]
define( 'CIVICRM_SITE_KEY', '3cx4aNkpQwxmM1hTMVxxx' );

    // FIXME: problem spot for Drupal 5.1 config dir layout
    $conf = "$confdir/default";
    return $conf;
}

include_once civicrm_conf_init( ) . '/civicrm.settings.php';

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 24, 2011, 07:50:42 pm
OK so I figured out the DB Error problem.  You have to adjust the setting at http://www.example.org/civicrm/admin/setting/uf?reset=1.  I do not believe it mentions this in the manual, but it probably should.

I figured out where to adjust the CIVICRM_SITE_KEY for drupal and modified the wiki for this.

Problem is, now when I try to go to the URL
http://example.org/sites/all/modules/civicrm/bin/EmailProcessor.php?name=username&pass=password&key=mysitekey

Now I get the error "ERROR: Invalid username and/or password".  Not sure if this is referring to the GMail account or the Drupal account.  I've tried both; neither work.

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 06:11:24 pm
Anyone have any ideas?  I've quadruple-checked the settings, tried different users, tried different email accounts (all gmail), but nothing works.  I still get the "ERROR: Invalid username and/or password " error.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 06:21:41 pm
Doc for command line scripts is here:
http://wiki.civicrm.org/confluence/display/CRMDOC33/Command-line+Script+Configuration

The username and pass are Drupal username and password.
Quote
    * name - Valid username for an authorized Drupal or Joomla user. A CiviCRM contact associated with this user must exist.
    * pass - Associated password for that user
    * key - The value of the CiviCRM site key from your settings file (see below)
Protect your investment in CiviCRM by  becoming a Member!

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 06:29:12 pm
I did this.  I put a site key that I generated into /sites/default/civicrm.settings.php .  I go to http://www.mysite.org/sites/all/modules/civicrm/bin/EmailProcessor.php?name=mydrupalusername&pass=mydrupalpassword&key=mysitekeyIgenerated

I get "ERROR: Invalid username and/or password".  I've tried this with a specific mailer drupal account I created as well as my own master drupal account.  There are no special characters in either password or username.

It seems to be failing CRM_Utils_System::authenticate( $name, $pass ); in line 476 of sites/all/modules/civicrm/CRM/Utils/System.php.  I have no idea why this is happening.  If I just tell the script to die() right there and print my username and password, they are correct, but $result=bool(false).

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 06:36:14 pm
Hmm - I guess dig a bit further into CRM/Utils/System/Drupal.php authenticate() and see what's up. Wondering if your table prefix isn't set there or ???

You can use this wrapper to spit out variable values as you debug:

CRM_Core_Error::debug('varname', $someVar);

Protect your investment in CiviCRM by  becoming a Member!

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 06:53:33 pm
The prefix table is set correctly.  I set it at /civicrm/admin/setting/uf?reset=1 to 'drupal_users', which is correct.  Is there someplace else I should be editing this?

I have some authentication plug-ins (e.g. Facebook Sign On) which is the only thing I can think of that might be causing an issue somehow, but I disabled it.

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 06:54:52 pm
Is there some safe mode or any php setting that I might have configured incorrectly that could be causing this to screw up?

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 09:49:15 pm
An update: I did a fresh install on a test subdomain and was able to get it working (well, it read and got to the end of the INBOX, so I'm guessing it will work).  Something is probably interfering with the authentication system, so I will have to troubleshoot it.  This isn't going to be fun :(.

FYI, we are using Google Apps for our domain.  I originally set up a bounce mailbox through our google email system, but this was causing an ezcMailTransportException error when trying to run EmailProcessor.php.  When I changed it to a test account on a different domain the email script worked fine.  I feel like people will definitely run into this problem... it should probably be noted in the documentation somewhere.

CaseyE

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
    • Logic Bloc
  • CiviCRM version: 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.1.52
  • PHP version: 5.2.4
Re: DB Error with EmailProcessor.php : Table not found
January 26, 2011, 10:25:33 pm
I found the problem; I feel like an idiot.

I have two drupal sites installed on my host, each with their own MySQL database.  One of those databases is called "drupal", the database is the name of my organization.  When I installed civicrm, I set it up using the drupal database for "drupal" instead of "myorg".  These past several days of installation have been sharing data into the wrong system!  Stupid mistake, but fortunately its not that much data.

The usernames and passwords are different for both databases, so it obviously couldn't authenticate.

So question: How do I link this to the correct drupal database, after install?

Is it just changing the define( 'CIVICRM_UF_DSN'           , ) line in civicrm.settings.php?  Is there anything special I need to be aware of?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: DB Error with EmailProcessor.php : Table not found
January 27, 2011, 09:45:15 am
CIVICRM_UF_DSN, CIVICRM_DSN settings, plus make sure directory paths are correct for that site  (civicrm_root, CIVICRM_TEMPLATE_COMPILEDIR). Verify Drupal table prefix. Also note that some CiviCRM DB settings are specific to your site's URL and directory location - so if you've moved stuff around you should verify "Base Directory" in DB by navigating to Administer > Configure > Update Directory Path and URL.
Protect your investment in CiviCRM by  becoming a Member!

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: DB Error with EmailProcessor.php : Table not found
March 28, 2011, 06:36:18 am
OK I'm now struggling with this... trying to get the EmailProcessor.php script to run and coming up against the cryptic "table not found" error page...

after doing a view source it seems that the ?drupal table prefix has been dropped :

so Database Error Code: Table 'antarql_webcalendar.users' doesn't exist, 1146

the correct table is: antarql_webcalendar.myprefix_users

so it's not picking up the prefix any clues?

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: DB Error with EmailProcessor.php : Table not found
March 28, 2011, 06:43:09 am
adit - ok think i found it:

http://www.example.org.au/civicrm/admin/setting/uf&reset=1

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • DB Error with EmailProcessor.php : Table not found

This forum was archived on 2017-11-26.