supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.07k stars 209 forks source link

Unable start local hosting with error "FATAL: could not access file \"supautils\"" #1900

Closed tazmaniax closed 6 months ago

tazmaniax commented 9 months ago

Describe the bug When I start the local hosting of Supabase using supabase start I get the following error and all of the containers are removed. This blocks local development for me.

% supabase start
supabase_rest_timesync container logs:
31/Jan/2024:10:50:01 +0000: Attempting to connect to the database...
31/Jan/2024:10:50:01 +0000: {"code":"PGRST000","details":"FATAL:  could not access file \"supautils\": No such file or directory\n","hint":null,"message":"Database connection error. Retrying the connection."}
31/Jan/2024:10:50:01 +0000: Attempting to reconnect to the database in 0 seconds...
31/Jan/2024:10:50:02 +0000: {"code":"PGRST000","details":"FATAL:  could not access file \"supautils\": No such file or directory\n","hint":null,"message":"Database connection error. Retrying the connection."}
31/Jan/2024:10:50:02 +0000: Attempting to reconnect to the database in 1 seconds...
31/Jan/2024:10:50:04 +0000: {"code":"PGRST000","details":"FATAL:  could not access file \"supautils\": No such file or directory\n","hint":null,"message":"Database connection error. Retrying the connection."}
31/Jan/2024:10:50:04 +0000: Attempting to reconnect to the database in 2 seconds...
31/Jan/2024:10:50:08 +0000: {"code":"PGRST000","details":"FATAL:  could not access file \"supautils\": No such file or directory\n","hint":null,"message":"Database connection error. Retrying the connection."}
31/Jan/2024:10:50:08 +0000: Attempting to reconnect to the database in 4 seconds...
31/Jan/2024:10:50:16 +0000: {"code":"PGRST000","details":"FATAL:  could not access file \"supautils\": No such file or directory\n","hint":null,"message":"Database connection error. Retrying the connection."}
31/Jan/2024:10:50:16 +0000: Attempting to reconnect to the database in 8 seconds...

To Reproduce Steps to reproduce the behavior:

  1. Run 'supabase start' at the command prompt
  2. See error

Expected behavior Local Supabase hosting up and running

Desktop (please complete the following information):

sweatybridge commented 9 months ago

Hi, could you report the versions from supabase services command to help me reproduce?

tazmaniax commented 9 months ago

Hi @sweatybridge, here is the output...


% supabase services

        SERVICE IMAGE      │        LOCAL         │  LINKED
  ─────────────────────────┼──────────────────────┼────────────
    supabase/postgres      │ 15.1.0.44            │ 15.1.0.44
    supabase/gotrue        │ v2.132.3             │ v2.132.3
    postgrest/postgrest    │ v10.2.0              │ v10.2.0
    supabase/realtime      │ v2.25.50             │ -
    supabase/storage-api   │ v0.46.5              │ v0.46.5
    supabase/edge-runtime  │ v1.32.0              │ -
    supabase/studio        │ 20240101-8e4a094     │ -
    supabase/postgres-meta │ v0.75.0              │ -
    supabase/logflare      │ 1.4.0                │ -
    bitnami/pgbouncer      │ 1.20.1-debian-11-r39 │ -
    darthsim/imgproxy      │ v3.8.0               │ -
tazmaniax commented 9 months ago

@sweatybridge not being able to run the local environment is a real blocker. Is there a quick workaround to reset my environment? Is it possible the REST service container has become corrupted? Thanks!

sweatybridge commented 9 months ago

Yes, sorry for the late reply.

The PostgREST version you are running on the hosted platform doesn't seem compatible with the latest version of Postgres (locally it uses the latest version for anything below 15.1.0.55).

You can reset the local versions by running rm -rf supabase/.temp. Let me know if you are running into other errors.

tazmaniax commented 9 months ago

