-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Migrations failing to run #25
Comments
Hi @heromiyo, this happens if you don't have the search path set correctly. Can you ensure that the .env.sample file has been copied to .env and there is a PGOPTIONS in your .env file? |
Thanks, that was the issue |
I'm having similar issue running a container from Docker Compose logs: storage_1 | running migrations
storage_1 | finished migrations
storage_1 | [1623760631182] INFO (8 on 66b95fdc2426): Server listening at http://0.0.0.0:5000
storage_1 | Server listening at http://0.0.0.0:5000 rest_1 | 172.22.0.9 - - [15/Jun/2021:13:10:50 +0000] "GET /buckets?select=id%2Cname%2Cpublic%2Cowner%2Ccreated_at%2Cupdated_at HTTP/1.1" 404 - "" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)
kong_1 | 172.22.0.6 - - [15/Jun/2021:13:10:50 +0000] "GET /storage/v1/bucket HTTP/1.0" 400 88 "-" "PostmanRuntime/7.28.0"
storage_1 | [1623762650441] ERROR (1 on 076642b861e0): error bucket
storage_1 | "hint": null,
storage_1 | "details": null,
storage_1 | "code": "42P01",
storage_1 | "message": "relation \"public.buckets\" does not exist"
storage_1 | } $ docker compose exec storage /bin/bash -c 'env | grep PGO'
PGOPTIONS=-c search_path=storage Database looks OK: $ PGOPTIONS="-c search_path=storage" ./psql.sh
Null display is "💩".
psql (12.6, server 12.3 (Debian 12.3-1.pgdg100+1))
Type "help" for help.
postgres=# \d
List of relations
Schema | Name | Type | Owner
---------+------------+-------+----------
storage | buckets | table | postgres
storage | migrations | table | postgres
storage | objects | table | postgres
(3 rows) Thanks. |
Thank you! That was it. I missed completely from the |
Glad its sorted :) |
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.
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
[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). (rejectionid: 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:
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
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: