The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Nest command unhandled error process exit 1 (#20312)
Paul Rastoin26874c36035e
diff --git a/packages/twenty-docker/twenty-app-dev/rootfs/etc/s6-overlay/scripts/init-db.sh b/packages/twenty-docker/twenty-app-dev/rootfs/etc/s6-overlay/scripts/init-db.shindex 50ad6d25382..39339ed53ea 100755--- a/packages/twenty-docker/twenty-app-dev/rootfs/etc/s6-overlay/scripts/init-db.sh+++ b/packages/twenty-docker/twenty-app-dev/rootfs/etc/s6-overlay/scripts/init-db.sh@@ -34,25 +34,27 @@ has_schema=$(PGPASSWORD=twenty psql -h localhost -U twenty -d default -tAc \"SELECT EXISTS (SELECT 1 FROM information_schema.schemata WHERE schema_name = 'core')")if [ "$has_schema" = "f" ]; then- step_start "Running initial database setup"- NODE_OPTIONS="--max-old-space-size=1500" node ./dist/database/scripts/setup-db.js+ step_start "Running initial database setup and migrations"+ yarn database:init:prodstep_donefi-step_start "Running migrations"-yarn database:migrate:prod --force-step_done-step_start "Flushing cache"-yarn command:prod cache:flush+if ! yarn command:prod cache:flush; then+ echo "Warning: Failed to flush cache before upgrade, but continuing startup..."+fistep_donestep_start "Running upgrade"-yarn command:prod upgrade+if ! yarn command:prod upgrade; then+ echo "Warning: Upgrade completed with errors. Some workspaces may not be fully migrated. Check logs for details."+fistep_donestep_start "Flushing cache"-yarn command:prod cache:flush+if ! yarn command:prod cache:flush; then+ echo "Warning: Failed to flush cache after upgrade, but continuing startup..."+fistep_done# Only seed on first boot — check if the dev workspace already existsdiff --git a/packages/twenty-docker/twenty/entrypoint.sh b/packages/twenty-docker/twenty/entrypoint.shindex ff63f2f5f5f..fd85657f5d0 100755--- a/packages/twenty-docker/twenty/entrypoint.sh+++ b/packages/twenty-docker/twenty/entrypoint.sh@@ -16,9 +16,17 @@ setup_and_migrate_db() {yarn database:init:prodfi- yarn command:prod cache:flush- yarn command:prod upgrade- yarn command:prod cache:flush+ if ! yarn command:prod cache:flush; then+ echo "Warning: Failed to flush cache before upgrade, but continuing startup..."+ fi++ if ! yarn command:prod upgrade; then+ echo "Warning: Upgrade completed with errors. Some workspaces may not be fully migrated. Check logs for details."+ fi++ if ! yarn command:prod cache:flush; then+ echo "Warning: Failed to flush cache after upgrade, but continuing startup..."+ fiecho "Successfully migrated DB!"}diff --git a/packages/twenty-server/src/command/command.ts b/packages/twenty-server/src/command/command.tsindex 3a156cc9723..7e0e28a267a 100644--- a/packages/twenty-server/src/command/command.ts+++ b/packages/twenty-server/src/command/command.ts@@ -13,6 +13,8 @@ async function bootstrap() {if (shouldCaptureException(err)) {exceptionHandlerService.captureExceptions([err]);}++ process.exitCode = 1;};const app = await CommandFactory.createWithoutRunning(CommandModule, {