R
Railway9mo ago
devon

Railway instance getting 'Error starting server' on redeploy with new (or same) environment variable

I had a Medusa backend instance running on Railway (completely fine since December). Just changed a single environment variable (was trying to add to the CORS), and then got errors on the re-deploy, and the instance never came back up. Nothing else changed. And when I change the variable back to its previous value, it also fails... I can 'rollback' and it works though. So I'm now 'stuck' with an old deploy I can't make any changes to... Can anyone interpret the deploy logs below (in the next message for length)? The build logs look fine too until the health check fails as a result of the server not starting... project id: a9d9c589-b108-418d-951e-f5817ea3bc1f Any ideas would be amazing, or let me know if more info needed...
3 Replies
Percy
Percy9mo ago
Project ID: a9d9c589-b108-418d-951e-f5817ea3bc1f
devon
devonOP9mo ago
Logs below:
production environment using .env.production
query: SELECT * FROM current_schema()
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "public"."migrations" "migrations" ORDER BY "id" DESC
No migrations are pending
production environment using .env.production
Using flag MEDUSA_FF_ANALYTICS from environment with value false
Using flag MEDUSA_FF_PRODUCT_CATEGORIES from environment with value true
Connection to Redis established
Initializing models
Models initialized
Initializing plugin models
Plugin models initialized
Initializing strategies
Strategies initialized
Initializing database
Database initialized
Initializing repositories
Repositories initialized
Initializing services
Services initialized
Initializing modules
Connection to Redis in module 'event-bus-redis' established
Connection to Redis in module 'cache-redis' established
Modules initialized
Initializing express
Express intialized
Initializing plugins
[info] [webpackbar] Compiling Webpack
[success] [webpackbar] Webpack: Compiled successfully in 20.61s
Registering custom endpoints for @medusajs/admin
Registering custom endpoints for medusa-plugin-resend
Registering custom endpoints for medusa-file-s3
Registering custom endpoints for @devon/medusa-file-bunny
Routes loaded in 1.63 ms
Routes loaded in 3.04 ms
No middleware files found in /app/node_modules/@medusajs/admin/api. Skipping middleware configuration.
No middleware files found in /app/node_modules/medusa-plugin-resend/api. Skipping middleware configuration.
Routes loaded in 8.72 ms
Routes loaded in 31.34 ms
Error starting server
production environment using .env.production
query: SELECT * FROM current_schema()
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "public"."migrations" "migrations" ORDER BY "id" DESC
No migrations are pending
production environment using .env.production
Using flag MEDUSA_FF_ANALYTICS from environment with value false
Using flag MEDUSA_FF_PRODUCT_CATEGORIES from environment with value true
Connection to Redis established
Initializing models
Models initialized
Initializing plugin models
Plugin models initialized
Initializing strategies
Strategies initialized
Initializing database
Database initialized
Initializing repositories
Repositories initialized
Initializing services
Services initialized
Initializing modules
Connection to Redis in module 'event-bus-redis' established
Connection to Redis in module 'cache-redis' established
Modules initialized
Initializing express
Express intialized
Initializing plugins
[info] [webpackbar] Compiling Webpack
[success] [webpackbar] Webpack: Compiled successfully in 20.61s
Registering custom endpoints for @medusajs/admin
Registering custom endpoints for medusa-plugin-resend
Registering custom endpoints for medusa-file-s3
Registering custom endpoints for @devon/medusa-file-bunny
Routes loaded in 1.63 ms
Routes loaded in 3.04 ms
No middleware files found in /app/node_modules/@medusajs/admin/api. Skipping middleware configuration.
No middleware files found in /app/node_modules/medusa-plugin-resend/api. Skipping middleware configuration.
Routes loaded in 8.72 ms
Routes loaded in 31.34 ms
Error starting server
Note that when I 'rollback' it says it will use the OLD environment variables (what I want) but then the UI shows the new ones.. Same in the CLI. Is there any way to see the ACTUAL environment variables being used by an instance?
Brody
Brody9mo ago
these logs look bleak, that's usually a sign of structured logging, you can hover over the line and click the plus button on the left to expand them so you can look at it's attributes
Want results from more Discord servers?
Add your server