Samkough
Samkough

Reputation: 105

invalid build: invalid image name "gcr.io/sam-api-267023/https://sam-api-267023.appspot.com/:a83bcce15e7329d9925cda40a17a9f588afe478f"

I have a project running on Google App Engine and to deploy it, I have a GCloud build connected to a GitHub webhook. Anytime I push to my master branch it deploys.

Recently though I've been experiencing this error and it's actually been happening most of the time that I've been using it. There's only a brief period that worked successfully which I'm not sure why. The commit that started the fail had nothing to do with any of the Google Cloud configs. The error says for every failed build:

invalid build: invalid image name "gcr.io/sam-api-267023/https://sam-api-267023.appspot.com/:a83bcce15e7329d9925cda40a17a9f588afe478f": could not parse reference: gcr.io/sam-api-267023/https://sam-api-267023.appspot.com/:a83bcce15e7329d9925cda40a17a9f588afe478f

I tried reformatting my .yaml file to match Google Cloud's recommendation and it's not working. I've seen that yaml is valid using online yaml validators.

Here is the source for my cloudbuild.yaml file:

steps:

- name: "gcr.io/cloud-builders/docker"
    args:
      [
        "build",
        "-t",
        "gcr.io/$PROJECT_ID/https://sam-api-267023.appspot.com/:$COMMIT_SHA",
        ".",
      ]
  - name: "gcr.io/cloud-builders/docker"
    args:
      [
        "push",
        "gcr.io/$PROJECT_ID/https://sam-api-267023.appspot.com/:$COMMIT_SHA",
      ]
  - name: "gcr.io/cloud-builders/gcloud"
    args:
      [
        "run",
        "deploy",
        "https://sam-api-267023.appspot.com/",
        "--image",
        "gcr.io/$PROJECT_ID/https://sam-api-267023.appspot.com/:$COMMIT_SHA",
        "--region",
        "us-east4",
        "--platform",
        "managed",
      ]
images: ["gcr.io/$PROJECT_ID/https://sam-api-267023.appspot.com/:$COMMIT_SHA"]

Upvotes: 0

Views: 1164

Answers (1)

user13068860
user13068860

Reputation:

There are some possibilities of causes for the error that you are facing. It can be, for example, the path used to locate your images or even if you provided the authentication needed, for the build to execute correctly on Google's side.

An example of the path, it's that for example, some cases, it's needed that the path is not gcr.io/$PROJECT_ID/https://sam-api-267023.appspot.com/:$COMMIT_SHA, but would be gcr.io/$PROJECT_ID/sam-api-267023.appspot.com/:$COMMIT_SHA, without the https://, since it's a path.

Considering that, I would recommend you to take a look at the below articles, where you can find more information and similar cases to yours, that might help you fix the error that you are facing.

Besides that, might be worth it to try without the https:// on your paths to build it - using the gcloud builds submit --tag <path> command.

Let me know if the information helped you!

Upvotes: 1

Related Questions