Bug #11606

[CWL] [API] empty array submitted as null

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

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Start date:
05/02/2017
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-

Description

https://workbench.9tee4.arvadosapi.com/container_requests/9tee4-xvhdp-9xb0s71vn96wfjc#Log

2017-05-01T20:04:11.122532550Z cwltool INFO: /usr/bin/arvados-cwl-runner fea486f94bb5cc8f51d9563eafc172b6ba2aec57 1.0.20170501164306, arvados-python-client 0.1.20170427165906, cwltool 1.0.20170413194156
2017-05-01T20:04:11.159842126Z cwltool INFO: Resolved '/var/lib/cwl/workflow.json#main' to 'file:///var/lib/cwl/workflow.json#main'
2017-05-01T20:04:12.339124255Z cwltool ERROR: Tool definition failed validation:
2017-05-01T20:04:12.339124255Z ../../lib/cwl/workflow.json:1:12: Object `../../lib/cwl/workflow.json#main` is not valid because
2017-05-01T20:04:12.339124255Z                                     tried `Workflow` but
2017-05-01T20:04:12.339124255Z ../../lib/cwl/workflow.json:1:45:     the `inputs` field is not valid because
2017-05-01T20:04:12.339124255Z                                         the value None is not a list, expected list of
2017-05-01T20:04:12.339124255Z                                         InputParameter
2017-05-01T20:04:12.953171642Z Container exited with code: 1

API log entry:

{"method":"POST","path":"/arvados/v1/container_requests","format":"json","controller":"Arvados::V1::ContainerRequestsController","action":"create","status":200,"duration":126.18,"view":0.42,"db":57.3,"params_truncated":"[...]","@timestamp":"2017-05-01T20:03:45.886888550Z","@version":"1","message":"[200] POST /arvados/v1/container_requests (Arvados::V1::ContainerRequestsController#create)"}

Container request received by API server (reformatted params_truncated):

{
  "runtime_constraints": {
    "API": true,
    "vcpus": 1,
    "ram": 1073741824
  },
  "container_image": "arvados/jobs:fea486f94bb5cc8f51d9563eafc172b6ba2aec57",
  "owner_uuid": null,
  "properties": {},
  "name": "count-lines9-wf.cwl",
  "priority": 1,
  "state": "Committed",
  "output_path": "/var/spool/cwl",
  "mounts": {
    "/var/spool/cwl": {
      "writable": true,
      "kind": "collection" 
    },
    "stdout": {
      "path": "/var/spool/cwl/cwl.output.json",
      "kind": "file" 
    },
    "/var/lib/cwl/workflow.json": {
      "content": {
        "cwlVersion": "v1.0",
        "$graph": [
          {
            "class": "Workflow",
            "inputs": null,
            "outputs": [
              {
                "type": "int",
                "outputSource": "#main/step2/output",
                "id": "#main/count_output" 
              }
            ],
            "steps": [
              {

Subtasks

Task #11607: Review 11606-rails4-no-mungeResolvedPeter Amstutz


Related issues

Related to Arvados - Bug #10935: [API] Empty list turned to nullResolved

Related to Arvados - Feature #7709: [API] Upgrade API server to Rails 4.2Resolved03/19/2017

Associated revisions

Revision e24a892b
Added by Tom Clegg over 4 years ago

Merge branch '11606-rails4-no-munge'

closes #11606

History

#1 Updated by Tom Clegg over 4 years ago

Despite the test case added in #10935, b07d8a573c74e7be56a2fd8c5064032c37d90c67, [] is getting munged to null here:

shell.9tee4:~$ curl -H "Content-Type: application/json" -H "Authorization: OAuth2 $ARVADOS_API_TOKEN" -X POST --data-binary '{"container_request":{"mounts":{"foo":[{"bar":[]}]}}}' https://9tee4.arvadosapi.com/arvados/v1/container_requests
{"method":"POST","path":"/arvados/v1/container_requests","format":"*/*","controller":"Arvados::V1::ContainerRequestsController","action":"create","status":422,"duration":11.32,"view":0.4,"db":0.94,"params":{"container_request":{"mounts":{"foo":[{"bar":null}]}}},"@timestamp":"2017-05-02T15:05:15.336329505Z","@version":"1","message":"[422] POST /arvados/v1/container_requests (Arvados::V1::ContainerRequestsController#create)"}

#2 Updated by Tom Clegg over 4 years ago

Our monkeypatch stopped working, and our test case wasn't running because it wasn't *_test.rb. Rails4 has a builtin feature to disable deep_munge.

11606-rails4-no-munge @ 974799e09498bc5fa27ba2e269a72f8ae5173793

#3 Updated by Tom Clegg over 4 years ago

  • Category set to API
  • Assigned To set to Tom Clegg
  • Target version set to 2017-05-10 sprint

#4 Updated by Peter Amstutz over 4 years ago

LGTM.

#5 Updated by Tom Clegg over 4 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados|commit:e24a892b920fd8cddf091a3c15acba1ab27f510d.

Also available in: Atom PDF