Wasm Filter Bad Argument Error returned by DispatchHttpCall Method
ermankuruoglu opened this issue · 1 comments
Describe the bug / error
We developed a wasm filter using this SDK and we are making POST requests to our services. When we tested it in an environment with Istio 3.0 installed, it worked correctly and we could see the response from our apis. However, due to some dependencies, we need to continue with Istio version 2.4. After installing Istio 2.4, the proxywasm.DispatchHttpCall function in the wasm filter started to throw the following error:
Here's a sample call:
logData := map[string]interface{}{
"version": "1.0"
}
jsonBody, serializeErr := json.Marshal(logData)
if serializeErr != nil {
proxywasm.LogCriticalf("%s: failed to serialize logData to JSON: %v", d.XRequestID, serializeErr)
return
}
_, err := proxywasm.DispatchHttpCall(
"outbound|8080||sample_cluster_name",
[][2]string{
{":authority", "sample_cluster_name"},
{":method", "POST"},
{":path", "/sample-path"},
{"Content-Type", "application/json"},
{"accept", "application/json"},
},
jsonBody,
nil,
10000,
d.callbackFunction,
)
if err != nil {
proxywasm.LogCriticalf("Failed to call Service: %v", err)
_ = proxywasm.ResumeHttpRequest()
}
Error log:
"Failed to call Service: error status returned by host: bad argument"
We are working on Openshift (4.14) clusters. sample_cluster_name is defined in envoy properties and these are correct. (As i said before we could see api responses on Istio 3.0 installed environment) As seen, the code block containing LogCriticalf is executed directly without falling into the callback function. The same error is returned from every service the wasm filter interacts with. Is this related to the Istio version, or do we need to make additional configurations? Thank you in advance for your assistance.
What is your Envoy/Istio version?
Envoy: 1.16.7
Istio: 2.4
What is the SDK version?
proxy-wasm-go-sdk: 0.23.0
What is your TinyGo version?
TinyGo: 0.30.0
URL or snippet of your code including Envoy configuration
Additional context (Optional)
Our environment: Openshift version 4.14
I'm sorry I see this is nothing to do with this SDK. given that it's working with 3.0, I'm confident that it's related to Istio specific stuff. In any case, I don't think there's nothing I can do here. Maybe ask in Istio slack?