Unable to geocode (no provider could reverse coordinates)
alexc-hollywood opened this issue · 6 comments
General Information
GeocoderLaravel Version: 1.0.3
Laravel Version: 5.4
PHP Version: 7.1
Operating System and Version:
Mac OS X Yosemite
Issue Description
Getting this exception with any geocode, or reverse geocode. Note it's not the OpenSSL issue - am running the latest version on Yosemite. Using Guzzle 6 adapter, Gmaps API key is fine.
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.0.2k 26 Jan 2017
OpenSSL Header Version OpenSSL 1.0.2k 26 Jan 2017
Openssl default config /usr/local/etc/openssl/openssl.cnf
Steps to Replicate
$result = Geocoder::reverse(40.712784, -74.005941)->all(); // NYC
Stack Trace
[2017-04-05 18:26:35] local.ERROR: Geocoder\Exception\ChainNoResult: No provider could reverse coordinates: 40.712784, -74.005941. in /Users/site/vendor/willdurand/geocoder/src/Geocoder/Provider/Chain.php:75
Stack trace:
#0 /Users/site/vendor/willdurand/geocoder/src/Geocoder/ProviderAggregator.php(74): Geocoder\Provider\Chain->reverse(40.7127837, -74.0059413)
#1 /Users/site/vendor/toin0u/geocoder-laravel/src/ProviderAndDumperAggregator.php(96): Geocoder\ProviderAggregator->reverse(40.7127837, -74.0059413)
#2 /Users/site/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Geocoder\Laravel\ProviderAndDumperAggregator->reverse(40.7127837, -74.0059413)
#3 /Users/site/app/Http/Controllers/FHApp/BaseController.php(256): Illuminate\Support\Facades\Facade::__callStatic('reverse', Array)
#4 /Users/site/app/Traits/GeoSearchHelper.php(364): Acme\Http\Controllers\FHApp\BaseController->reverse_geocode(40.7127837, -74.0059413)
#5 /Users/site/app/Http/Controllers/FHApp/BrowseController.php(98): Acme\Http\Controllers\FHApp\BrowseController->resolve_search_url(Object(Illuminate\Http\Request), 'personal-traine...', 'all', 'new-york-ny-uni...', '40.7127837,-74....')
#6 [internal function]: Acme\Http\Controllers\FHApp\BrowseController->show_results_screen(Object(Illuminate\Http\Request), 'personal-traine...', 'all', 'new-york-ny-uni...', '40.7127837,-74....')
#7 /Users/site/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(55): call_user_func_array(Array, Array)
#8 /Users/site/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction('show_results_sc...', Array)
#9 /Users/site/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Acme\Http\Controllers\FHApp\BrowseController), 'show_results_sc...')
I will try to replicate this and report back. Thanks for the report!
Hi @azcoppen, I ran your reverse query through my unit tests and it resolves without error. It must be a configuration issue. Are you getting this after upgrading from a pre-1.0 version? If so, be sure to delete your custom configuration file, and only create a new one if your settings differ from the default provided. (You don't need to publish the config file to use it.)
Try using app('geocoder')->reverse(....)->all();
instead of the Facade, to see if you get a different result (it should not make a difference). Also, be sure that you haven't declared the facade in your config\app.php
file. (Remove it if you do.)
I get the exact same error if I test on the Mac where OpenSSL is not updated or running. I'll bet that if you try this on an actual server or VM it will work. Let me know what you turn up. (Reopen if this continues to be an issue, closing for now.)
Thanks for looking into it - am going to test on a VM. All i can think is that my PHP version is still using the old OpenSSL, as the config file is fine, and the error occurs with or without the facade.
You might try renaming the config file so that it falls back to the default config and see if that works. I can only get this to run inside a VM as well, so I think that's probably what you're seeing here.
10-4 - works in the VM, but not on OS X, so it has to be OpenSSL somehow (phpinfo looks fine). Incidentally, the results have changed data format, so i had to fix that as well. All OK now.
Awesome! :)