openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.16k stars 909 forks source link

database migrations fail due to ws.geonemes.org unavailable #681

Closed wladich closed 10 years ago

wladich commented 10 years ago

After creating new database I do

bundle exec rake db:migrate

and migrations fail at "031_create_countries.rb" Sorry, I cannot reproduce error message now, it was about "name or service not known" in HTTP. The problem seems to be with line 17 in file db / migrate / 031_create_countries.rb:

 Net::HTTP.start('ws.geonames.org') do |http|

Name ws.geonames.org is not reolving by DNS servers for last few days.

tomhughes commented 10 years ago

Well there's not much I can do about - you need to complain to geonames if they have broken their DNS ;-)

wladich commented 10 years ago

I'm afraid they abandoned this service in favor of api.geonames.org

tomhughes commented 10 years ago

Unfortunately that requires a username though so we can't hard code it in the migrations...

smsm1 commented 10 years ago

An alternative option would be to create a seed file to load the country data which would be stored in the git repo.

wladich commented 10 years ago

My solution is like that: https://github.com/wladich/openstreetmap-website/commit/15f50862cdb4a9a6fe981ea1f3b2462b86e3d962

tomhughes commented 10 years ago

I decided there was no real point in having this in the database, so I converted it to just load a hash from a static file in 42b329ed82c7899b970e1f0fd8d6d29fd625f7d5 and then patched out the load from the old migration in 8accdb9259d1bfc75d76148b2e8daa06981713cb.