proxy-wasm/proxy-wasm-cpp-host

Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_get

mark8s opened this issue · 1 comments

I run a wasm on isito 1.9 got some error,the following is a detailed log:

2022-05-18T10:18:02.435367Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_get
2022-05-18T10:18:02.435389Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_dir_name
2022-05-18T10:18:02.435401Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.path_open
2022-05-18T10:18:02.435407Z	error	envoy wasm	Wasm VM failed Failed to initialize Wasm code
2022-05-18T10:18:02.436387Z	critical	envoy wasm	Plugin configured to fail closed failed to load
2022-05-18T10:18:02.436531Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:02.436546Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:02.436899Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:03.768273Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_get
2022-05-18T10:18:03.768293Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_dir_name
2022-05-18T10:18:03.768296Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.path_open
2022-05-18T10:18:03.768301Z	error	envoy wasm	Wasm VM failed Failed to initialize Wasm code
2022-05-18T10:18:03.769115Z	critical	envoy wasm	Plugin configured to fail closed failed to load
2022-05-18T10:18:03.769124Z	critical	envoy wasm	Plugin configured to fail closed failed to load
2022-05-18T10:18:03.769133Z	critical	envoy wasm	Plugin configured to fail closed failed to load
2022-05-18T10:18:03.769176Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:03.769181Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:03.769183Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:03.860205Z	warn	Envoy proxy is NOT ready: Get "http://127.0.0.1:15000/stats?usedonly&filter=^(cluster_manager\\.cds|listener_manager\\.lds)\\.(update_success|update_rejected)$": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
2022-05-18T10:18:04.085255Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_get
2022-05-18T10:18:04.085278Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_prestat_dir_name
2022-05-18T10:18:04.085281Z	error	envoy wasm	Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.path_open
2022-05-18T10:18:04.085286Z	error	envoy wasm	Wasm VM failed Failed to initialize Wasm code
2022-05-18T10:18:04.086084Z	critical	envoy wasm	Plugin configured to fail closed failed to load
2022-05-18T10:18:04.086140Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:04.086144Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:04.086147Z	warning	envoy config	gRPC config for type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig rejected: Unable to create Wasm HTTP filter 
2022-05-18T10:18:04.088679Z	info	Initialization took 2.352548864s
2022-05-18T10:18:04.088698Z	info	Envoy proxy is ready

My EnvoyFilter :

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  labels:
    app: mall-admin
  name: desensitize-mall-admin
  namespace: mall

spec:
  configPatches:
  - applyTo: HTTP_FILTER
    match:
      listener:
        filterChain:
          filter:
            name: envoy.http_connection_manager
      proxy:
        proxyVersion: ^1\.9.*
    patch:
      operation: INSERT_BEFORE
      value:
        config_discovery:
          config_source:
            ads: {}
            initial_fetch_timeout: 0s
          type_urls:
          - type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
        name: desensitize-mall-admin
  - applyTo: EXTENSION_CONFIG
    match: {}
    patch:
      operation: ADD
      value:
        name: desensitize-mall-admin
        typed_config:
          '@type': type.googleapis.com/udpa.type.v1.TypedStruct
          type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
          value:
            config:
              configuration:
                '@type': type.googleapis.com/google.protobuf.StringValue
                value: |
                  {
                    
                  }
              vm_config:
                code:
                  remote:
                    http_uri:
                      uri: http://10.10.13.47:2333/wasm/desensitize.wasm
                runtime: envoy.wasm.runtime.v8
                vm_id: desensitize-mall-admin
  workloadSelector:
    labels:
      app: mall-admin

When i run on istio 1.13,services run ok.
My wasm build by tinygo 1.17.

Who can help me???

envoy version must > v1.21.0 ,so istio version need >= 1.13