Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namedplaces guessing errors #3024

Closed
juanignaciosl opened this issue Apr 6, 2015 · 4 comments
Closed

Namedplaces guessing errors #3024

juanignaciosl opened this issue Apr 6, 2015 · 4 comments

Comments

@juanignaciosl
Copy link
Contributor

Syntax errors [1, 2]

create_the_geom_from_namedplaces_guessing failed: syntax error at or near "s"
["/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/sql-api/sql_api.rb:48:in `raise_if_error'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/sql-api/sql_api.rb:35:in `handle_response'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/sql-api/sql_api.rb:28:in `fetch'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:76:in `block in namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:72:in `each'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:72:in `namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:35:in `run!'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:161:in `block in create_the_geom_from_namedplaces_guessing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/importer_stats.rb:56:in `timing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:159:in `create_the_geom_from_namedplaces_guessing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:50:in `run'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/loader.rb:96:in `post_ogr2ogr_tasks'"

cannot determine type of empty array [1]

["/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/sql-api/sql_api.rb:48:in `raise_if_error'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/sql-api/sql_api.rb:35:in `handle_response'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/sql-api/sql_api.rb:28:in `fetch'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:76:in `block in namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:72:in `each'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:72:in `namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:35:in `run!'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:161:in `block in create_the_geom_from_namedplaces_guessing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/importer_stats.rb:56:in `timing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:159:in `create_the_geom_from_namedplaces_guessing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:50:in `run'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/loader.rb:96:in `post_ogr2ogr_tasks'"

create_the_geom_from_namedplaces_guessing failed: undefined method `[]' for nil:NilClass [1]

["/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/content_guesser.rb:138:in `country_proportion'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:62:in `country_proportion'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:48:in `country_column'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:32:in `run!'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:161:in `block in create_the_geom_from_namedplaces_guessing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/importer_stats.rb:56:in `timing'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/georeferencer.rb:159:in `create_the_geom_from_namedplaces_guessing'"

can't convert nil into String [1]

["/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:74:in `+'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:74:in `block (2 levels) in namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:74:in `map'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:74:in `block in namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:72:in `each'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:72:in `namedplaces_guess_country'", "/home/ubuntu/www/production.cartodb.com/releases/20150406101751/services/importer/lib/importer/namedplaces_guesser.rb:35:in 
@rafatower
Copy link
Contributor

The bug can be reproduced with this csv dataset:

country,city
Cote d'Ivoire,Yamoussoukro
Cote d'Ivoire,Abidjan
Ghana,Kumasi

It is due to unescaped quotes in the input.

rafatower pushed a commit that referenced this issue Apr 24, 2015
…rrors

Escape quotes in namedplaces queries #3024
rafatower pushed a commit that referenced this issue Apr 24, 2015
rafatower pushed a commit that referenced this issue Apr 24, 2015
rafatower pushed a commit that referenced this issue Apr 24, 2015
@rafatower
Copy link
Contributor

Some of the warnings are due to imports that end up in tables with 0 rows.

rafatower pushed a commit that referenced this issue Apr 27, 2015
rafatower pushed a commit that referenced this issue Apr 27, 2015
…mpty-array

Fix guessing warnings when there are no rows #3024
@rafatower
Copy link
Contributor

I think all cases are fixed. I'm closing this ticket. I'll take another look at the error log by the end of the day to confirm and reopen if needed.

@rafatower
Copy link
Contributor

There's still one failure:
https://rollbar.com/vizzuality/CartoDB/items/5014/

undefined method `[]' for nil:NilClass

services/importer/lib/importer/namedplaces_guesser.rb:86:in `proportion'
services/importer/lib/importer/namedplaces_guesser.rb:68:in `guess_with_country_column'
services/importer/lib/importer/namedplaces_guesser.rb:33:in `run!'
services/importer/lib/importer/georeferencer.rb:163:in `block in create_the_geom_from_namedplaces_guessing'

@rafatower rafatower reopened this Apr 27, 2015
rafatower pushed a commit that referenced this issue Apr 27, 2015
rafatower pushed a commit that referenced this issue Apr 27, 2015
rafatower pushed a commit that referenced this issue Apr 27, 2015
…ndefined-method

Do not use candidate if it is nil #3024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants