-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM FDW url resolution issue #378
Comments
I’m not at my computer at the moment, but I have a diff or a PR that fixes this issue I can add in a few hours. |
Thank you very much for reporting this issue! We've noticed this issue and identified it was caused by different version of Rust wasm compiler. The GitHub release workflow always used the latest version of Rust, but the Wasm runtime used in Supabase was compiled with older version of Rust, so they are not compatible with each other. This issue has been fixed in #369, which fixed Rust version to |
Ah, so the issue on the Supabase platform was caused by binary incompatibility, that's interesting. The remote downloading issue is still an issue with |
Bug report
I have a few custom FDW's written with the postgres_fdw template provided. I've been working on an interesting error:
Query 1 ERROR at Line 1: : ERROR: wasmtime error: WebAssembly translation error
There seems to be some incorrect logic in handling http(s) related remote connections.
wrappers/wrappers/src/fdw/wasm_fdw/wasm_fdw.rs
Lines 46 to 122 in 8a30794
Describe the bug
Remote supabase postgres (15.6) database issues a:
Query 1 ERROR at Line 1: : ERROR: wasmtime error: WebAssembly translation error
after defining a remote server and foreign table pointing at a https file hosted outside of the "release process" on GitHub actions. Local postgres (16.6) crashes.To Reproduce
first test:
cargo component build --release --target wasm32-unknown-unknown
file:///
)second test:
cargo component build --release --target wasm32-unknown-unknown
http://localhost:8000/fdw/test_fdw.wasm
third test:
after compiling locally via
gh release
fourth test:
behavior is also present (no database crash) but WASM error on Postgres 15.6 (hosted on Supabase)
This reliably works on all supabase wasm-fdw's built locally with:
cargo component build --release --target wasm32-unknown-unknown
and served via any of the aforementioned endpoints: paddle, notion, etc.headers off another remote with should be the correct headers to indicate to
reqwest
to allow a successful download. I believe the current document deployment process is one where the GitHub action provided (softprops/action-gh-release@v2):https://github.com/softprops/action-gh-release/blob/92bc83c4214f780e84c7d2a85464a2ca05ebc2f0/src/github.ts#L143-L154
sets the correct mime type and serves it correctly as my test on manually issuing a release via
gh release
with the compiled output which is confirmed to be correct is also failing.Here's the current headers off the actual released artifact:
The testing of local HTTP caching seems to be off as I frequently have to remove the cache
rm * ~/Library/Caches/*.wasm
to get it to reload even over local HTTP.Final output:
Feel free to use the server mentioned in this docs, here's a simple test:
Expected behavior
All files served via http(s):// if
wasm-tools
reports that the file is correct and is working locally should just workSystem information
The text was updated successfully, but these errors were encountered: