Flakiness when creating Postgres with Railway CLI
infomiho
PROOP

4 months 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

4 months ago

Where can I find the yaml file for that action?



4 months ago

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


infomiho
PROOP

4 months 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 🙂


4 months 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

4 months 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


4 months 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


4 months ago

does it always fail?


4 months ago

or is this more random


infomiho
PROOP

4 months ago

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


4 months ago

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


infomiho
PROOP

4 months ago

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


4 months ago

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


3 months ago

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


3 months ago

have you seen it fail yet?


Loading...