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

Suggest Nearby throws a 503 #84

Closed
hkrishna opened this issue Apr 30, 2015 · 4 comments
Closed

Suggest Nearby throws a 503 #84

hkrishna opened this issue Apr 30, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@hkrishna
Copy link
Contributor

Odd behavior around /suggest/nearby in prod (pelias.mapzen.com) service.

The following URLs dont work:
https://pelias.mapzen.com/suggest/nearby?input=east&lat=41.9184&lon=-87.6493&size=10
https://pelias.mapzen.com/suggest/nearby?input=east&lat=41.9184&lon=-87.6493&size=10&zoom=3

But this works:
https://pelias.mapzen.com/suggest/nearby?input=east&lat=41.9184&lon=-87.6493&size=10&zoom=4

which leads me to believe that there is something weird going on with the suggester trying to use precision level 1. If you do not pass in the optional zoom parameter, by default the suggester query constructor assumes its zoom 1-3 and falls back to precision 1 (which is the lowest precision level). Here's the relevant line of code 11:35
https://github.com/pelias/api/blob/master/query/suggest.js#L27

However, we need to do some more investigation around the production instance and see if its an Ops related bug. The reason I say that is because it seems to work locally and in dev instances. @heffergm may be able to provide more insight if its an ops issue?

@sevko could you dig a little deeper through the code and report if its a bug in our queries/sanitizers etc?

Thank you Blane Bell for bringing this to our attention. We are on it :)

@hkrishna hkrishna added the bug label Apr 30, 2015
@heffergm
Copy link
Contributor

Query throws the following stack trace:

2015-04-30_15:55:47.02668 _writableState.buffer is deprecated. Use _writableState.getBuffer() instead.
2015-04-30_15:55:47.02779 /srv/www/api/releases/20150428191922/node_modules/geojson-extent/node_modules/geojson-coords/node_modules/geojson-flatten/index.js:11
2015-04-30_15:55:47.02784             return flatten(gj.geometry).map(function(geom) {
2015-04-30_15:55:47.02789                                         ^
2015-04-30_15:55:47.02793 TypeError: undefined is not a function
2015-04-30_15:55:47.02797     at flatten (/srv/www/api/releases/20150428191922/node_modules/geojson-extent/node_modules/geojson-coords/node_modules/geojson-flatten/index.js:11:41)
2015-04-30_15:55:47.02802     at /srv/www/api/releases/20150428191922/node_modules/geojson-extent/node_modules/geojson-coords/node_modules/geojson-flatten/index.js:7:35
2015-04-30_15:55:47.02806     at Array.reduce (native)
2015-04-30_15:55:47.02810     at flatten (/srv/www/api/releases/20150428191922/node_modules/geojson-extent/node_modules/geojson-coords/node_modules/geojson-flatten/index.js:6:39)
2015-04-30_15:55:47.02814     at module.exports (/srv/www/api/releases/20150428191922/node_modules/geojson-extent/node_modules/geojson-coords/index.js:7:22)
2015-04-30_15:55:47.02818     at getExtent (/srv/www/api/releases/20150428191922/node_modules/geojson-extent/index.js:25:18)
2015-04-30_15:55:47.02821     at module.exports (/srv/www/api/releases/20150428191922/node_modules/geojson-extent/index.js:6:12)
2015-04-30_15:55:47.02824     at search (/srv/www/api/releases/20150428191922/helper/geojsonify.js:65:18)
2015-04-30_15:55:47.02827     at reply (/srv/www/api/releases/20150428191922/controller/suggest.js:30:21)
2015-04-30_15:55:47.02829     at /srv/www/api/releases/20150428191922/controller/suggest.js:69:16

@dianashk dianashk added this to the Pelias v1.0.0 milestone May 4, 2015
@missinglink missinglink self-assigned this May 5, 2015
@missinglink
Copy link
Member

upstream PR opened: caseycesari/GeoJSON.js#12

@missinglink
Copy link
Member

failing test case: https://github.com/pelias/api/blob/issue84/test/unit/helper/geojsonify.js#L15-L36

// ref: https://github.com/pelias/pelias/issues/84
module.exports.tests.earth = function(test, common) {

  var earth = [{
    '_type': 'geoname',
    '_id': '6295630',
    'name': {
      'default': 'Earth'
    },
    'center_point': {
      'lon': 0,
      'lat': 0
    }
  }];

  test('earth', function(t) {
    t.doesNotThrow(function(){
      geojsonify.search( earth, { details: true } );
    });
    t.end();
  });

};
  Failed Tests: There was 1 failure

    ✗ geojsonify: earth TypeError: Object #<Object> has no method 'map'

@missinglink
Copy link
Member

This should now be resolved on live. cc/ @heffergm

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

No branches or pull requests

4 participants