question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrations failing to run

See original GitHub issue

Bug report

Describe the bug

Migrations are failing to run when starting the storage server

A clear and concise description of what the bug is.

supa-storage@0.0.1 restart:db docker-compose --project-dir . -f src/test/db/docker-compose.yml down && docker-compose --project-dir . -f src/test/db/docker-compose.yml up -d && sleep 5 && npm run migration:run

Stopping storage-api_rest_1 … done Stopping storage-api_db_1 … done Removing storage-api_rest_1 … done Removing storage-api_db_1 … done Removing network storage-api_default Creating network “storage-api_default” with the default driver Creating storage-api_db_1 … done Creating storage-api_rest_1 … done

supa-storage@0.0.1 migration:run ts-node-dev ./src/scripts/migrate-call.ts

[INFO] 17:56:58 ts-node-dev ver. 1.1.6 (using ts-node ver. 9.1.1, typescript ver. 4.2.3) running migrations (node:2616) UnhandledPromiseRejectionWarning: Error: Migration failed. Reason: An error occurred running ‘create-migrations-table’. Rolled back this migration. No further migrations were run. Reason: no schema has been selected to create in at D:\PROJECTS\storage-api\node_modules\postgres-migrations\dist\migrate.js:63:27 at processTicksAndRejections (internal/process/task_queues.js:93:5) at D:\PROJECTS\storage-api\node_modules\postgres-migrations\dist\with-lock.js:25:28 (Use node --trace-warnings ... to show where the warning was created) (node:2616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not han dled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:2616) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. clone supabase/storage-api
  2. cd storage-api
  3. npm run restart:db 4 migrations failing to run

Expected behavior

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

Server should run

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
iniancommented, Jun 15, 2021

Hi @difelice, can you check if postgrest has storage in PGRST_DB_SCHEMA like here

1reaction
heromiyocommented, Jun 8, 2021

Thanks, that was the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Failed Migrations - Microsoft Community Hub
A 'failed migration' is when the status of the move request shows as 'failed', and we have one or more failures logged in...
Read more >
migration failing to run - Laracasts
I have a migration that is failing to run. public function up() { Schema::create('users_watch_history', function (Blueprint $table) { $table->string('id', ...
Read more >
Why Do Migrations Fail and What Can We Do about It?
This paper investigates the main causes that make the application migration to Cloud complicated and error-prone through two case studies.
Read more >
Django test fails to run migrations - Stack Overflow
Now I'm stuck. The test_database gets created with all the tables up to these migrations' errors, with the vast majority lacking any data....
Read more >
Migration failed. Reason: An error occurred running 'pathtoken ...
I am trying to deploy supabase on my private server but supabase-storage image is failed to build. This cause other three image to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found