[OSM-dev] /map API call gone

Christopher Schmidt crschmidt at metacarta.com
Wed Jan 23 02:11:46 GMT 2008


On Tue, Jan 22, 2008 at 08:53:00PM -0500, Christopher Schmidt wrote:
> On Tue, Jan 22, 2008 at 08:39:36PM -0500, Christopher Schmidt wrote:
> > In what I'm assuming was a mistake, the 'map' API call appears to have
> > been removed with recent code rollout:
> > 
> > http://www.openstreetmap.org/api/0.5/map?bbox=-1.821443,52.54776,-1.81197,52.552856
> > 
> > is now a 404. Judging by the munin graphs:
> > 
> > http://munin.openstreetmap.org/openstreetmap/db.openstreetmap-mysql_queries.html
> > 
> > It looks like this happened at just before midnight munin-time.
> > 
> > The /way API call still works. 
> 
> I'm not *sure*, but the main difference I see is that the 'map' API call
> uses the 'api' controller, and I'm wondering if maybe that model is what
> connected the controller to the 'api' string.

Okay, so ignore thi stupid "I don't know rails" comment, and maybe this
is useful: a traceback shows that: 

2008-01-23 01:38:06.404401 #13180] Processing ApiController#map (for
89.182.73.59 at 2008-01-23 01:38:06) [GET]
[2008-01-23 01:38:06.404491 #13180]   Parameters: {"action"=>"map",
"controller"=>"api", "bbox"=>"9.64608,52.24448,9.85088,52.44928"}
[2008-01-23 01:38:38.879375 #13180] ActiveRecord::RecordNotFound
(Couldn't find all Ways with IDs
(3996082,8,7,6,5,4,3,2,9397962,1,4296247,4276681,9397963,9,
10,12,11,19848925,14,13,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,4823945,4809777,20,4784699,4823953,4784700,4823952,4830945,19798008
,19798007,4809701,4784701,4784698,4796233,4784702,4276698,3996078,4277776,4776035,4762102,4762435,4762100,5010987,5024569,4999792,5010999,5198779,6234848,476
2437,4999578,4672106,4776034,4220689,5024647,5024570,4435204,5000425,4761741,4999542,4999733,4277794,4752022,4650988,5000447,4756560,6144026,4278093,5024648,
 
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:1221:in
`find_some'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:1180:in
`find_from_ids'
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:453:in
`find'
    /app/controllers/api_controller.rb:165:in `map'

The line immediately before 164 is:

      way_ids = way_nodes.collect {|way_node| way_node.id }


the primary_key on way_node changed earlier today:

http://trac.openstreetmap.org/changeset/6536/sites/rails_port/app/models/way_node.rb

I note that above, the IDs from 1->22 all exist in the query -- that
seems very odd for just about any single area in the world, and is what
is triggering the 404, I think. It seems at least related that that
primary key change happened at the same time... I'm wondering if it's
collecting the IDs of the ways, *and* their sequence numbers, and then
trying to pass them into the way lookup on 165, and bombing out because
some of them don't exist. (It would also explain why this wasn't
immediately obvious: at least *some* areas would work.)

Thanks to Jon for the traceback, and hopefully this helps...

Regards,
-- 
Christopher Schmidt
MetaCarta




More information about the dev mailing list