0

I have a locally hosted CartoDB instance and when I upload a KML file, I get the following error.

Unable to load data (2001)

We couldn't load data from your file into the database.

I check the logs and found this on development.log

2016-03-06 11:52:56 UTC: Filename: /tmp/imports/20160306-8915-1m8eifb/map_12.kml Size (bytes): 769
true: Importing data from /tmp/imports/20160306-8915-1m8eifb/map_12.kml
true: File-based import load
true: Detected encoding UTF-8
true: Using database connection with {:adapter=>"postgres", :encoding=>"unicode", :host=>"localhost", :port=>5432, :database=>"cartodb_dev_user_45677c0a-c82a-43a8-ae8e-5d9fe453b76a_db", :username=>"postgres", :conn_validator_timeout=>900, :user=>"development_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e"}
false: ogr2ogr call:            OSM_USE_CUSTOM_INDEXING=NO PG_USE_COPY=YES PGCLIENTENCODING=UTF-8  /usr/bin/ogr2ogr2 -f PostgreSQL   PG:"host=localhost port=5432 user=development_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e dbname=cartodb_dev_user_45677c0a-c82a-43a8-ae8e-5d9fe453b76a_db password=15c7b5083320ff4bae1e2d4340c298bd73cf923adevelopment_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e" -t_srs EPSG:4326  -lco DIM=2 -lco PRECISION=NO /tmp/imports/20160306-8915-1m8eifb/map_12.kml  -nln cdb_importer.importer_f77d7e50e39111e5ab510242ac110002 -nlt PROMOTE_TO_MULTI  
true: ogr2ogr output:          ERROR 4: Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
ERROR 1: Failed to process SRS definition: EPSG:4326

true: ogr2ogr exit code:       256
2016-03-06 11:52:57 UTC: Ogr2ogr FAILED!
2016-03-06 11:52:57 UTC: ogr2ogr.exit_code = 256
2016-03-06 11:52:57 UTC: ogr2ogr.command = OSM_USE_CUSTOM_INDEXING=NO PG_USE_COPY=YES PGCLIENTENCODING=UTF-8  /usr/bin/ogr2ogr2 -f PostgreSQL   PG:"host=localhost port=5432 user=development_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e dbname=cartodb_dev_user_45677c0a-c82a-43a8-ae8e-5d9fe453b76a_db password=15c7b5083320ff4bae1e2d4340c298bd73cf923adevelopment_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e" -t_srs EPSG:4326  -lco DIM=2 -lco PRECISION=NO /tmp/imports/20160306-8915-1m8eifb/map_12.kml  -nln cdb_importer.importer_f77d7e50e39111e5ab510242ac110002 -nlt PROMOTE_TO_MULTI  
2016-03-06 11:52:57 UTC: ogr2ogr.command_output = ERROR 4: Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
ERROR 1: Failed to process SRS definition: EPSG:4326

true: Errored importing data from /tmp/imports/20160306-8915-1m8eifb/map_12.kml:
false: CartoDB::Importer2::LoadError: 2016-03-06 11:52:56 UTC: Running on server c55d5fa50056 with PID: 8915
2016-03-06 11:52:56 UTC: new_importer()
2016-03-06 11:52:56 UTC: Fetching datasource public_url metadata for item id /cartodb/public/uploads/ebb774d4a1a7d86868c8/map_(12).kml
2016-03-06 11:52:56 UTC: File will be downloaded from /cartodb/public/uploads/ebb774d4a1a7d86868c8/map_(12).kml
2016-03-06 11:52:56 UTC: Before importer run
2016-03-06 11:52:56 UTC: Starting import for /cartodb/public/uploads/ebb774d4a1a7d86868c8/map_(12).kml
2016-03-06 11:52:56 UTC: Unpacking /cartodb/public/uploads/ebb774d4a1a7d86868c8/map_(12).kml
2016-03-06 11:52:56 UTC: Filename: /tmp/imports/20160306-8915-1m8eifb/map_12.kml Size (bytes): 769
true: Importing data from /tmp/imports/20160306-8915-1m8eifb/map_12.kml
true: File-based import load
true: Detected encoding UTF-8
true: Using database connection with {:adapter=>"postgres", :encoding=>"unicode", :host=>"localhost", :port=>5432, :database=>"cartodb_dev_user_45677c0a-c82a-43a8-ae8e-5d9fe453b76a_db", :username=>"postgres", :conn_validator_timeout=>900, :user=>"development_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e"}
false: ogr2ogr call:            OSM_USE_CUSTOM_INDEXING=NO PG_USE_COPY=YES PGCLIENTENCODING=UTF-8  /usr/bin/ogr2ogr2 -f PostgreSQL   PG:"host=localhost port=5432 user=development_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e dbname=cartodb_dev_user_45677c0a-c82a-43a8-ae8e-5d9fe453b76a_db password=15c7b5083320ff4bae1e2d4340c298bd73cf923adevelopment_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e" -t_srs EPSG:4326  -lco DIM=2 -lco PRECISION=NO /tmp/imports/20160306-8915-1m8eifb/map_12.kml  -nln cdb_importer.importer_f77d7e50e39111e5ab510242ac110002 -nlt PROMOTE_TO_MULTI  
true: ogr2ogr output:          ERROR 4: Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
ERROR 1: Failed to process SRS definition: EPSG:4326

