TritonDataCenter / node-manta

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

mchmod throws InvalidPathError on v5.2.0+ #363

Closed sysaeon closed 4 years ago

sysaeon commented 5 years ago

Since v5.2.0, it seems that mchmod is not parsing options properly, and therefore fails to apply role tags. If I install v5.1.1 the same commands below work as expected.

$ mls ~~/stor/test.file
test.file
$ sdc-role list | json -a name
Everything
$ nvm use 4
Now using node v4.9.1 (npm v2.15.11)

$ mchmod --version
5.2.1
http://apidocs.joyent.com/manta

$ mchmod -v +Everything ~~/stor/test.file 2>&1 | bunyan

assert.js:377
assert.ifError = function(err) { if (err) throw err; };
                                          ^
InvalidPathError: +Everything is not a valid Manta path
    at Object.getPath [as path] (/Users/me/.nvm/versions/node/v4.9.1/lib/node_modules/manta/lib/client.js:319:15)
    at Object.assertPath (/Users/me/.nvm/versions/node/v4.9.1/lib/node_modules/manta/lib/utils.js:19:15)
    at getPath (/Users/me/.nvm/versions/node/v4.9.1/lib/node_modules/manta/lib/options.js:84:46)
    at Array.map (native)
    at Object.parseOptions (/Users/me/.nvm/versions/node/v4.9.1/lib/node_modules/manta/lib/options.js:87:29)
    at main (/Users/me/.nvm/versions/node/v4.9.1/lib/node_modules/manta/bin/mchmod:88:25)
    at Object.<anonymous> (/Users/me/.nvm/versions/node/v4.9.1/lib/node_modules/manta/bin/mchmod:145:3)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
$ nvm use 6
Now using node v6.16.0 (npm v3.10.10)

$ mchmod --version
5.2.1
http://apidocs.joyent.com/manta

$ mchmod -v +Everything ~~/stor/test.file 2>&1 | bunyan

assert.js:357
assert.ifError = function ifError(err) { if (err) throw err; };
                                                  ^
InvalidPathError: +Everything is not a valid Manta path
    at Object.getPath [as path] (/Users/me/.nvm/versions/node/v6.16.0/lib/node_modules/manta/lib/client.js:319:15)
    at Object.assertPath (/Users/me/.nvm/versions/node/v6.16.0/lib/node_modules/manta/lib/utils.js:19:15)
    at getPath (/Users/me/.nvm/versions/node/v6.16.0/lib/node_modules/manta/lib/options.js:84:46)
    at Array.map (native)
    at Object.parseOptions (/Users/me/.nvm/versions/node/v6.16.0/lib/node_modules/manta/lib/options.js:87:29)
    at main (/Users/me/.nvm/versions/node/v6.16.0/lib/node_modules/manta/bin/mchmod:88:25)
    at Object.<anonymous> (/Users/me/.nvm/versions/node/v6.16.0/lib/node_modules/manta/bin/mchmod:145:3)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
$ nvm use 8
Now using node v8.15.0 (npm v6.4.1)

$ mchmod --version
5.2.1
http://apidocs.joyent.com/manta

$ mchmod -v +Everything ~~/stor/test.file 2>&1 | bunyan

assert.js:816
assert.ifError = function ifError(err) { if (err) throw err; };
                                                  ^
InvalidPathError: +Everything is not a valid Manta path
    at Object.getPath [as path] (/Users/me/.nvm/versions/node/v8.15.0/lib/node_modules/manta/lib/client.js:319:15)
    at Object.assertPath (/Users/me/.nvm/versions/node/v8.15.0/lib/node_modules/manta/lib/utils.js:19:15)
    at getPath (/Users/me/.nvm/versions/node/v8.15.0/lib/node_modules/manta/lib/options.js:84:46)
    at Array.map (<anonymous>)
    at Object.parseOptions (/Users/me/.nvm/versions/node/v8.15.0/lib/node_modules/manta/lib/options.js:87:29)
    at main (/Users/me/.nvm/versions/node/v8.15.0/lib/node_modules/manta/bin/mchmod:88:25)
    at Object.<anonymous> (/Users/me/.nvm/versions/node/v8.15.0/lib/node_modules/manta/bin/mchmod:145:3)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
davepacheco commented 5 years ago

Should we mark this a dup of #358? You mention that fix will resolve it but I'm not sure if that meant it was the exact same issue or just that that change happened to also fix this one?

sysaeon commented 5 years ago

It sounds like the same issue based on the initial comment in #358:

mchmod thinks the [+-=]role is a manta path

I'm not sure if that PR originated from a different error though.

ptecza commented 5 years ago

Hello there,

Any progress on this issue? mchmod is useless to me now and I have to use Triton dashboard to set a proper role for my Manta files...

kellymclaughlin commented 4 years ago

I have published version 5.2.2 to npm which should resolve this issue.