9 days ago
I use the Railway Graph QL API to create and destroy per PR environments, as there are a lot of custom steps in our workflow that require us to go beyond the regular PR environment from the Railway Github App.
While in 90% of cases is runs fine, sometimes the pipeline fails. Sometimes a railway error or an error or timeout in another provider.
In this instance we just close and repopen the PR . Closing the PR destroys the Railway environment, and reopening recreates it.
However, a lot of times, were are faced with the error:
Railway GraphQL error: An environment with that name already exists
Upon consulting the Railway dashboard, that environment does not exist. Using the GraphQL API to query for environments, the environment also does not exist.
Trying do delete that environment through the GraphQL environment says it can't delete an environment that does not exist.
These 3 signals indicate that the environment does not exist. However, upon trying to create the environment through GraphQL, I always get the same error again, environment already exists.
It could be that the environment is in a "being deleted stage" that takes minutes, but this is not the case as I cannot create PR envs for PRs that were closed days or weeks ago.
I have not tried to recreate one of these environments through the dashboard.
I could also simply create an environment with a random hash in the environment name, but I am also afraid that I might be billed in the background for these ghost inaccessable PR envs.
1 Replies
Status changed to Awaiting Railway Response Railway • 9 days ago
9 days ago
You won't be billed for these orphaned environments since billing is based on active deployments, not environment records. To clean up the stale name reservations on our side, could you share your project URL and a couple of the environment names that are stuck in this state?
Status changed to Awaiting User Response Railway • 9 days ago
a day ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 1 day ago