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

polyline document error PeliasModelError: invalid document type, expecting: truthy, got: #3

Closed
orangejulius opened this issue Sep 6, 2016 · 9 comments

Comments

@orangejulius
Copy link
Member

orangejulius commented Sep 6, 2016

Just got this error while importing polylines on my local machine.

2016-09-06T19:49:54.753Z - error: [polyline] polyline document error PeliasModelError: invalid document type, expecting: truthy, got:   
    at /home/julian/repos/pelias/polylines/node_modules/pelias-model/util/valid.js:31:13
    at /home/julian/repos/pelias/polylines/node_modules/pelias-model/util/model.js:359:7
    at Array.forEach (native)
    at validate (/home/julian/repos/pelias/polylines/node_modules/pelias-model/util/model.js:358:16)
    at Document.setter (/home/julian/repos/pelias/polylines/node_modules/pelias-model/util/model.js:136:5)
    at Document.setName (/home/julian/repos/pelias/polylines/node_modules/pelias-model/Document.js:137:12)
    at DestroyableTransform._transform (/home/julian/repos/pelias/polylines/stream/document.js:31:11)
    at DestroyableTransform.Transform._read (/home/julian/repos/pelias/polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/home/julian/repos/pelias/polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (/home/julian/repos/pelias/polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
    at writeOrBuffer (/home/julian/repos/pelias/polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
@missinglink
Copy link
Member

Can you provide more info about what file you were importing?

Do the tests pass for you?

@orangejulius
Copy link
Member Author

orangejulius commented Sep 7, 2016

This was runnin with the planet.polyline download. The tests pass, and I'm using Node.js 6.5

@dianashk
Copy link
Contributor

Let's discuss which node version we are all running in our local dev environments so that we are on the same page. When issues come up in future versions we can report them and wait to fix them until we sprint on upgrades.

@dianashk dianashk changed the title polyline document error PeliasModelError: invalid document type, expecting: truthy, got: polyline document error PeliasModelError: invalid document type, expecting: truthy, got: Sep 21, 2016
@orangejulius
Copy link
Member Author

This has been happening in our production builds as well for some time. Node.js 4.4.7. We should investigate if anything bad is happening or make the logs less noisy

@jpan127
Copy link

jpan127 commented Aug 22, 2018

Hi,

Just attempted importing using pelias/polylines with the January 8th 2017 planet file and received this error 42 times, most likely the same file as @orangejulius.

Node V10.9.0.

Was there any conclusion as to whether this error invalidates the import? It appears geojson.properties.name returns false for (typeof val === 'string' && !val.trim()) || !val.

@orangejulius
Copy link
Member Author

Hey @jpan127,
I believe the conclusion here is that this message does not indicate a significant problem. It's normal that a few records will fail validation during an import.

If you wanted to, a pull request to make this message less scary and drop it to the info or debug level rather than error would be merged :)

@jpan127
Copy link

jpan127 commented Aug 28, 2018

Thanks @orangejulius. I made a PR with the minor change.

@ywangzi
Copy link

ywangzi commented Nov 27, 2018

Refer to the here. than I executed npm start and showed this error:

2018-11-27T05:56:33.223Z - error: [polyline] polyline document error message=invalid document type, expecting: truthy, got: , stack=PeliasModelError: invalid document type, expecting: truthy, got:
at Object.module.exports.truthy (/data/osm/extract/pelias/pelias-polylines/node_modules/pelias-model/util/valid.js:29:11)
at Document.setName (/data/osm/extract/pelias/pelias-polylines/node_modules/pelias-model/Document.js:217:12)
at DestroyableTransform._transform (/data/osm/extract/pelias/pelias-polylines/stream/document.js:31:11)
at DestroyableTransform.Transform._read (/data/osm/extract/pelias/pelias-polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:185:10)
at DestroyableTransform.Readable.read (/data/osm/extract/pelias/pelias-polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:442:10)
at flow (/data/osm/extract/pelias/pelias-polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:878:34)
at ParallelTransform.pipeOnDrainFunctionResult (/data/osm/extract/pelias/pelias-polylines/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:699:7)
at ParallelTransform.emit (events.js:180:13)
at onwriteDrain (/data/osm/extract/pelias/pelias-polylines/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js:501:12)
at afterWrite (/data/osm/extract/pelias/pelias-polylines/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js:489:18), name=PeliasModelError

@orangejulius
Copy link
Member Author

I believe this issue has been resolved by #225. After running an import for a polyline extract of the road network for an OSM planet file, I didn't see any of these errors.

If anyone does encounter them again please comment here with the error as well as information about your polylines file such as the origin, date of data, etc.

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

5 participants