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 CiviEvent (Moderator: Yashodha Chaku) »
  • Mapping/geocoding causes error on registration
Pages: [1]

Author Topic: Mapping/geocoding causes error on registration  (Read 845 times)

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
Mapping/geocoding causes error on registration
July 11, 2014, 08:38:58 am
We've just located our site to Stablehost and have run into an odd problem.  With Google mapping enabled and an API entered, and with Yahoo geocoding enabled, people who register for our events get this error after submitting:

Quote
Sorry but we are not able to provide this at the moment.
php_network_getaddresses: getaddrinfo failed: Name or service not known
Return to home page.

Our developer dug through the error logs to discover this:

Quote
#4 /home/****/public_html/sites/all/modules/civicrm/packages/Net/Socket.php(156): PEAR->raiseError("php_network_getaddresses: getaddrinfo failed: Name or service not known", 0)
#5 /home/****/public_html/sites/all/modules/civicrm/packages/HTTP/Request.php(737): Net_Socket->connect("query.yahooapis.com", 80, NULL, NULL, NULL)
(I redacted our username from the path)

Once we turned off mapping/geocoding, things worked fine.  Stablehost support has already eliminated firewalls as the problem.

Interestingly, we were getting the same error message when we had SMTP enabled for e-mailing of confirmations, etc., and Stablehost support suggested that I use the IP address instead of the server name in the server settings, and that cleared the problem right up.

If I wanted to substitute the Google and Yahoo IP addresses for the server names, any idea where in the code I might find that?  I probably wouldn't leave it that way, but it would be a good way to test whether there's some sort of problem resolving hostnames.
« Last Edit: July 11, 2014, 08:42:24 am by tmccartney »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Mapping/geocoding causes error on registration
July 13, 2014, 03:11:33 am
See here http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/ for ideas.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
Re: Mapping/geocoding causes error on registration
July 14, 2014, 07:28:10 am
I think I'd seen that, and based on that and other suggestions, I dug around and finally found /civicrm/CRM/Utils/Geocode/google.php, which appears to define the server for the Google mapping/geocoding info.

I pinged the server that appears in that file, maps.googleapis.com, and my ping got redirected to googleapis.l.google.com.  So I commented out the first and substituted the second.

That SEEMS to have fixed the problem.  I don't know whether maps.googleapis.com truly doesn't work for anyone, or whether for some reason the server I'm on couldn't deal with the redirection.  I haven't seen any other posts on this forum with this particular issue.

tl;dr: Go to /civicrm/CRM/Utils/Geocode/google.php and change maps.googleapis.com to googleapis.l.google.com.
« Last Edit: July 16, 2014, 02:45:35 pm by tmccartney »

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
Re: Mapping/geocoding causes error on registration
July 14, 2014, 08:09:58 am
Also, I set up a new event on the demo site (http://drupal.demo.civicrm.org/civicrm/event/info?reset=1&id=7) and set it to have the location mapped, but no map shows up on the event's information page.  Is the demo site configured not to show maps, or does the demo installation perhaps have the same issue, but it causes the map to just not show up rather than, in my case, causing the registration to fail?

If the server name in that google.php file needs to be updated, I'll file an issue.

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Mapping/geocoding causes error on registration
July 14, 2014, 04:16:05 pm
demo has no mapping provider set.

http://drupal.demo.civicrm.org/civicrm/admin/setting/mapping?reset=1

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
Re: Mapping/geocoding causes error on registration
July 15, 2014, 08:06:39 am
Aaaaand the error is back.  Just gonna have to turn off mapping.  >:(

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Re: Mapping/geocoding causes error on registration
July 16, 2014, 02:30:59 pm
Not sure if my problem is related, but today one of my clients had problems inserting new contacts.  The cause was Google geocoding timing out - although no other client reported this.  I changed the geocoding from Google to Yahoo and lo, it now works!  Looking at your second post I wonder whether the change of Google server name is involved in this, although that looks too simple...
Andy Clark

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Mapping/geocoding causes error on registration

This forum was archived on 2017-11-26.