true: ogr2ogr exit code:       256
2016-03-06 11:52:57 UTC: Ogr2ogr FAILED!
2016-03-06 11:52:57 UTC: ogr2ogr.exit_code = 256
2016-03-06 11:52:57 UTC: ogr2ogr.command = OSM_USE_CUSTOM_INDEXING=NO PG_USE_COPY=YES PGCLIENTENCODING=UTF-8  /usr/bin/ogr2ogr2 -f PostgreSQL   PG:"host=localhost port=5432 user=development_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e dbname=cartodb_dev_user_45677c0a-c82a-43a8-ae8e-5d9fe453b76a_db password=15c7b5083320ff4bae1e2d4340c298bd73cf923adevelopment_cartodb_user_6ab70972-9698-46b3-ba19-e821f563084e" -t_srs EPSG:4326  -lco DIM=2 -lco PRECISION=NO /tmp/imports/20160306-8915-1m8eifb/map_12.kml  -nln cdb_importer.importer_f77d7e50e39111e5ab510242ac110002 -nlt PROMOTE_TO_MULTI  
2016-03-06 11:52:57 UTC: ogr2ogr.command_output = ERROR 4: Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
ERROR 1: Failed to process SRS definition: EPSG:4326

true: Errored importing data from /tmp/imports/20160306-8915-1m8eifb/map_12.kml:
===LOG END===
true: ----------------------------------------------------
false: ["/cartodb/services/importer/lib/importer/loader.rb:335:in `check_for_import_errors'", "/cartodb/services/importer/lib/importer/loader.rb:268:in `run_ogr2ogr'", "/cartodb/services/importer/lib/importer/loader.rb:63:in `block (2 levels) in run'", "/cartodb/lib/cartodb/stats/aggregator.rb:97:in `method_missing'", "/cartodb/services/importer/lib/importer/loader.rb:62:in `block in run'", "/cartodb/lib/cartodb/stats/aggregator.rb:97:in `method_missing'", "/cartodb/services/importer/lib/importer/loader.rb:52:in `run'", "/cartodb/services/importer/lib/importer/runner.rb:227:in `file_based_loader_run'", "/cartodb/services/importer/lib/importer/runner.rb:179:in `import'", "/cartodb/services/importer/lib/importer/runner.rb:335:in `execute_import'", "/cartodb/services/importer/lib/importer/runner.rb:264:in `block (3 levels) in single_resource_import'", "/cartodb/services/importer/lib/importer/runner.rb:258:in `each'", "/cartodb/services/importer/lib/importer/runner.rb:258:in `each_with_index'", "/cartodb/services/importer/lib/importer/runner.rb:258:in `block (2 levels) in single_resource_import'", "/cartodb/lib/cartodb/stats/aggregator.rb:97:in `method_missing'", "/cartodb/services/importer/lib/importer/runner.rb:253:in `block in single_resource_import'", "/cartodb/lib/cartodb/stats/aggregator.rb:97:in `method_missing'", "/cartodb/services/importer/lib/importer/runner.rb:231:in `single_resource_import'", "/cartodb/services/importer/lib/importer/runner.rb:97:in `run_import'", "/cartodb/services/importer/lib/importer/runner.rb:90:in `block in run'", "/cartodb/lib/cartodb/stats/aggregator.rb:97:in `method_missing'", "/cartodb/services/importer/lib/importer/runner.rb:89:in `run'", "/cartodb/app/connectors/importer.rb:41:in `run'", "/cartodb/app/models/data_import.rb:644:in `new_importer'", "/cartodb/app/models/data_import.rb:378:in `dispatch'", "/cartodb/app/models/data_import.rb:172:in `run_import!'", "/cartodb/lib/resque/importer_jobs.rb:9:in `block in perform'", "/cartodb/lib/resque/base_job.rb:21:in `call'", "/cartodb/lib/resque/base_job.rb:21:in `run_action'", "/cartodb/lib/resque/importer_jobs.rb:9:in `perform'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/job.rb:240:in `block (3 levels) in perform'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-metrics-0.1.1/lib/resque/metrics.rb:353:in `around_perform_metrics'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/job.rb:239:in `block (2 levels) in perform'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/job.rb:247:in `call'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/job.rb:247:in `perform'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/worker.rb:250:in `perform'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/worker.rb:189:in `block in work'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/worker.rb:166:in `loop'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/worker.rb:166:in `work'", "/usr/local/rvm/gems/ruby-2.2.3/gems/resque-1.25.2/lib/resque/tasks.rb:41:in `block (2 levels) in <top (required)>'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'", "/usr/local/rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'", "/usr/local/rvm/gems/ruby-2.2.3/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'", "/usr/local/rvm/gems/ruby-2.2.3/bin/rake:23:in `load'", "/usr/local/rvm/gems/ruby-2.2.3/bin/rake:23:in `<main>'", "/usr/local/rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'", "/usr/local/rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'"]
true: ----------------------------------------------------
2016-03-06 11:52:57 UTC: Proceeding to register
2016-03-06 11:52:57 UTC: After importer run
2016-03-06 11:52:57 UTC: After dispatch
2016-03-06 11:52:57 UTC: ERROR!

Please help me to get this solved!

2

The problem seems to be related with the ogr2ogr installation in your system but with CartoDB itself.

The key of your log is at:

ERROR 4: Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
ERROR 1: Failed to process SRS definition: EPSG:4326

The issue seemed to be detected here and fixed in the CartoDB code here so you might want to check if that code is in your current CartoDB version or to check ogr2ogr configuration: https://stackoverflow.com/questions/14444310/how-to-set-the-gdal-data-environment-variable-to-point-to-the-directory-containi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.