csantanapr opened a new issue #150: error: Unable to invoke action using CLI 
when reading from file input
URL: https://github.com/apache/incubator-openwhisk-cli/issues/150
 
 
   @csantanapr commented on [Tue Sep 13 
2016](https://github.com/apache/incubator-openwhisk/issues/1248)
   
   sequence tutorial documented doesn't work with go-cli
   
   same tutorial works with old python cli
   1. Create an action sequence so that the result of one action is passed as 
an argument to the next action.
      
      ```
      $ wsk action create myAction --sequence 
/whisk.system/util/split,/whisk.system/util/sort
      ```
      
      This action sequence converts some lines of text to an array, and sorts 
the lines.
   2. Before you invoke the action sequence, create a text file called 
'haiku.txt' with a few lines of text:
      
      ```
      Over-ripe sushi,
      The Master
      Is full of regret.
      ```
   
   Using go cli
   
   ```
   $ wsk action invoke --blocking --result myAction --param payload "$(cat 
haiku.txt)"
   error: Unable to invoke action 'myAction': Unable to create HTTP request for 
POST 'actions/myAction?blocking=true': Error encoding request body: json: error 
calling MarshalJSON for type *json.RawMessage: invalid character '\n' in string 
literal
   ```
   
   Expected output:
   4. Invoke the action:
   
   ```
     $ wsk action invoke --blocking --result myAction --param payload "$(cat 
haiku.txt)"
   ```
   
   ```
     {
         "length": 3,
         "lines": [
             "Is full of regret.",
             "Over-ripe sushi,",
             "The Master"
         ]
     }
   ```
   
   
   ---
   
   @rabbah commented on [Tue Sep 13 
2016](https://github.com/apache/incubator-openwhisk/issues/1248#issuecomment-246587944)
   
   > error: Unable to invoke action 'myAction': Unable to create HTTP request 
for POST 'actions/myAction?blocking=true': Error encoding request body: json: 
error calling MarshalJSON for type *json.RawMessage: invalid character '\n' in 
string literal
   
   The cli should do a better job reporting errors. Three levels of "[e|E]rror" 
and multiple : is confusing and ugly; surely can do better on the message and 
its formatting. 
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to