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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • UpdateAddress script only works sometimes
Pages: [1]

Author Topic: UpdateAddress script only works sometimes  (Read 1012 times)

Erich

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 1
UpdateAddress script only works sometimes
July 29, 2010, 06:53:54 am
I have several (similar) sites for which I'm trying to populate the geocoding data.

In all cases, I did not do the address mapping at the time the data were imported, because the number of records being imported ranged from 1600+ to 4500+

For some sites, everything appeared to work as expected, except that I had to run UpdateAddress multiple times (i.e. first time through I got messages of the form
"Addresses Evaluated: NNN Addresses Geocoded : NNN Street Address Parsed : NNN"
when I run the geocoding script, and after successive reruns I eventually got
"Addresses Evaluated: 0 Addresses Geocoded : 0 Street Address Parsed : 0"
Double-checking the civicrm_address table for addresses where geo_code_1 is null for these,
I get 0 results (i.e. all rows have geocoding set).

But for other sites, no matter how many times I reran UpdateAddress, I would get to the
"Addresses Evaluated: NNN Addresses Geocoded : NNN Street Address Parsed : NNN" point
(where NNN was different depending on the site) and NNN would never get any smaller
and double-checking the civicrm_address table for addresses where geo_code_1 is null returns NNN rows.

I don't have telnet or ssh access to my host, so I have to run UpdateAddress via URL.  Any ideas how I can try to debug what is (or isn't, in this case) going on?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: UpdateAddress script only works sometimes
July 29, 2010, 11:46:11 am
For the site where additional addresses get geocoded onsubsequent runs, you might be hitting the web-services request limit. My understanding is that for Google Maps API this is "2,500 geocode requests in a 24 hour period are received from a single IP address"

http://code.google.com/apis/maps/faq.html#geocoder_limit

Depending on timing of running the script for your other sites, and the originating IP, this might also be affecting them?? Or might be speed of requests. You could try changing the THROTTLE_REQUESTS constant on top of the script from 0 to 1 and see if that helps.

Looking at the underlying geocoding method - I "think" we write a message to the CiviCRM log file if we get an error / something other than the expected geocode data. So the other thing to do is to check your log file for errors (should be in <joomla_root>/media/civicrm/templates_c/en_US/ConfigAndLog directory).

Protect your investment in CiviCRM by  becoming a Member!

Erich

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 1
Re: UpdateAddress script only works sometimes
July 29, 2010, 08:50:42 pm
There's nothing in my ConfigAndLog directory... but I'm sure that's due in part to something I noticed after moving my CiviCRM instance from the development site to the production site, and following the procedure in http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location.

