Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_filestat_get #324

Closed
ohadvano opened this issue Sep 5, 2022 · 2 comments

Comments

@ohadvano
Copy link

ohadvano commented Sep 5, 2022

Describe the bug / error

When I am trying to use the following package: "google.golang.org/protobuf/proto"
And in particular:

func (ctx *setBodyContext) OnHttpRequestBody(bodySize int, endOfStream bool) types.Action {
    _ = proto.String("x")
    return types.ActionContinue
}

I get the following error during Envoy startup:
Failed to load Wasm module due to a missing import: wasi_snapshot_preview1.fd_filestat_get

When I give up this package the error is gone and the module loads successfully.

What is your Envoy/Istio version?

envoyproxy/envoy-dev:ce4845329292c3b896fc0d26d5555e6ab54a30b7

What is the SDK version?

Commit bd6f695

What is your TinyGo version?

tinygo version 0.25.0 windows/amd64 (using go version go1.19 and LLVM version 14.0.0)

URL or snippet of your code including Envoy configuration

          http_filters:
          - name: envoy.filters.http.wasm
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
              config:
                vm_config:
                  runtime: "envoy.wasm.runtime.v8"
                  code:
                    local:
                      filename: "grpc.wasm"

Additional context (Optional)

@mathetake
Copy link
Member

It's not the issue of this SDK, but the problem of the host implementation used by Envoy: https://github.com/proxy-wasm/proxy-wasm-cpp-host

Could you open an issue there? Thanks!

@mathetake
Copy link
Member

BTW, protobuf cannot work with TinyGo, so you might want to seek alternative. See tinygo-org/tinygo#447

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants