fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
486 stars 301 forks source link

Geonames error #2981

Closed DaPoHou closed 4 years ago

DaPoHou commented 4 years ago

When the geonames database is used for automatic improvement, the log will generate the following error: file_get_contents(http://api.geonames.org/searchJSON?name_startsWith=%E9%BE%99%E4%B8%AD%2C%E9%BE%99%E5%B1%B1%E7%A4%BE%E5%8C%BA%2C%E5%AE%98%E5%B1%B1%E9%95%87%2C%E7%9D%A2%E5%AE%81%E5%8E%BF%E5%BE%90%E5%B7%9E%E5%B8%82&amp;amp;lang=zh-Hans&amp;amp;fcode=CMTY&amp;amp;fcode=ADM4&amp;amp;fcode=PPL&amp;amp;fcode=PPLA&amp;amp;fcode=PPLC&amp;amp;style=full&amp;amp;username=xmlf): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized …/app/Http/Controllers/AutocompleteController.php:216 #0 [internal function]: Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees\{closure}(2, &#039;file_get_conten...&#039;, &#039;/share/CACHEDEV...&#039;, 216, Array) #1 …/app/Http/Controllers/AutocompleteController.php(216): file_get_contents(&#039;http://api.geon...&#039;) #2 …/app/Http/Middleware/WrapHandler.php(79): Fisharebest\Webtrees\Http\Controllers\AutocompleteController-&gt;place(Object(Nyholm\Psr7\ServerRequest)) #3 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\WrapHandler-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) <b>#4 …/modules_v4/faces/src/Modules/FacesModule.php(80): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest))</b> #5 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): UksusoFF\WebtreesModules\Faces\Modules\FacesModule-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #6 …/app/Http/Middleware/AuthVisitor.php(48): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #7 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\AuthVisitor-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #8 …/app/Http/Middleware/CheckCsrf.php(75): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #9 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckCsrf-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #10 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #11 …/app/Http/Middleware/Router.php(121): Middleland\Dispatcher-&gt;dispatch(Object(Nyholm\Psr7\ServerRequest)) #12 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\Router-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #13 …/app/Http/Middleware/BootModules.php(62): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #14 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BootModules-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #15 …/app/Http/Middleware/LoadRoutes.php(76): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #16 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\LoadRoutes-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #17 …/app/Http/Middleware/UseTransaction.php(45): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #18 …/vendor/illuminate/database/Concerns/ManagesTransactions.php(29): Fisharebest\Webtrees\Http\Middleware\UseTransaction::Fisharebest\Webtrees\Http\Middleware\{closure}(Object(Illuminate\Database\MySqlConnection)) #19 …/app/Http/Middleware/UseTransaction.php(46): Illuminate\Database\Connection-&gt;transaction(Object(Closure), 3) #20 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTransaction-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #21 …/app/Http/Middleware/DoHousekeeping.php(81): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #22 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\DoHousekeeping-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #23 …/app/Http/Middleware/UseTheme.php(70): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #24 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTheme-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #25 …/app/Http/Middleware/CheckForMaintenanceMode.php(51): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #26 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckForMaintenanceMode-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #27 …/app/Http/Middleware/UseLanguage.php(73): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #28 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseLanguage-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #29 …/app/Http/Middleware/UseSession.php(73): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #30 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseSession-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #31 …/app/Http/Middleware/UseFilesystem.php(58): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #32 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseFilesystem-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #33 …/app/Http/Middleware/UseCache.php(74): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #34 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseCache-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #35 …/app/Http/Middleware/UpdateDatabaseSchema.php(58): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #36 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #37 …/app/Http/Middleware/UseDebugbar.php(67): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #38 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDebugbar-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #39 …/app/Http/Middleware/UseDatabase.php(90): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #40 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #41 …/vendor/middlewares/client-ip/src/ClientIp.php(81): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #42 …/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #43 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #44 …/app/Http/Middleware/HandleExceptions.php(75): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #45 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #46 …/app/Http/Middleware/BaseUrl.php(77): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #47 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #48 …/app/Http/Middleware/ReadConfigIni.php(67): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #49 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #50 …/app/Http/Middleware/SecurityHeaders.php(47): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #51 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #52 …/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #53 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #54 …/app/Http/Middleware/PhpEnvironment.php(49): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #55 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment-&gt;process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #56 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher-&gt;handle(Object(Nyholm\Psr7\ServerRequest)) #57 …/index.php(55): Middleland\Dispatcher-&gt;dispatch(Object(Nyholm\Psr7\ServerRequest)) #58 {main}

fisharebest commented 4 years ago

401 Unauthorized

This comes from geonames.org

Is there a problem with your account?

I tried to create an account at geonames.org - but without sucess.

Perhaps there is a problem with this service?

fisharebest commented 4 years ago

You have an account with geonames.org?

You must enable the API service in your account page.

If you do not do this, you will get a 401 error.

fisharebest commented 4 years ago

I created a geonames account. I confirmed my email address I enabled the service at http://www.geonames.org/enablefreewebservice

I tested the service using:

https://secure.geonames.org/searchJSON?name_startsWith=flagst&lang=en-GB&fcode=CMTY&fcode=ADM4&fcode=PPL&fcode=PPLA&fcode=PPLC&style=full&username=XXXXX

I get a 401 response:

I waited 10 minutes. I tried again. It is now working.

Either:

fisharebest commented 4 years ago

Do you still have this problem?

DaPoHou commented 4 years ago

The problem solved.