Railway API timing out on adding env variable
passos
MODERATOROP

5 months ago

we're using Infisical to sync our env variables to Railway but for whatever reason it's taking a long time and even getting timeouts when adding env variables.

any thoughts on what's happening?

21 Replies

brody
EMPLOYEE

5 months ago

What API call are you making?


passos
MODERATOROP

5 months ago

it uses variableUpsert


passos
MODERATOROP

5 months ago


passos
MODERATOROP

5 months ago

and each variable is a call


passos
MODERATOROP

5 months ago

maybe it should be using variableCollectionUpsert instead? would that make a big difference?


brody
EMPLOYEE

5 months ago

They need to do one call to variableCollectionUpsert with skipDeploys set to true and then a call to redeploy the deployment with deploymentRedeploy


passos
MODERATOROP

5 months ago

i'll see if i can do a PR, not a paid user so I doubt they would care to what I say


passos
MODERATOROP

5 months ago

thanks brody


brody
EMPLOYEE

5 months ago

No problem!


passos
MODERATOROP

5 months ago

seems like there's no variableCollectionDelete, trying null also doesn't work.
i'll go with variableDelete with skipDeploys true, hopefully that goes ok


brody
EMPLOYEE

5 months ago

For that, you would use the replace option to set only the variables you want to keep; the rest will be removed.


passos
MODERATOROP

5 months ago

oh there's a replace parameter, didn't notice that


passos
MODERATOROP

5 months ago

ok let me try


passos
MODERATOROP

5 months ago

working on it

hopefully by tomorrow it's ready


brody
EMPLOYEE

5 months ago

Yippee, a shoutout!


brody
EMPLOYEE

5 months ago

const latestDeploymentId = latestDeployment?.deployments.edges[0].node.id;

The latest deployment is not always going to be the active deployment.


passos
MODERATOROP

5 months ago

what? what could it be then?


passos
MODERATOROP

5 months ago

also, is there a way to seal variables through the API? 🙂


brody
EMPLOYEE

5 months ago

You would likely want to filter by the most recent successful deployments, and then fall back to the most recent if there are no successful deployments.


brody
EMPLOYEE

5 months ago

Not on the public API afaik


passos
MODERATOROP

5 months ago

Oh makes sense, will do that change


Loading...