Skip to content
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

Cannot use Wasm Wrappers on CLI v1.223.10 #2902

Open
burmecia opened this issue Nov 20, 2024 · 2 comments
Open

Cannot use Wasm Wrappers on CLI v1.223.10 #2902

burmecia opened this issue Nov 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@burmecia
Copy link
Member

Describe the bug
The Wasm Wrappers cannot be used with CLI v1.223.10.

To Reproduce
Steps to reproduce the behavior:

  1. create a new project: supabase init
  2. start the project: supabase start
  3. connect to the db using psql: psql "postgresql://postgres:[email protected]:54322/postgres"
  4. create Wasm foreign data wrapper and table:
create extension if not exists wrappers;

create foreign data wrapper wasm_wrapper
  handler wasm_fdw_handler
  validator wasm_fdw_validator;

create server paddle_server
  foreign data wrapper wasm_wrapper
  options (
    fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_paddle_fdw_v0.1.1/paddle_fdw.wasm',
    fdw_package_name 'supabase:paddle-fdw',
    fdw_package_version '0.1.1',
    fdw_package_checksum 'c5ac70bb2eef33693787b7d4efce9a83cde8d4fa40889d2037403a51263ba657',
    api_url 'https://sandbox-api.paddle.com',
    api_key '<Paddle api key>'
  );

create schema if not exists paddle;

create foreign table paddle.customers (
  id text,
  name text,
  email text,
  status text,
  custom_data jsonb,
  created_at timestamp,
  updated_at timestamp,
  attrs jsonb
)
  server paddle_server
  options (
    object 'customers',
    rowid_column 'id'
  );

select * from paddle.customers;
  1. See error: io error: Permission denied (os error 13)

Expected behavior
Expect the foreign table works correctly without error.

Screenshots
image

System information
Rerun the failing command with --create-ticket flag.

  • Ticket ID: [e.g. ab1ac733e31e4f928a4d7c8402543712]
  • Version of OS: MacOS 14.6.1
  • Version of CLI: v1.223.10
  • Version of Docker: v27.3.1
  • Versions of services:
image

Additional context
If applicable, add any other context about the problem here.

  • Browser: N/A
  • Version of supabase-js: N/A
  • Version of Node.js: N/A
@burmecia
Copy link
Member Author

burmecia commented Nov 20, 2024

The possible cause of this issue is the home directory (/var/lib/postgresql) of postgres user isn't writable by postgres user in the supabase/postgres service container.

The Wasm Wrapper needs to download a .wasm file from github when the foreign table is queried, and the file will be cached locally in $HOME/.cache directory. The $HOME directory is /var/lib/postgresql for postgres user, but it is not writable by postgres user.

image

@avallete avallete added the bug Something isn't working label Nov 20, 2024
@avallete
Copy link
Member

Has been reproduced bug is due to the upgrade from postgres 15.1 to 15.6. A fix is on the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants