Skip to content

Cannot use Wasm Wrappers on CLI v1.223.10 #2902

Closed

Description

@burmecia

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:postgres@127.0.0.1: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

Activity

  1. burmecia commented on Nov 20, 2024

    @burmecia
    ContributorAuthor

    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
  2. avallete commented on Nov 20, 2024

    @avallete
    Member

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

    CF: https://supabase.slack.com/archives/C07E5GFAHTM/p1732094172504449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions