[openstreetmap/openstreetmap-website] PUT /api/0.6/gpx/:id causes internal server error (#1982)

mmd notifications at github.com
Mon Sep 10 17:44:57 UTC 2018


A bit of error handling could be added to app/models/trace.rb:237:in `update_from_xml_node' maybe...

```
API threw unexpected ActiveRecord::RecordNotSaved exception: Failed to replace tags because one or more of the new records could not be saved.
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:415:in `replace_records'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:252:in `block in replace'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:136:in `block in transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `block in transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:230:in `block in within_new_transaction'
/usr/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:227:in `within_new_transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in `transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in `transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/openstreetmap-deadlock_retry-1.3.0/lib/deadlock_retry.rb:21:in `transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:135:in `transaction'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:252:in `replace'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/collection_association.rb:41:in `writer'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/associations/builder/association.rb:116:in `tags='
/home/osm/openstreetmap-website/app/models/trace.rb:237:in `update_from_xml_node'
/home/osm/openstreetmap-website/app/models/trace.rb:207:in `block in update_from_xml'
/home/osm/openstreetmap-website/app/models/trace.rb:206:in `each'
/home/osm/openstreetmap-website/app/models/trace.rb:206:in `update_from_xml'
/home/osm/openstreetmap-website/app/controllers/traces_controller.rb:260:in `api_update'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:194:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/rendering.rb:30:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/osm/openstreetmap-website/app/controllers/application_controller.rb:325:in `api_call_handle_error'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/osm/openstreetmap-website/app/controllers/application_controller.rb:460:in `better_errors_allow_inline'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:41:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/rescue.rb:22:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in `block in instrument'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in `instrument'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:134:in `process'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionview-5.2.0/lib/action_view/rendering.rb:32:in `process'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:191:in `dispatch'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:252:in `dispatch'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in `each'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in `serve'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/omniauth-1.8.1/lib/omniauth/strategy.rb:190:in `call!'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/omniauth-1.8.1/lib/omniauth/strategy.rb:168:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/omniauth-1.8.1/lib/omniauth/builder.rb:63:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/oauth-plugin-0.5.1/lib/oauth/rack/oauth_filter.rb:75:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-cors-1.0.2/lib/rack/cors.rb:97:in `call'
/home/osm/openstreetmap-website/config/initializers/cors.rb:9:in `call'
/home/osm/openstreetmap-website/config/initializers/compressed_requests.rb:27:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/http_accept_language-2.0.5/lib/http_accept_language/middleware.rb:14:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/etag.rb:25:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in `context'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:559:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in `run_callbacks'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/better_errors-2.4.0/lib/better_errors/middleware.rb:84:in `protected_app_call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/better_errors-2.4.0/lib/better_errors/middleware.rb:79:in `better_errors_call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/better_errors-2.4.0/lib/better_errors/middleware.rb:57:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:38:in `call_app'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:26:in `block in call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:28:in `tagged'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:71:in `tagged'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:26:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/request_store-1.4.1/lib/request_store/middleware.rb:19:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/runtime.rb:22:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-uri_sanitizer-0.0.2/lib/rack/uri_sanitizer.rb:14:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/static.rb:127:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/secure_headers-6.0.0/lib/secure_headers/middleware.rb:13:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/puma-3.11.4/lib/puma/configuration.rb:225:in `call'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/puma-3.11.4/lib/puma/server.rb:632:in `handle_request'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/puma-3.11.4/lib/puma/server.rb:446:in `process_client'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/puma-3.11.4/lib/puma/server.rb:306:in `block in run'
/home/osm/openstreetmap-website/path/ruby/2.5.0/gems/puma-3.11.4/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
  Rendering text template
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/1982#issuecomment-419999634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180910/4306ad89/attachment-0001.html>


More information about the rails-dev mailing list