I noticed that the record in the civicrm_domain table still had the old location specified in the config_backend field for the "configAndLogDir" location (and I can't find where in the administration menus this location is specified).  The configAndLogDir location was also *not* fixed by running the administrator/components/com_civicrm/civicrm/bin/migrate/move.php (nor did this script make the required changes to the directories in Administer > Administration Console > Configure > Global Settings > Directories.

Here's the output from the move.php script (which I assume just does steps 5 through 8 of the procedure in the wiki???):

Quote
Beginning site move process...
Directory and Resource URLs have been updated in the moved database to reflect current site location.
Template cache and upload directory have been cleared.
Database cache tables cleared.
Session has been reset.

If no errors are displayed above, the site move steps have completed successfully. Please visit your moved site and test the move.

But here's what's in the civicrm_domain's config_backend field after the script was run ... BTW I should point out that the CIVICRM_TEMPLATE_COMPILEDIR specified in civicrm.settings.php has the correct values for these directories:

Quote
a:80:{s:9:"uploadDir";s:56:"old_directory/media/civicrm/upload/";s:14:"imageUploadDir";s:68:"old_directory/media/civicrm/persist/contribute/";s:19:"customFileUploadDir";s:56:"old_directory/media/civicrm/custom/";s:17:"customTemplateDir";s:0:"";s:16:"customPHPPathDir";s:0:"";s:21:"includeWildCardInName";s:1:"1";s:18:"includeEmailInName";s:1:"1";s:21:"includeNickNameInName";s:1:"0";s:24:"includeAlphabeticalPager";s:1:"1";s:20:"includeOrderByClause";s:1:"1";s:22:"smartGroupCacheTimeout";s:1:"0";s:22:"defaultSearchProfileID";s:0:"";s:25:"autocompleteContactSearch";a:7:{i:1;i:1;i:2;i:1;i:3;i:1;i:4;i:1;i:5;i:1;i:6;i:1;i:7;i:0;}s:16:"enableComponents";a:2:{i:0;s:8:"CiviMail";i:1;s:10:"CiviReport";}s:18:"enableComponentIDs";a:2:{i:0;s:1:"4";i:1;s:1:"8";}s:11:"mapProvider";s:6:"Google";s:9:"mapAPIKey";s:86:"ABQIAAAA--qoU0y9Yd2D5qK3iJtq_BQ2VBW0bmJlj0RzrCaStqLYaQvbAhQseI3FH-DI2JlLcVUkbyHNVrL93Q";s:13:"userFramework";s:6:"Joomla";s:15:"configAndLogDir";s:73:"different_old_directory/media/civicrm/templates_c/en_US/ConfigAndLog/";s:11:"initialized";s:1:"0";s:15:"DAOFactoryClass";s:23:"CRM_Contact_DAO_Factory";s:17:"componentRegistry";O:18:"CRM_Core_Component":0:{}s:9:"inCiviCRM";s:0:"";s:18:"recaptchaPublicKey";s:0:"";s:5:"debug";s:1:"0";s:9:"backtrace";s:1:"0";s:9:"smartyDir";s:0:"";s:10:"pluginsDir";s:0:"";s:11:"templateDir";s:0:"";s:12:"resourceBase";s:0:"";s:14:"imageUploadURL";s:76:"http://new_url/media/civicrm/persist/contribute/";s:12:"countryLimit";a:1:{i:0;s:4:"1228";}s:13:"provinceLimit";a:1:{i:0;s:4:"1228";}s:21:"defaultContactCountry";s:4:"1228";s:15:"defaultCurrency";s:3:"USD";s:10:"lcMessages";s:5:"en_US";s:18:"dateformatDatetime";s:20:"%B %E%f, %Y %l:%M %P";s:14:"dateformatFull";s:11:"%B %E%f, %Y";s:17:"dateformatPartial";s:5:"%B %Y";s:14:"dateformatYear";s:2:"%Y";s:14:"dateformatTime";s:8:"%l:%M %P";s:15:"timeInputFormat";s:1:"1";s:15:"dateInputFormat";s:8:"mm/dd/yy";s:15:"fiscalYearStart";a:2:{s:1:"M";i:1;s:1:"d";i:1;}s:11:"moneyformat";s:5:"%c %a";s:16:"moneyvalueformat";s:3:"%!i";s:10:"lcMonetary";s:5:"en_US";s:15:"currencySymbols";s:0:"";s:21:"defaultCurrencySymbol";s:1:"$";s:20:"monetaryDecimalPoint";s:1:".";s:25:"monetaryThousandSeparator";s:1:",";s:14:"gettextCodeset";s:5:"utf-8";s:13:"gettextDomain";s:7:"civicrm";s:20:"userFrameworkVersion";s:6:"1.5.17";s:27:"userFrameworkUsersTableName";s:9:"jos_users";s:24:"userFrameworkResourceURL";s:88:"http://new_url/administrator/components/com_civicrm/civicrm/";s:21:"userFrameworkFrontend";s:0:"";s:20:"userFrameworkLogging";s:0:"";s:17:"maxImportFileSize";s:7:"1048576";s:14:"maxAttachments";s:1:"3";s:7:"civiHRD";s:1:"0";s:13:"geocodeMethod";s:0:"";s:12:"mapGeoCoding";s:1:"1";s:12:"versionCheck";s:1:"1";s:9:"enableSSL";s:0:"";s:18:"fatalErrorTemplate";s:20:"CRM/common/fatal.tpl";s:17:"fatalErrorHandler";s:0:"";s:14:"legacyEncoding";s:12:"Windows-1252";s:14:"fieldSeparator";s:1:",";s:17:"maxLocationBlocks";s:1:"2";s:15:"captchaFontPath";s:25:"/usr/X11R6/lib/X11/fonts/";s:11:"captchaFont";s:17:"HelveticaBold.ttf";s:21:"dashboardCacheTimeout";s:4:"1440";s:15:"doNotResetCache";s:1:"0";s:13:"oldInputStyle";s:1:"1";s:14:"formKeyDisable";s:0:"";s:13:"verpSeparator";s:1:".";s:12:"mailerPeriod";s:3:"180";s:16:"mailerSpoolLimit";s:1:"0";s:16:"mailerBatchLimit";s:1:"0";}

I'm on Joomla 1.5.17, in case that makes a difference.
« Last Edit: July 29, 2010, 09:13:02 pm by Erich »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: UpdateAddress script only works sometimes
August 02, 2010, 08:27:28 am
You should also verify $civicrm_root in both copies of the CiviCRM settings file (civicrm.settings.php) - one is in <joomla_root>/components/com_civicrm, and the other on <joomla_root>/administrator/components/com_civicrm.

If those are correct, than I would go through the steps on the Moving Existing Server... wiki page manually.
Protect your investment in CiviCRM by  becoming a Member!

Erich

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 1
Re: UpdateAddress script only works sometimes
October 08, 2010, 11:26:46 am
$civicrm_root in both copies of the CiviCRM settings file verified (in particular, the CIVICRM_TEMPLATE_COMPILEDIR value), and the Moving+an+Existing+Installation steps executed manually... but the configAndLogDir setting still wasn't updated in civicrm_domain.config_backend

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • UpdateAddress script only works sometimes

This forum was archived on 2017-11-26.