So deleting the temp folder did get past the original issue and relinking to the hosted platform reintroduces the error, confirming your point about the hosted version of the PostgREST not being compatible. I will need to link to the hosted platform at some point to synchronize migrations and functions at some point. However, when I did start up the local environment without being linked to the hosted platform I encountered a whole bunch of migration errors and all of the containers were stopped except for supabase_storage_sync. CleanShot 2024-02-02 at 16 39 09@2x Can I resolve this by resetting the database, e.g. supabase db start followed by supabase db reset ?

% supabase start       
supabase_storage_sync container logs:
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
running migrations
(node:1) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/postgres-migrations/dist/migrate.js:100
            const error = new Error(`Migration failed. Reason: ${e.message}`);
                          ^

Error: Migration failed. Reason: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
This means that the scripts have changed since it was applied.
    at /app/node_modules/postgres-migrations/dist/migrate.js:100:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ... 3 lines matching cause stack trace ...
    at async /app/dist/server.js:22:9 {
  cause: Error: Hashes don't match for migrations '0002-pathtoken-column.sql,0003-add-migrations-rls.sql,0004-add-size-functions.sql,0005-change-column-name-in-get-size.sql,0006-add-rls-to-buckets.sql,0007-add-public-to-buckets.sql,0008-fix-search-function.sql,0009-search-files-search-function.sql,0010-add-trigger-to-auto-update-updated_at-column.sql,0011-add-automatic-avif-detection-flag.sql,0012-add-bucket-custom-limits.sql,0013-use-bytes-for-max-size.sql,0014-add-can-insert-object-function.sql,0015-add-version.sql,0016-drop-owner-foreign-key.sql,0017-add_owner_id_column_deprecate_owner.sql'.
  This means that the scripts have changed since it was applied.
      at Object.validateMigrationHashes (/app/node_modules/postgres-migrations/dist/validation.js:24:15)
      at /app/node_modules/postgres-migrations/dist/migrate.js:86:26
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async /app/node_modules/postgres-migrations/dist/with-lock.js:25:28
      at async connectAndMigrate (/app/dist/database/migrate.js:42:9)
      at async runMigrations (/app/dist/database/migrate.js:14:5)
      at async /app/dist/server.js:22:9
}

Node.js v18.18.2
service not healthy: [supabase_storage_togglsync]
Try rerunning the command with --debug to troubleshoot the error.
tazmaniax commented 9 months ago

@sweatybridge Ok I did supabase db start and supabase db reset and now supabase start works. Not sure if that was a good plan 😄 . However, linking to the hosting hosted platform still causes the original issues and then I have to go through removing .temp and then running db start and reset again to resolve the migration issues and get back to a good place locally with an unlinked environment. How will I ever link to the hosted platform without causing these issues? Thanks!

sweatybridge commented 9 months ago

I think it's best that you upgrade the version of PostgREST on your hosted project. Currently all new projects are using PostgREST 12 which is 2 major versions above the one you are running.

If you file a support ticket through the dashboard, our team will be happy to assist.

tazmaniax commented 9 months ago

@sweatybridge that sounds like a good plan. I'll do that now, thanks! Why would my hosted platform postgrest/postgrest version not be the latest? Are the versions locked at some point? Why is Postgres upgraded but not PostgREST to stay compatible? Can components only be upgraded through a support request?

sweatybridge commented 6 months ago

Sorry for the late reply. The PostgREST version is currently pinned when you create a project. We plan to allow users to self-serve PostgREST upgrades but there isn't a specific timeline. Currently support request is the only way unfortunately.

Why is Postgres upgraded but not PostgREST to stay compatible?

This is indeed a hairy problem. We've run into this problem ourselves with our internal api. The tl;dr is upgrading automatically could introduce breaking changes to user's application code because the json response from PostgREST may be different. It would be safer to plan for some downtime ahead when doing major version upgrade.

We will publish more docs on this in the coming months as we work through our own internal PostgREST upgrade. Stay tuned.