jonee opened a new issue #5043:
URL: https://github.com/apache/openwhisk/issues/5043


   <!--
   We use the issue tracker for bugs and feature requests. For general 
questions and discussion please use http://slack.openwhisk.org/ or 
https://openwhisk.apache.org/contact.html instead.
   
   Do NOT share passwords, credentials or other confidential information.
   
   Before creating a new issue, please check if there is one already open that
   fits the defect you are reporting.
   If you open an issue and realize later it is a duplicate of a pre-existing
   open issue, please close yours and add a comment to the other.
   
   Issues can be created for either defects or enhancement requests. If you are 
a committer than please add the labels "bug" or "feature". If you are not a 
committer please make clear in the comments which one it is, so that committers 
can add these labels later.
   
   If you are reporting a defect, please edit the issue description to include 
the
   information shown below.
   
   If you are reporting an enhancement request, please include information on 
what you are trying to achieve and why that enhancement would help you.
   
   For more information about reporting issues, see
   
https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md#raising-issues
   
   Use the commands below to provide key information from your environment:
   You do not have to include this information if this is a feature request.
   -->
   
   ## Environment details:
   
   * IBM Cloud Functions
   * Golang or Docker / Native runtime
   
   ## Steps to reproduce the issue:
   
   1.   Create the action with the code below (ibmcloud fn action update 
helloGo main.go --kind go:1.15 --web true)
   2.   Retrieve the web action and invoke with a post
   ibmcloud fn action get helloGo --url <- returns your url
   
   curl -X POST -d '{"name":"sfdsfs4 "}' 
https://us-south.functions.appdomain.cloud/api/v1/<xxx>/helloGo.json
   
   ## Provide the expected results and outputs:
   
   ```
   Expects the program to not error out and work as intended
   ```
   
   
   ## Provide the actual results and outputs:
   
   ```
   {"code":"6683a4187e392c69625e2dbafba217ee","error":"Illegal query: Invalid 
input ' ', expected '+', '=', query-char, 'EOI', '&' or pct-encoded (line 1, 
column 17): {\"name\":\"sfdsfs4 \"}\n                ^"}
   
   ```
   
   ## Additional information you deem important:
   * issue happens 100% of the time and should be easy to reproduce 
   * It errors out when a post parameter has a space character. If a parameter 
has the +, it becomes a space. 
   * Also, for native / docker it does not reuse variables outside of the main 
function (as compared to Golang runtime). This is usually used to reuse db 
connection. 
   
   
   
   
   Code for golang runtime
   save as main.go
   ibmcloud fn action update helloGo main.go --kind go:1.15 --web true
   ibmcloud fn action get helloGo --url # returns your url
   curl -X POST -d '{"name":"sfdsfs4 "}' 
https://us-south.functions.appdomain.cloud/api/v1/<xxx>/helloGo.json
   ibmcloud wsk activation logs --last # returns the logs
   
   
   
   
   package main
   
   import (
       "log"
       "os"
       "time"
   )
   var t0 time.Time
   
   func Main(params map[string]interface{}) map[string]interface{} {
       log.Println("params")
       log.Println(params)
   
       log.Println("os.Args")
       log.Println(os.Args)
   
       if t0.IsZero() {
                t0 = time.Now()
                log.Println("new t0")
        } else {
                log.Println("re used t0")
       }
   
       res := make(map[string]interface{})
       res["body"] = "Hello!"
       return res
   }
   
   
   Code for native / docker runtime
   save as main.go
   GOOS=linux GOARCH=amd64 go build -o exec
   zip exec.zip exec
   ibmcloud wsk action update helloGo --native exec.zip
   ibmcloud fn action get helloGo --url <- returns your url
   curl -X POST -d '{"name":"sfdsfs4 "}' 
https://us-south.functions.appdomain.cloud/api/v1/<xxx>/helloGo.json
   ibmcloud wsk activation logs --last # returns the logs
   
   
   
   
   package main
   
   import (
       "fmt"
       "log"
       "os"
       "time"
       "encoding/json"
   )
   var t0 time.Time
   
   func main() {
       log.Println("os.Args")
       log.Println(os.Args)
   
       if t0.IsZero() {
                t0 = time.Now()
                log.Println("new t0")
        } else {
                log.Println("re used t0")
       }
   
       msg := map[string]string{"body": ("Hello!")}
       res, _ := json.Marshal(msg)
       fmt.Println(string(res))
   }
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to