Flakiness when creating Postgres with Railway CLI
infomiho
PROOP

a month ago

While running automated tests for deploying Railway apps via Wasp's CLI, I've come to experience a bit of flakiness with the following command railway add -d postgres.

Wasp CLI creates a server, client and the DB service. Let me share you one failure instance:

I guess I'm trying to report this as a bug/flakiness but also trying to better understand how I defend against this? Should I create a Github issue with this?

cc: <@539512869780455445> as our usual savior 😄

15 Replies

brody
EMPLOYEE

a month ago

Where can I find the yaml file for that action?



brody
EMPLOYEE

a month ago

Thank you, how can I see what the railway add -d postgres command failed with?


infomiho
PROOP

a month ago

That's the thing - it didn't fail since this call await railwayCli(["add", "-d", "postgres"]); throws if the command exits with code 1

For example, if I modify the command to be railway add -d postgrex (x instead of s) it would fail like this:

...

🚀 Setting up database
$ railway add -d postgrex
error: invalid value 'postgrex' for '--database '
  [possible values: postgres, mysql, redis, mongo]

  tip: a similar value exists: 'postgres'

For more information, try '--help'.

🚀 error: invalid value 'postgrex' for '--database '
🚀   [possible values: postgres, mysql, redis, mongo]
🚀 
🚀   tip: a similar value exists: 'postgres'
🚀 
🚀 For more information, try '--help'.
🚀 
🚀     at Proxy.set (/Users/ilakovac/dev/wasp/waspc/data/packages/deploy/node_modules/zx/build/core.cjs:277:18)
🚀     exit code: 1--- [Error] Deploy command failed: ---------------------------------------------

Deploy command failed with exit code: 1

The command in the CI didn't fail, it looked like it succeeded but no service was created. That's why I'm asking for some insight 🙂


brody
EMPLOYEE

a month ago

Can you give me the exact timestamp (in UTC) for that command that you linked in the original action logs, and the user UUID that the token belongs to?


infomiho
PROOP

a month ago

User UUID (got it from the Network tab):

6b0344d3-105e-4a05-aa43-d813943471e3

Exact timestamp:

2025-11-10T14:07:54.8152681Z $ railway add -d postgres (raw Github Action logs)

Project name:

ci-19234193478

Thanks @Brody


milo
MODERATOR

a month ago

im quite confused as to how this just is silently failing. the add command has pretty extensive error handling. ill take a proper look in about an hour when im at my computer


milo
MODERATOR

a month ago

does it always fail?


milo
MODERATOR

a month ago

or is this more random


infomiho
PROOP

a month ago

It fails sometimes, as I said in the title, I'd call it flaky based on how it fails sometimes 🙂


milo
MODERATOR

a month ago

interesting. I’m gonna add a verbose option to the command which should be cut in a release soon 🙂


infomiho
PROOP

a month ago

Let us know when it's out so we can add it ourselves as well 🙂


milo
MODERATOR

a month ago

https://github.com/railwayapp/cli/pull/692 pr has been made, introduces very basic verbose logging for the deployment of templates


milo
MODERATOR

15 days ago

hi @miho, can you upgrade to railway v4.12.0 and pass --verbose to the add command and see what it prints?


milo
MODERATOR

7 days ago

have you seen it fail yet?


Loading...