0

I have setup cartodb in one of the server (CentOS). Everything worked fine in development environment, but when I move to production environment I couldn't import any file. Getting the below error in production.log

Ignoring statsd, because there were a error loading the config
[table#create error] === #<RuntimeError: host and port must be set>

Below the importer job log,

2014-06-17T10:44:54Z || Before dispatch
2014-06-17T10:44:54Z || new_importer()
2014-06-17T10:44:54Z || Fetching datasource public_url metadata for item id http://cartodb.s3.amazonaws.com/static/TM_WORLD_BORDERS_SIMPL-0.3.zip
2014-06-17T10:44:55Z || File will be downloaded from http://cartodb.s3.amazonaws.com/static/TM_WORLD_BORDERS_SIMPL-0.3.zip
2014-06-17T10:44:55Z || Before run.
2014-06-17T10:44:57Z || Starting import for /tmp/imports/20140617-14039-17m47zj/TM_WORLD_BORDERS_SIMPL-0.3.zip
2014-06-17T10:44:57Z || Unpacking /tmp/imports/20140617-14039-17m47zj/TM_WORLD_BORDERS_SIMPL-0.3.zip
2014-06-17T10:44:57Z || Importing data from /tmp/imports/20140617-14039-166nffe/tm_world_borders_simpl-0.3.shp
2014-06-17T10:44:58Z || Detected encoding WIN1252
2014-06-17T10:44:58Z || Using database connection with {:adapter=>"postgres", :encoding=>"unicode", :host=>"localhost", :port=>5432, :database=>"cartodb_user_d13717ee-414f-4c29-a4e9-19e1d48c197b_db", :username=>"postgres", :user=>"cartodb_user_d13717ee-414f-4c29-a4e9-19e1d48c197b"}
2014-06-17T10:44:59Z || ogr2ogr call:      OSM_USE_CUSTOM_INDEXING=NO PG_USE_COPY=YES PGCLIENTENCODING=WIN1252 SHAPE_ENCODING=WIN1252 /usr/local/bin/ogr2ogr -f PostgreSQL PG:"host=localhost port=5432 user=cartodb_user_d13717ee-414f-4c29-a4e9-19e1d48c197b dbname=cartodb_user_d13717ee-414f-4c29-a4e9-19e1d48c197b_db password=71fc094fbf3ac1d38de9cc90ac3eeed821df33f0cartodb_user_d13717ee-414f-4c29-a4e9-19e1d48c197b active_schema=cdb_importer" -t_srs EPSG:4326  -lco DIM=2 -lco PRECISION=NO /tmp/imports/20140617-14039-166nffe/tm_world_borders_simpl-0.3.shp  -nln cdb_importer.importer_6cd598c4f60c11e383fd00185162f697 -nlt PROMOTE_TO_MULTI
2014-06-17T10:44:59Z || ogr2ogr output:
2014-06-17T10:44:59Z || ogr2ogr exit code: 0
2014-06-17T10:44:59Z || Georeferencing...
2014-06-17T10:44:59Z || Disabling autovacuum for "cdb_importer"."importer_6cd598c4f60c11e383fd00185162f697"
2014-06-17T10:44:59Z || Creating the_geom from wkb_geometry column
2014-06-17T10:44:59Z || replace empty strings by nulls?
2014-06-17T10:44:59Z || no string column found, nothing replaced
2014-06-17T10:44:59Z || geometrifying
2014-06-17T10:44:59Z || casting wkb_geometry to geometry
2014-06-17T10:44:59Z || Converting to 2D point
2014-06-17T10:44:59Z || Total processed: 246
2014-06-17T10:44:59Z || Total processed: 246
2014-06-17T10:45:00Z || FINISHED: Converting to 2D point
2014-06-17T10:45:00Z || geometrified
2014-06-17T10:45:00Z || Renaming column wkb_geometry TO the_geom
2014-06-17T10:45:00Z || Enabling autovacuum for "cdb_importer"."importer_6cd598c4f60c11e383fd00185162f697"
2014-06-17T10:45:00Z || Georeferenced
2014-06-17T10:45:00Z || Finished importing data from /tmp/imports/20140617-14039-166nffe/tm_world_borders_simpl-0.3.shp
2014-06-17T10:45:00Z || Proceeding to register
2014-06-17T10:45:00Z || Before renaming
2014-06-17T10:45:00Z || Before moving schema
2014-06-17T10:45:00Z || Before persisting metadata
2014-06-17T10:45:01Z || Dropping table tm_world_borders_simpl_0_3
2014-06-17T10:45:01Z || Import Error: host and port must be set
2014-06-17T10:45:01Z || After run.
2014-06-17T10:45:01Z || After dispatch
2014-06-17T10:45:01Z || SUCCESS!

Which host/port are missing and where to set?

2 Answers 2

0

Adding the following varnish management setting next to

production: <<: *defaults

solves the import issue.

varnish_management:
    critical: false
    host: '127.0.0.1'
    port: 6082
    purge_command: 'purge'
    url_purge_command: 'url.purge'
    retries: 5
    timeout: 5
2
  • Did this work for you? I'm getting the same message but to me it looks like CartoDB is looking for the port and host of a graphite server, not the varnish server. I tried the instructions above, but it didn't resolve the problem.
    – stuporglue
    Commented Aug 8, 2014 at 20:18
  • It worked for me. May be some other configuration also needs to be modified for you. Could you share your config file of SQL-API and Windshaft?
    – Prabu
    Commented Aug 11, 2014 at 5:42
0

I got it working, but it wasn't the varnish server for me. The same error message is given (in version 2.13.3 at least) if the graphite and graphite_public config options aren't set in app_config.yml.

graphite_public:
    host: "example.com/graphite"
    port: "80"
graphite:
    host: "127.0.0.1"
    port: "2003"

I'm not even sure that a graphite server needs to be running. Just adding these to the config file seemed to make my problems disappear.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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