Opened 11 years ago

Closed 10 years ago

#910 closed defect (fixed)

Getting 500 error from API in specific place

Reported by: eleonenko@… Owned by: frederik@…
Priority: major Milestone:
Component: api Version:
Keywords: Cc: ehabkost@…

Description

Getting 500 Error from API using this url http://api.openstreetmap.org/api/0.5/map?bbox=27.39887,53.88464,27.41698,53.89293

There are some test roads with restriction relations.

Attachments (1)

trace (3.3 KB) - added by Tom Hughes 11 years ago.
Backtrace as an attachment to avoid wiki breakage…

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by Tom Hughes

Owner: changed from Tom Hughes to frederik@…

It appears to be trying to output a bogus relation:

NoMethodError? (undefined method `visible?' for nil:NilClass):

/app/models/relation.rb:83:in `to_xml_node' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/associations/association_proxy.rb:124:in `method_missing' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/associations/association_collection.rb:162:in `method_missing' /app/models/relation.rb:74:in `to_xml_node' /app/controllers/api_controller.rb:190:in `map' /app/controllers/api_controller.rb:189:in `map' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:1168:in `perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/filters.rb:697:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/rescue.rb:199:in `perform_action_without_caching' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/caching.rb:678:in `perform_action' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/query_cache.rb:8:in `cache' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/caching.rb:677:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:524:in `process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/filters.rb:685:in `process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/session_management.rb:123:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/base.rb:388:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:171:in `handle_request' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:115:in `dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.1/lib/action_controller/dispatcher.rb:9:in `dispatch' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:101:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:149:in `with_signal_handler' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:99:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:77:in `process_each_request' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:76:in `process_each_request' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:50:in `process!' /usr/lib/ruby/gems/1.8/gems/rails-2.0.1/lib/fcgi_handler.rb:24:in `process!' /public/dispatch.fcgi:24

Changed 11 years ago by Tom Hughes

Attachment: trace added

Backtrace as an attachment to avoid wiki breakage...

comment:2 Changed 11 years ago by ehabkost@…

Cc: ehabkost@… added

I just got a http error 500 on a different region of the map:

http://www.openstreetmap.org/api/0.5/map?bbox=-49.208773638563834%2c-25.472306120079054%2c-49.20397239352369%2c-25.46778288140274

I don't know if it is exactly the same bug because I don't see the ruby backtrace. :)

I bet it is the same problem, because the last edition I have made in this area involved relations. It happened just after I have added a node to a way and added the node to a type=route;route=bus relation using Potlatch.

comment:3 Changed 11 years ago by ehabkost@…

Is the root cause of this bug known?

Currently I can't fetch map data for Curitiba on JOSM because of this bug. Exporting it as .osm on the Web interface doesn't work, either. This is blocking me from working on the map for Curitiba using anything except Potlatch.

comment:4 Changed 11 years ago by ehabkost@…

Just in case, I am documenting here how I fixed the relation data to avoid the problem for the region around Curitiba on the map:

I have checked manually through API queries what was the ID of the relation that was recently changed when the bug appeared. Luckly I have found it (14680).

Then I checked the relation history at: http://api.openstreetmap.org/api/0.5/relation/14680/history

I have found three bogus nodes on the relation data (with refs 0, 20 and 40). I have updated the relation without the bogus nodes using curl, and now the problem doesn't hit me anymore.

However, probably there are other broken relations on the database for other areas of the map. The server could either make impossible to create the broken relations, or handle the bogus references without crashing.

comment:5 Changed 10 years ago by Tom Hughes

Resolution: fixed
Status: newclosed

If this wasn't already fixed then the API 0.6 migration should have fixed it as we cleaned up all the nonsense in the database during the migration I think.

Note: See TracTickets for help on using tickets.