[OSM-dev] Random server errors on API (custom install)

Jan Schejbal jan.mailinglisten at googlemail.com
Thu Aug 30 04:41:10 BST 2012


Hi,
when calling the API on a custom server to get some data like this:
  http://example.com:3000/api/0.6/map?bbox=8.19,49.83,9.208,50.373
I sometimes get a result, and sometimes I just get a server error (code
500) with the following message:
 NameError: uninitialized constant XMLEncoding::UTF_8

However, it seems that hard-reloading the map page
(http://example.com:3000/ in this case) "fixes" the error for some time.
Restarting the server seems to bring the issue back. Waiting a few hours
seems to do too.

Does anyone have any ideas what can cause this, or how I can help debug
this issue? I could imagine it to have something to do with some XML
library not being properly loaded.

Kind regards,
Jan

Trace:
[2012-08-29 17:21:35.078326 #4084] Started GET
"/api/0.6/map?bbox=8.19,49.83,9.208,50.373" for 79.215.131.87 at Wed Aug
29 17:21:35 +0200 2012
[2012-08-29 17:21:35.085673 #4084] Processing by ApiController#map as HTML
[2012-08-29 17:21:35.085835 #4084]   Parameters:
{"bbox"=>"8.19,49.83,9.208,50.373"}
[2012-08-29 17:21:36.022122 #4084]   Node Load (5.9ms)  SELECT
"current_nodes".* FROM "current_nodes" WHERE "current_nodes"."visible" =
't' AND (( tile BETWEEN 3493262172 AND 3493262175 OR tile BETWEEN
...
OR tile BETWEEN 3493708964 AND 3493708965 ) AND latitude BETWEEN
498300000.0 AND 503730000.0 AND longitude BETWEEN 81900000.0 AND
92080000.0) LIMIT 50001
[2012-08-29 17:21:36.027416 #4084]   NodeTag Load (0.3ms)  SELECT
"current_node_tags".* FROM "current_node_tags" WHERE
((("current_node_tags"."node_id" = 1)))
[2012-08-29 17:21:36.029373 #4084] API threw unexpected NameError
exception: uninitialized constant XMLEncoding::UTF_8
[2012-08-29 17:21:36.029510 #4084]
/var/openstreetmap/openstreetmap-website/lib/osm.rb:459:in `get_xml_doc'
[2012-08-29 17:21:36.029635 #4084]
/var/openstreetmap/openstreetmap-website/app/controllers/api_controller.rb:145:in
`map'
[2012-08-29 17:21:36.029770 #4084]
/var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in
`send_action'
[2012-08-29 17:21:36.029894 #4084]
/var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in
`send_action'
[2012-08-29 17:21:36.030032 #4084]
/var/lib/gems/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in
`process_action'
...
[2012-08-29 17:21:36.043113 #4084]
/var/lib/passenger-standalone/3.0.17-x86_64-ruby1.8.7-linux-gcc4.4.5-1002/support/helper-scripts/passenger-spawn-server:99
[2012-08-29 17:21:36.044161 #4084]   Rendered text template (0.0ms)
[2012-08-29 17:21:36.044718 #4084] Completed 500 Internal Server Error
in 959ms (Views: 0.9ms | ActiveRecord: 6.2ms)



More information about the dev mailing list