R
Railway•4mo ago
bbgun

Error on environmentCreate GraphQL Mutation

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": "***"
}
}
}
}
{
"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!
GitHub
GitHub - Faolain/railway-pr-deploy
Contribute to Faolain/railway-pr-deploy development by creating an account on GitHub.
29 Replies
Percy
Percy•4mo ago
Project ID: b880d42a-b80e-4f1e-b8f1-75cdd868eef0
bbgun
bbgunOP•4mo ago
b880d42a-b80e-4f1e-b8f1-75cdd868eef0 Hi team, is there any preferred method to ask these kind of questions?
Brody
Brody•4mo ago
Cannot create trigger for repo user does not have access to
Cannot create trigger for repo user does not have access to
are you sure you have access to the source repo of the service?
bbgun
bbgunOP•4mo ago
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.
Brody
Brody•4mo ago
what env should i be looking at?
bbgun
bbgunOP•4mo ago
One sec let me find the right one The last error I had was for pr-331
Brody
Brody•4mo ago
both of these services are deployed from a github repo do you have access to that repo?
bbgun
bbgunOP•4mo ago
Yes I'm the owner of that repo
Brody
Brody•4mo ago
who's acccount token was used
bbgun
bbgunOP•4mo ago
I also see railway connected on the github menu
No description
bbgun
bbgunOP•4mo ago
So the GraphQL API request was done using my personal railway auth token
bbgun
bbgunOP•4mo ago
And seems like the railway integration also retains access so on that front I guess we're okay?
No description
Brody
Brody•4mo ago
does it have access to that specfic repo?
bbgun
bbgunOP•4mo ago
Yes Double checked I guess I can remove the integration, reinstall it and retry if you think that might help?
Brody
Brody•4mo 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
bbgun
bbgunOP•4mo ago
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 😅 )
Brody
Brody•4mo ago
its not something railway supports at this time 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
bbgun
bbgunOP•4mo ago
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
Brody
Brody•4mo 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
bbgun
bbgunOP•4mo ago
yeah the ui dashboard does work 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": "***"
}
}
}
{
"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
Brody
Brody•4mo ago
you would want to be using all the same mutations the dashboard uses
bbgun
bbgunOP•4mo ago
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.
Brody
Brody•4mo 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.
bbgun
bbgunOP•4mo ago
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.
Brody
Brody•4mo ago
i feel you, i wish they where too
bbgun
bbgunOP•4mo ago
For my own understanding, is there a good place to stay up to date with deprecation/things getting outtdated?
Brody
Brody•4mo ago
im sorry but railway moves too fast to keep that kind of information posted
bbgun
bbgunOP•4mo ago
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 to
Failed to commit changes
Cannot create trigger for repo user does not have access to
I 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?
Brody
Brody•4mo 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
Want results from more Discord servers?
Add your server