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

Unhandled exception when ZIP download is cancelled #4148

Open
robinkar opened this issue Feb 13, 2025 · 0 comments
Open

Unhandled exception when ZIP download is cancelled #4148

robinkar opened this issue Feb 13, 2025 · 0 comments

Comments

@robinkar
Copy link
Contributor

We noticed that when a user cancels a ZIP download in the file browser (i.e. client disconnects), a FATAL exception with backtrace is logged as there is an unhandled exception.

Backtrace
1738223552 2025 Jan 30 09:52:32 ood user notice ondemand_passenger  App 68454 output: [2025-01-30 09:52:32 +0200 ] FATAL "ActionController::UnknownFormat (ActionController::UnknownFormat):
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/mime_responds.rb:216:in `respond_to'
  /var/www/ood/apps/sys/dashboard/app/controllers/files_controller.rb:111:in `rescue in fs'
  /var/www/ood/apps/sys/dashboard/app/controllers/files_controller.rb:7:in `fs'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:228:in `process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:106:in `run_callbacks'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/live.rb:261:in `block (2 levels) in process'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/dependencies/interlock.rb:42:in `block in running'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/concurrency/share_lock.rb:162:in `sharing'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/activesupport-6.1.7.6/lib/active_support/dependencies/interlock.rb:41:in `running'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/live.rb:253:in `block in process'
  /opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.10-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/live.rb:303:in `block in new_controller_thread'"

It seems that format.zip is missing from here.
However, it seems like the reason that we reach that rescue block at all is that the previous rescue block for sending a ZIP raises an exception itself, header already sent (ActionDispatch::IllegalStateError).

Adding the format.zip to the respond_to block seems to resolve the issue, but might not be the correct solution. Catching ActionController::Live::ClientDisconnected (and do nothing?) might be a more correct solution.

@osc-bot osc-bot added this to the Backlog milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants