Project

General

Profile

Actions

Bug #7884

closed

[Workbench] log viewer does not handle "redirect to keep-web" response

Added by Tom Clegg over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench
Target version:
Story points:
0.5

Description

The Log pane of a finished job does an AJAX request with a URL like this:

Accept:*/*

https://workbench.4xphq.arvadosapi.com/collections/f5ab63b9f751ebceb3f58693a130ec62+83/4xphq-8i9sb-wub5wkrd85xaja0.log.txt

When keep-web is enabled, Workbench's response looks like this:

Content-Type:application/json; charset=utf-8

{"href":"https://download.4xphq.arvadosapi.com/c=f5ab63b9f751ebceb3f58693a130ec62-83/_/4xphq-8i9sb-wub5wkrd85xaja0.log.txt?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

The code in source:apps/workbench/app/views/jobs/_show_log.html.erb crashes at data.split() because data is an Object, not a string:

    $.ajax(logcollection_url, { headers: range_header }).
        done(function(data, status, jqxhr) {
            logViewer.filter();
            addToLogViewer(logViewer, data.split("\n"), taskState);
At least two things should be fixed:
  • The $.ajax() call should force the response to be treated as plain text regardless of whether the response looks like JSON or has a Content-Type header.
  • The Workbench download handler, when redirecting to keep-web, should bypass ApplicationController#redirect_to (in source:apps/workbench/app/controllers/application_controller.rb) and send a real HTTP redirect response.

Subtasks 4 (0 open4 closed)

Task #8049: keep-web respond to AJAX without redirectResolvedTom Clegg12/01/2015Actions
Task #8047: Workbench accept text/plainResolvedTom Clegg12/01/2015Actions
Task #8048: Workbench follow redirect to keep-web (considering CORS)ResolvedTom Clegg12/01/2015Actions
Task #8034: review 7884-ajax-log-redirectResolvedPeter Amstutz12/01/2015Actions

Related issues

Related to Arvados - Feature #8064: [Keep-web] Support CORS requests with Authorization headersNewActions
Actions

Also available in: Atom PDF