Internal API - Invalid Service Name when creating project
caret-jake
PROOP

2 years ago

Hey Folks,

I'm trying to use the API to create a new project. I'm getting an error about an Invalid Service Name. I think this might be because my repo URL is pretty long? The projects do get created, but the graphql response comes back with an error and I'm not able to pull the new project id out of it.

Is there any way to work around this? Or to pass in the service name as a variable? Or let me know if my mutation is just formatted wrong

The mutation looks like this:

        mutation {
          projectCreate(
            input: {
              isPublic: false,
              name: "apple-garlic",
              repo: {
                branch: "main",
                fullRepoName: "caret-jake/artifact_64dab1ad-0e50-4ca3-a3d9-372286eca940"
              },
            }
          ) {
            id
          }
        }

I get this error response

{
  errors: [
    {
      message: "Invalid service name",
      locations: [
        [Object ...]
      ],
      path: [ "projectCreate" ],
      extensions: [Object ...],
      traceId: "4053368649584985068",
    }
  ],
  data: null,
}

7 Replies

caret-jake
PROOP

2 years ago

More detailed logs indicates an internal server error.

Errors encountered:
Error 1:
Message: Invalid service name
Locations: [
  {
    line: 3,
    column: 11,
  }
]
Path: [ "projectCreate" ]
Extensions: {
  code: "INTERNAL_SERVER_ERROR",
}
Trace ID: 1241376029114976398
{
  errors: [
    {
      message: "Invalid service name",
      locations: [
        [Object ...]
      ],
      path: [ "projectCreate" ],
      extensions: [Object ...],
      traceId: "1241376029114976398",
    }
  ],

2 years ago

the service names are derived from the repo name and service names have a limit of 32 characters


caret-jake
PROOP

2 years ago

Does there happen to be any way to pass in a service name instead of having it be derived?


2 years ago

just checked the schema, there isnt unfortunately


caret-jake
PROOP

2 years ago

Dang okay! Well I'm a big fan of Railway so I'll change other parts of my app to accomodate that!


caret-jake
PROOP

2 years ago

Thanks for the quick response here! Very appreciated!


2 years ago

no problem!


Loading...