#Error on environmentCreate GraphQL Mutation

42 messages · Page 1 of 1 (latest)

civic flint
#

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!

GitHub

Contribute to Faolain/railway-pr-deploy development by creating an account on GitHub.

edgy cedarBOT
#

Project ID: b880d42a-b80e-4f1e-b8f1-75cdd868eef0

civic flint
#

b880d42a-b80e-4f1e-b8f1-75cdd868eef0

civic flint
#

Hi team, is there any preferred method to ask these kind of questions?

sly mica
#
Cannot create trigger for repo user does not have access to

are you sure you have access to the source repo of the service?

civic flint
#

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.

sly mica
#

what env should i be looking at?

civic flint
#

One sec let me find the right one

civic flint
sly mica
#

both of these services are deployed from a github repo

#

do you have access to that repo?

civic flint
#

Yes I'm the owner of that repo

sly mica
#

who's acccount token was used

civic flint
#

I also see railway connected on the github menu

civic flint
#

And seems like the railway integration also retains access so on that front I guess we're okay?

sly mica
#

does it have access to that specfic repo?

civic flint
#

Yes

#

Double checked

#

I guess I can remove the integration, reinstall it and retry if you think that might help?

sly mica
#

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

civic flint
#

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 😅 )

sly mica
#

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

civic flint
#

Also is this https://railway.app/graphiql interface is a recommended way to explore the API? I'm also getting auth errors there

sly mica
civic flint
#

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": "***"
    }
  }
}

#

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

sly mica
#

you would want to be using all the same mutations the dashboard uses

civic flint
# sly mica 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.

sly mica
#

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.

civic flint
#

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.

sly mica
#

i feel you, i wish they where too

civic flint
#

For my own understanding, is there a good place to stay up to date with deprecation/things getting outtdated?

sly mica
#

im sorry but railway moves too fast to keep that kind of information posted

civic flint
#

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

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?

sly mica
#

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