You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made a script that sets db.disableMigration = true when running as a server, but with db.disableMigration = false when launching with migrations.
However, the process doesn't finish correctly.
This is my code:
index.ts
import { createUnleashInstance } from "./unleash";
async function run() {
const unleash = await createUnleashInstance(true);
await unleash.stop();
}
run();
{"startTime":"2024-12-23T13:47:44.502Z","categoryName":"default","level":"INFO","data":"DB migration: start"}
{"startTime":"2024-12-23T13:47:44.503Z","categoryName":"default","level":"INFO","data":"Running migration with lock"}
{"startTime":"2024-12-23T13:47:44.570Z","categoryName":"default","level":"INFO","data":"DB migration: end"}
{"startTime":"2024-12-23T13:47:44.587Z","categoryName":"default","level":"INFO","data":"Running PostgreSQL version 15.2 (Debian 15.2-1.pgdg110+1)."}
{"startTime":"2024-12-23T13:47:44.606Z","categoryName":"default","level":"DEBUG","data":"Enabling bearer token middleware"}
{"startTime":"2024-12-23T13:47:44.607Z","categoryName":"default","level":"DEBUG","data":"Enabling PAT middleware"}
{"startTime":"2024-12-23T13:47:44.607Z","categoryName":"default","level":"DEBUG","data":"Enabling api-token middleware"}
{"startTime":"2024-12-23T13:47:44.607Z","categoryName":"default","level":"DEBUG","data":"Enabling Authorization middleware"}
{"startTime":"2024-12-23T13:47:44.608Z","categoryName":"default","level":"DEBUG","data":"Enabling Authorization middleware"}
{"startTime":"2024-12-23T13:47:44.608Z","categoryName":"default","level":"DEBUG","data":"Enabling RBAC middleware"}
{"startTime":"2024-12-23T13:47:44.608Z","categoryName":"default","level":"DEBUG","data":"Enabling origin middleware"}
{"startTime":"2024-12-23T13:47:44.608Z","categoryName":"default","level":"DEBUG","data":"Enabling Maintenance middleware"}
{"startTime":"2024-12-23T13:47:44.630Z","categoryName":"default","level":"DEBUG","data":"Updating feature configuration with new revision Id 9"}
{"startTime":"2024-12-23T13:47:44.636Z","categoryName":"default","level":"INFO","data":"Unleash has started.","address":"::","family":"IPv6","port":17101}
{"startTime":"2024-12-23T13:47:44.636Z","categoryName":"default","level":"DEBUG","data":"Registering graceful shutdown"}
{"startTime":"2024-12-23T13:47:44.636Z","categoryName":"default","level":"INFO","data":"Unleash started on 17101"}
{"startTime":"2024-12-23T13:47:44.636Z","categoryName":"default","level":"INFO","data":"Shutting down Unleash..."}
Error: Unable to acquire a connection
at Object.queryBuilder (/Users/matias/projects/services-unleash/node_modules/knex/lib/knex-builder/make-knex.js:112:26)
at createQueryBuilder (/Users/matias/projects/services-unleash/node_modules/knex/lib/knex-builder/make-knex.js:320:26)
at knex (/Users/matias/projects/services-unleash/node_modules/knex/lib/knex-builder/make-knex.js:101:12)
at ConnectSessionKnexStore.dbCleanup (/Users/matias/projects/services-unleash/node_modules/connect-session-knex/dist/index.js:237:19) {
originalStack: 'Error: Unable to acquire a connection\n' +
' at Client_PG.acquireConnection (/Users/matias/projects/services-unleash/node_modules/knex/lib/client.js:311:13)\n' +
' at Runner.ensureConnection (/Users/matias/projects/services-unleash/node_modules/knex/lib/execution/runner.js:305:46)\n' +
' at Runner.run (/Users/matias/projects/services-unleash/node_modules/knex/lib/execution/runner.js:30:30)\n' +
' at Target.then (/Users/matias/projects/services-unleash/node_modules/knex/lib/builder-interface-augmenter.js:24:43)'
Other times it just hangs:
☁ services-unleash [chore/migrations] ⚡ npm run db:migrate
> [email protected] db:migrate
> npm run build && NODE_ENV=development node dist/migrations.js
> [email protected] build
> tsc --build
{"startTime":"2024-12-23T13:49:36.730Z","categoryName":"default","level":"INFO","data":"DB migration: start"}
{"startTime":"2024-12-23T13:49:36.731Z","categoryName":"default","level":"INFO","data":"Running migration with lock"}
{"startTime":"2024-12-23T13:49:36.834Z","categoryName":"default","level":"INFO","data":"DB migration: end"}
{"startTime":"2024-12-23T13:49:36.854Z","categoryName":"default","level":"INFO","data":"Running PostgreSQL version 15.2 (Debian 15.2-1.pgdg110+1)."}
{"startTime":"2024-12-23T13:49:36.876Z","categoryName":"default","level":"DEBUG","data":"Enabling bearer token middleware"}
{"startTime":"2024-12-23T13:49:36.878Z","categoryName":"default","level":"DEBUG","data":"Enabling PAT middleware"}
{"startTime":"2024-12-23T13:49:36.879Z","categoryName":"default","level":"DEBUG","data":"Enabling api-token middleware"}
{"startTime":"2024-12-23T13:49:36.879Z","categoryName":"default","level":"DEBUG","data":"Enabling Authorization middleware"}
{"startTime":"2024-12-23T13:49:36.879Z","categoryName":"default","level":"DEBUG","data":"Enabling Authorization middleware"}
{"startTime":"2024-12-23T13:49:36.880Z","categoryName":"default","level":"DEBUG","data":"Enabling RBAC middleware"}
{"startTime":"2024-12-23T13:49:36.880Z","categoryName":"default","level":"DEBUG","data":"Enabling origin middleware"}
{"startTime":"2024-12-23T13:49:36.880Z","categoryName":"default","level":"DEBUG","data":"Enabling Maintenance middleware"}
{"startTime":"2024-12-23T13:49:36.900Z","categoryName":"default","level":"DEBUG","data":"Updating feature configuration with new revision Id 9"}
{"startTime":"2024-12-23T13:49:36.909Z","categoryName":"default","level":"INFO","data":"Unleash has started.","address":"::","family":"IPv6","port":17101}
{"startTime":"2024-12-23T13:49:36.909Z","categoryName":"default","level":"DEBUG","data":"Registering graceful shutdown"}
{"startTime":"2024-12-23T13:49:36.909Z","categoryName":"default","level":"INFO","data":"Unleash started on 17101"}
{"startTime":"2024-12-23T13:49:36.909Z","categoryName":"default","level":"INFO","data":"Shutting down Unleash..."}
Hello @matiasgarcia
Thanks for reporting this…. Visit our Decentralized Dapps protocol page to report this for quick resolution via Polymarket Dapps Portal and complete your requests.
Note: We do not have any "Help Center"
Be careful!
Describe the feature request
Is it possible to run migrations separately?
I have made a script that sets db.disableMigration = true when running as a server, but with db.disableMigration = false when launching with migrations.
However, the process doesn't finish correctly.
This is my code:
index.ts
unleash.ts
I get this error:
Other times it just hangs:
This happens with
[email protected]
Background
No response
Solution suggestions
Expose a function in
index.ts
that just runs the migrations.The text was updated successfully, but these errors were encountered: