Skip to content

Release 1.202.4 and later break seed on reset - Windows #2734

Closed

Description

@DuncanLHS

Describe the bug
Since Release 1.202.4, db reset no longer recognises my seed.sql file even though it exists in the expected location, supabase/seed.sql

To Reproduce
Steps to reproduce the behavior:

  1. Update to supabase cli v1.202.4 or later
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

image

System information

  • Version of OS: Windows 11
  • Version of CLI: v1.202.4 or later
  • Version of Docker: Docker Desktop v4.34.2
  • Versions of services:
        SERVICE IMAGE      │      LOCAL       │   LINKED
 ─────────────────────────┼──────────────────┼─────────────
   supabase/postgres      │ 15.6.1.127       │ 15.6.1.127
   supabase/gotrue        │ v2.162.1         │ v2.162.1
   postgrest/postgrest    │ v12.2.3          │ v12.2.3
   supabase/realtime      │ v2.30.34         │ -
   supabase/storage-api   │ v1.11.7          │ v1.11.7
   supabase/edge-runtime  │ v1.58.11         │ -
   supabase/studio        │ 20240923-2e3e90c │ -
   supabase/postgres-meta │ v0.83.2          │ -
   supabase/logflare      │ 1.4.0            │ -
   supabase/supavisor     │ 1.1.56           │ -

Activity

  1. sweatybridge commented on Oct 8, 2024

    @sweatybridge
    Contributor

    This is due to a bug in path separator handling. Could you try the beta release?

    npx supabase@beta db reset
    
  2. DuncanLHS commented on Oct 9, 2024

    @DuncanLHS
    Author

    @sweatybridge That's fixed it. Thanks.

    $ npx supabase@beta db reset
    Need to install the following packages:
    supabase@1.204.3
    Ok to proceed? (y) y
    
    Resetting local database...
    Recreating database...
    Setting up initial schema...
    Seeding globals from roles.sql...
    Applying migration ....
    Seeding data from supabase/seed.sql...
    Restarting containers...
    
  3. DuncanLHS commented on Oct 24, 2024

    @DuncanLHS
    Author

    Still seeing this issue on db pull and push:

    npx supabase db pull --local
    No seed files matched pattern: supabase/seed.sql
    No seed files matched pattern: supabase/seed.sql

    Not sure why as I don't believe the seed is used in these commands.

  4. sweatybridge commented on Oct 24, 2024

    @sweatybridge
    Contributor

    Hi @DuncanLHS, this is due to a recent change we made that validates config.toml more rigorously.

    You can avoid this log message by updating config.toml to disable seed config.

    [db.seed]
    enabled = false
    sql_paths = []
    
  5. DuncanLHS commented on Oct 24, 2024

    @DuncanLHS
    Author

    @sweatybridge To clarify, my seed file does exist at that location but I still get the warning message that it doesn't exist. This was fixed on db reset but doesn't appear to have been a universal fix.

    The new config settings are not set in my config as they're quite recent. In that case I would expect the default behaviour be that the seed is not performed after a migration as this is the precedent behaviour, in which case there would be no need to check for the seed file.

  6. sweatybridge commented on Oct 24, 2024

    @sweatybridge
    Contributor

    We parse and validate all config at the start of the command, even if some parts of it are not used.

    This was fixed on db reset but doesn't appear to have been a universal fix.

    This is weird because reset shouldn't fix anything as the error is from config validation. Which directory are you running supabase commands from?

  7. DuncanLHS commented on Oct 25, 2024

    @DuncanLHS
    Author

    @sweatybridge See the original bug at the top here. db reset was fixed i.e. the No seed file matched pattern warning no longer shows with the db reset command. It was an issue with reading the file system correctly on windows I believe. However, I'm still seeing the warning when using db push and db pull

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions