solo-io / wasm

Web Assembly tools and SDKs for extending cloud-native infrastructure
Apache License 2.0
305 stars 39 forks source link

Failed to initialize WASM code #163

Closed GuangTianLi closed 4 years ago

GuangTianLi commented 4 years ago

wasme version 0.0.26

When I deploy on Istio 1.6.7, I get this error from the istio-proxy container:

[Envoy (Epoch 0)] [2020-08-25 06:06:05.299][21][warning][config] [external/envoy/source/common/config/grpc_subscription_impl.cc:87] gRPC config for type.googleapis.com/envoy.api.v2.Listener rejected: Error adding/updating listener(s) 172.22.3.186_8000: Failed to initialize WASM code from /var/local/lib/wasme-cache/3f319eec32afdfb1c053e1aea3a665504ff9d5f5ea4019146bcb455dfaea29d1
virtualInbound: Failed to initialize WASM code from /var/local/lib/wasme-cache/3f319eec32afdfb1c053e1aea3a665504ff9d5f5ea4019146bcb455dfaea29d1
Sodman commented 4 years ago

Hi @GuangTianLi , did you create this filter yourself with wasme init? I just want to confirm that the filter being deployed is compatible with this version of Istio.  Are you using cpp or assemblyscript for this filter?

GuangTianLi commented 4 years ago

Istio version is 1.5.9.

I used proxy-wasm-rust-sdk to build my wasm. Is there a compatibility issus about this filter? @Sodman

When I used the latest wasme and init with assemblyscript to build my wasm, I still got log with invalid path in istio-proxy container.

  "dependencies": {
    "@assemblyscript/loader": "^0.14.8",
    "@solo-io/proxy-runtime": "^0.1.8",
    "assemblyscript": "^0.14.8"
  },
Sodman commented 4 years ago

When you say you got an invalid path in the logs, do you mean the same error message as you reported in your first comment? Because that doesn't look like a path error to me, it looks like the module code couldn't be loaded which could be either compile errors in the filter itself, or possibly an incompatible version (very possible with the rust sdk). So this could be something different if it's now saying there's an invalid path.

Both assemblyscript and c++ filters definitely work with Istio 1.5.x and 1.6.x. We are also actively working on getting assemblyscript support for Istio 1.7 very soon.

Are you deploying to istio with wasme deploy or are you using FilterDeployment resources?

GuangTianLi commented 4 years ago

It does work, when I use assemblyscript@0.9.1 and @solo-io/proxy-runtime@0.1.1 which is used in wasme init rather than latest version.

Sodman commented 4 years ago

That explains it, "@solo-io/proxy-runtime": "^0.1.8", is the latest release of the assemblyscript runtime and is specifically compatible with the ABI used by Istio 1.7, which has had breaking changes since the version used by 1.6.

Marking this issue as resolved, let us know if you run into any other issues!