2 years ago
Hi,
I have a Github Action that deploys PRs to Railway. It's based on https://github.com/Faolain/railway-pr-deploy with some changes that I made.
It has been working great up until the last week or so, it appears as if something changed with the API, and ever since I'm getting the following error:
{
"response": {
"errors": [
{
"message": "Cannot create trigger for repo user does not have access to",
"locations": [{ "line": 3, "column": 9 }],
"path": ["environmentCreate"],
"extensions": { "code": "INTERNAL_SERVER_ERROR" },
"traceId": "5441697194652517304"
}
],
"data": null,
"status": 200,
"headers": {}
},
"request": {
"query": "\n mutation environmentCreate($input: EnvironmentCreateInput!) {\n environmentCreate(input: $input) {\n id\n name\n createdAt\n deploymentTriggers {\n edges {\n node {\n id\n environmentId\n branch\n projectId\n }\n }\n }\n serviceInstances {\n edges {\n node {\n id\n domains {\n serviceDomains {\n domain\n id\n }\n }\n serviceId\n }\n }\n }\n }\n }\n ",
"variables": {
"input": {
"name": "***",
"projectId": "***",
"sourceEnvironmentId": "***"
}
}
}
}If it matters, I'm using a global token (ie from my account settings, not a project settings).
Would appreciate any help with this!
42 Replies
Hi team, is there any preferred method to ask these kind of questions?
2 years ago
Cannot create trigger for repo user does not have access toare you sure you have access to the source repo of the service?
Hey Brody, thank you for your reply. Honestly I'm a little confused about who's the "user" in this case, that's supposed to have access.
The GraphQL API request is initiated by Github Actions through a workflow that has access to the repo. The GraphQL API request is using a Railway token so I don't think that has anything to do with the "repo".
But perhaps the confusion is over what "repo" the error is referring to? Is it the github repo? some kind of docker repo? something else?
Also keep in mind this entire setup has worked as-is until sometime in the afternoon hours (EDT) on Aug 14th.
2 years ago
what env should i be looking at?
2 years ago
both of these services are deployed from a github repo
2 years ago
do you have access to that repo?
2 years ago
who's acccount token was used
So the GraphQL API request was done using my personal railway auth token
And seems like the railway integration also retains access so on that front I guess we're okay?

2 years ago
does it have access to that specfic repo?
I guess I can remove the integration, reinstall it and retry if you think that might help?
2 years ago
i'm not saying we deprecated anything, but that action does use unintended mutations, you would want to contact the author of that action and ask then to update it
I already forked it since he's unresponsive. I can make the necessary changes, what are the unintended mutations?
(also if thre's a more "official"/"stable" alternative for creating envs from github actions I'd definitely prefer to use that than rolling my own 😅 )
2 years ago
its not something railway supports at this time
2 years ago
but as for the correct mutations.
open your project, open the dev tools.
go through all the actions to create a pr env in the ui with all the needed variables and then just take all the network calls and code-ify them
Ok I can look into it. Do you believe that that's indeed the issue and not some other auth related issue though?
Also is this https://railway.app/graphiql interface is a recommended way to explore the API? I'm also getting auth errors there
2 years ago
if you can't do it via the dashboard then its an auth issue, if you can do it via the dashboard then its an issue with that action
Btw I notice I'm also getting the same error with another mutation:
{
"response": {
"errors": [
{
"message": "Cannot create trigger for repo user does not have access to",
"locations": [{ "line": 6, "column": 9 }],
"path": ["serviceInstanceRedeploy"],
"extensions": { "code": "INTERNAL_SERVER_ERROR" },
"traceId": "7925376593999893950"
}
],
"data": null,
"status": 200,
"headers": {}
},
"request": {
"query": "\n mutation serviceInstanceRedeploy(\n $environmentId: String!\n $serviceId: String!\n ) {\n serviceInstanceRedeploy(\n environmentId: $environmentId\n serviceId: $serviceId\n )\n }\n ",
"variables": {
"environmentId": "***",
"serviceId": "***"
}
}
}Well actually I'm not sure the dashboard is the same action. I think the dashboard is redeploying an existing deployment, while the action tries to deploy a new version from github
2 years ago
you would want to be using all the same mutations the dashboard uses
I understand. First of all I appreciate you taking the time and helping Brody.
Otherwise, please understand the frustration and friction that comes when things that work one day, just break the next and I have to rush a hotfix that I had not planned. I'm somewhat concerned now that the mutations that the dashboard uses now might break in the future, if they do I think API users would appreciate a heads up.
Please take this as a constructive feedback to the team, I really like the Railway product otherwise.
2 years ago
i do understand the frustration but please keep in mind that what you where using was created by a community member with the knowledge that the mutations where already outdated and me and another railway employee has suggested them to update it and they refused.
Yeah, I understand. I wish that person was more responsive, I had tried to contact them mayn times for improvements and ended up just forking it myself.
2 years ago
i feel you, i wish they where too
For my own understanding, is there a good place to stay up to date with deprecation/things getting outtdated?
2 years ago
im sorry but railway moves too fast to keep that kind of information posted
Hi Brody, I went through the actions in the dashboard, redeploying an existing environment works but creating a new environment gives me the same error I saw in the mutation above:
Failed to commit changes
Cannot create trigger for repo user does not have access toI tried uninstalling and re-installing the Railway app from Github and I think there's an issue since I cannot see my target repo when I tried to connect it
So I went through the actions in the dashboard, redeploying an existing environment works but creating a new environment gives me the same error I saw in the mutation above:
Failed to commit changes
Cannot create trigger for repo user does not have access toI ended up re-installing the Github App and that seems to have resolved the issue.
Is this something thats expected to be needed every so often?
2 years ago
that's very strange, haven't heard of needing to reinstall it for the sake of it, only when the user changes something and needs to re-auth
9 months ago
Following up on this – I had the same exact issue and installing and reinstalling the github app fixed the issue. I was getting the error through railway's dashboard as well, so it's clearly not just an issue with the action/API. What's the solution here where it won't happen again?
