OSC / ood_core

Open OnDemand core library

Home Page:https://osc.github.io/ood_core/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

job composer needs to validate workflow#staged_dir

sync-by-unito opened this issue · comments

Somehow a user created a workflow in the job composer, and it seems to have half finished. The service now INC was INC0348628.

The row in question got created as such:

15|2020-04-10 18:42:36.976893|2020-04-10 18:42:36.976893||Generic Glide Script for tutorial|pitzer||

Empty columns are

  • job_attrs - that doesn't matter
  • script_path - this safely errors in the UI
  • script_name - this throws the unhandled error

The error thrown in full is:

"ActionView::Template::Error (no implicit conversion of nil into String):"
  79: \n
  80:           <tbody>\n
  81:           <% @workflows.each do |workflow| %>\n
  82:               <tr class=\"job-row<%= \" missing-cluster\" unless workflow.batch_host_exists? %><%= \" missing-dir\" unless workflow.staged_dir_exists? %><%= \" missing-script\" unless workflow.script_name && workflow.staged_script_exists? %>\" id=\"<%= workflow.id %>\">\n
  83:                 <td data-sort=\"<%= workflow.id %>\"><small><%= local_time(workflow.created_at) %></small></td>\n
  84:                 <td><span title=\"<%= workflow.name %>\"><strong><%= workflow.name %></strong></span></td>\n
  85:                 <%# FIXME: AJAX causes a problem with this change %>"


    app/models/workflow.rb:86:in `initialize'\n
    app/models/workflow.rb:86:in `new'\n
    app/models/workflow.rb:86:in `script_path'\n
    app/models/workflow.rb:82:in `staged_script_exists?'\n
    app/views/workflows/index.html.erb:82:in
    `block in _app_views_workflows_index_html_erb___3385325133887156733_47935440'\n
    app/views/workflows/index.html.erb:81:in `_app_views_workflows_index_html_erb___3385325133887156733_47935440'"

The stack is thrown from here.

  def script_path
    Pathname.new(self.staged_dir).join(self.script_name.to_s)
  end

Maybe a simple to_s could be added, though why/how it never created the staged directory but it still created the db entry is the larger issue. Maybe we need to back out of the DB row if we can't create the DB entry.

┆Issue is synchronized with this Asana task by Unito