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

OSM Import Error #83

Closed
ktjaco opened this issue Nov 2, 2015 · 5 comments
Closed

OSM Import Error #83

ktjaco opened this issue Nov 2, 2015 · 5 comments

Comments

@ktjaco
Copy link

ktjaco commented Nov 2, 2015

My import pipeline for OSM runs smoothly until I reach the command to run an import.

$ node index.js

When that command is entered I receive this error:

vagrant@pelias:~/openstreetmap$ node index.js /home/vagrant/openstreetmap/node_modules/pelias-dbclient/node_modules/elasticsearch/src/lib/utils.js:356 throw new TypeError(err); ^ TypeError: Invalid apiVersion "1.7", expected a function or one of master, 1.x, 1.3, 1.2, 1.1, 1.0, 0.90 at Object._.funcEnum (/home/vagrant/openstreetmap/node_modules/pelias-dbclient/node_modules/elasticsearch/src/lib/utils.js:356:11) at new Client (/home/vagrant/openstreetmap/node_modules/pelias-dbclient/node_modules/elasticsearch/src/lib/client.js:66:29) at module.exports (/home/vagrant/openstreetmap/node_modules/pelias-dbclient/src/client.js:11:17) at streamFactory (/home/vagrant/openstreetmap/node_modules/pelias-dbclient/src/sink.js:8:56) at Object.osm.import (/home/vagrant/openstreetmap/index.js:37:12) at Object.<anonymous> (/home/vagrant/openstreetmap/index.js:42:13) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12)

Any help would be appreciated!

Thank you.

@orangejulius
Copy link
Member

Hey @KentJacobs,
I haven't seen this error before, but it looks like it might be related to an issue in the elasticsearch NPM module. Could you dig in and find a couple versions for me? First the version of Elasticsearch itself (can be found at http://localhost:9200/), then the git revision of our osm importer (/home/vagrant/openstreetmap), and finally the elasticsearch NPM module (can be found at /home/vagrant/openstreetmap/node_modules/pelias-dbclient/node_modules/elasticsearch).

I also wasn't able to reproduce this issue locally myself but if you can manage to try a newer version of the elasticsearch NPM module, that might help. Let me know how it goes, and hopefully we can figure it out based on that info.

@ktjaco
Copy link
Author

ktjaco commented Nov 4, 2015

vagrant@pelias:~/openstreetmap$ curl http://localhost:9200/
{
  "status" : 200,
  "name" : "pelias",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.7.0",
    "build_hash" : "929b9739cae115e73c346cb5f9a6f24ba735a743",
    "build_timestamp" : "2015-07-16T14:31:07Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}
/home/vagrant/openstreetmap
File: package.json
{
   "name": "pelias-openstreetmap",
   "author": "mapzen",
   "version": "3.1.1"....
/home/vagrant/openstreetmap/node_modules/pelias-dbclient/node_modules/elasticsearch
File: package.json
{
....
   "_npmVersion": "1.4.14"
...
}

Hopefully this helps!

@orangejulius
Copy link
Member

Hmm, other than reminding me to upgrade the vagrant image's Elasticsearch version to 1.7.3, unfortunately not really. I just spun up a vagrant image but can't reproduce. How old is your Vagrant image? Things change frequently, especially with NPM modules.

Two more things to try though:

  1. delete the node_modules directory for openstreetmap: rm -rf ~/openstreetmap/node_modules. It fixes way more problems than it should unfortunately
  2. Send along your entire ~/pelias.json. Presumably it looks something like the one in the docs, which I just tested and works fine (after changing the datapath to /opt/pelias/data/osm to match where the vagrant image stores data). It's possible there's some combination of config settings our code doesn't like.

@ktjaco
Copy link
Author

ktjaco commented Nov 5, 2015

Running an import seems to work now. I ran node index.js and it finished without error in 2-3 minutes. I can curl and specify osm as a source now.

I deleted node_modules in openstreetmap, then I created a new ~/pelias.json file in case and re-installed node_modules with npm install in openstreetmap. This seemed to fix the issue. 👍

Thank you for your help!

@ktjaco ktjaco closed this as completed Nov 5, 2015
@orangejulius
Copy link
Member

Deleting node_modules is the NPM equivalent of rebooting a computer: it fixes many problems but no one knows why. Enjoy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants