TritonDataCenter / node-manta

Node.js SDK for Manta
75 stars 54 forks source link

mjob fails with mjob: AssertionError: body (object) is required #277

Closed ryanpuck closed 8 years ago

ryanpuck commented 8 years ago

After upgrading from manta@3.0.0 to 3.1.2, mjob began failing like so:

mfind -t o /xxxx/stor/demo/bard | mjob create  -o -w -m "wc -l"
added 44 inputs to 1b2d3c21-07f1-e2a8-8633-efae110b9a81
mjob: AssertionError: body (object) is required

Original node version was .12.15, same behavior is seen on 4.6.1

trentm commented 8 years ago

Here is a repro with some verbose logging:

$ echo /trent.mick/stor/tmp/a.txt | mjob create -o -v -w -m "wc -l" 2>&1 | bunyan
...
[2016-10-27T21:16:00.763Z] DEBUG: mjob/MantaClient/4168 on danger0.local (/Users/trentm/joy/node-manta/lib/client.js:2631 in endJob): endJob: entered (req_id=94c5f6f6-539d-48d6-b07e-28a6ff196007, job=0c9c047c-4f56-4aa3-ccfa-bbcef3756c04)
    path: /trent.mick/jobs/0c9c047c-4f56-4aa3-ccfa-bbcef3756c04/live/in/end
    --
    options: {
      "headers": {
        "accept": "application/json",
        "content-length": 0,
        "content-type": "application/json",
        "x-request-id": "94c5f6f6-539d-48d6-b07e-28a6ff196007"
      },
      "id": "94c5f6f6-539d-48d6-b07e-28a6ff196007",
      "path": "/trent.mick/jobs/0c9c047c-4f56-4aa3-ccfa-bbcef3756c04/live/in/end",
      "query": {}
    }
mjob: AssertionError: body (object) is required

That 'endJob' client call is doing this: https://github.com/joyent/node-manta/blob/0e222e9a1ab7b421013b02e3b458c44e00e84bff/lib/client.js#L2643 IOW calling <jsonclient>.post with no body argument. Lo and behold: https://github.com/restify/clients/issues/90 "assert-plus@1.0.0 update in v1.3.2 broke calling JSONCLIENT.post without a body argument"

In manta@3.0.0 a dep on restify-clients@~1.3.0 was added. So as soon as restify-clients@1.3.2 was released, new installs of npm install manta got a broken endJob.

trentm commented 8 years ago

published in manta@3.1.3