ConduitSSHWorkflow.php double decodes json

When trying to using the conduit ssh integration I was finally able to figure out the correct JSON needed to be sent, which then leads to what appears to be a double JSON decoding issue.

On line 31 of ConduitSSHWorkflow.php (https://github.com/phacility/phabricator/blob/master/src/applications/conduit/ssh/ConduitSSHWorkflow.php#L31) the passed in JSON is decoded into $raw_params. Later params is indexed out of the array into $params which is then re-decoded on line 39 (https://github.com/phacility/phabricator/blob/master/src/applications/conduit/ssh/ConduitSSHWorkflow.php#L39) which leads to the following errors since an array is being passed when a string is expected.

When you’re JSON doesn’t contain the correct params key than $params is replaced with [] and the second decode runs fine. I believe this should be replaced with array() and the second decode removed, much like is done with the later $metadata idx.

[2020-04-21 10:02:30] ERROR 2: substr() expects parameter 1 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:484]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 substr(array, integer, integer) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:484]
  #1 JsonLintJsonParser::failOnBOM(array) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:135]
  #2 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #3 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #4 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #5 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: preg_match() expects parameter 2 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 preg_match(string, array, NULL) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:132]
  #1 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #2 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #3 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #4 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #5 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #6 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #7 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
[2020-04-21 10:02:30] ERROR 2: substr() expects parameter 1 to be string, array given at [/opt/phab/libphutil/externals/jsonlint/src/Seld/JsonLint/Lexer.php:98]
arcanist(head=stable, ref.master=3d06bd4c568c, ref.stable=8b5fbb5a1346), phabricator(head=stable, ref.master=adbd7d4fd8a2, ref.stable=f0f352ffd083), phutil(head=stable, ref.master=59642f236822, ref.stable=7736d42caf87)
  #0 substr(array, integer, integer) called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:98]
  #1 JsonLintLexer::getUpcomingInput() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:84]
  #2 JsonLintLexer::showPosition() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:165]
  #3 JsonLintLexer::next() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/Lexer.php:58]
  #4 JsonLintLexer::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:467]
  #5 JsonLintJsonParser::lex() called at [<phutil>/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178]
  #6 JsonLintJsonParser::parse(array, integer) called at [<phutil>/src/parser/PhutilJSONParser.php:27]
  #7 PhutilJSONParser::parse(array) called at [<phutil>/src/utils/utils.php:1295]
  #8 phutil_json_decode(array) called at [<phabricator>/src/applications/conduit/ssh/ConduitSSHWorkflow.php:39]
  #9 ConduitSSHWorkflow::execute(PhutilArgumentParser) called at [<phabricator>/scripts/ssh/ssh-exec.php:284]
phabricator-ssh-exec: Lexical error on line 1. Unrecognized text.

I don’t expect that Conduit-over-SSH is usable today – it has been a proof-of-concept without any real traction for a long time. See https://secure.phabricator.com/T550. In particular, there is no way to batch commands over a single connection or send metadata, both of which are fairly important.

Did you find something in the documentation which implied Conduit-over-SSH is in better shape than it really is? Let me know and I’ll fix it.

Otherwise, this is somewhere on the roadmap, but it doesn’t currently have much customer interest so it’s likely a long way away (it hasn’t really moved forward in ~8 years).

I see, in order to talk with our Phab instance from say AWS this is our only option because it is behind a series of proxies. Basic things like getting a list of repositories work and was hoping to get some basic functionality like post comments.

No, that was part of the problem, I wasn’t able to find any documentation and was piecing things together by looking at code and trying to figure out the correct way to submit things.

If this is a dead-end, I’ll look into what other options I may have. Thanks.