knative / serving

Kubernetes-based, scale-to-zero, request-driven compute
https://knative.dev/docs/serving/
Apache License 2.0
5.48k stars 1.14k forks source link

RevisionMissing when running autoscale-go example project #14000

Closed dewijones92 closed 1 year ago

dewijones92 commented 1 year ago

Hello 😊

I am trying to follow this https://knative.dev/docs/serving/autoscaling/autoscale-go/#prerequisites

But I am having no luck. I am stuck with this. Please help 😊

 kn version
Version:      v20230521-local-f9af3a7b
Build Date:   2023-05-21 05:19:42
Git Revision: f9af3a7b
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.37.0)
* Eventing
  - sources.knative.dev/v1 (knative-eventing v0.37.0)
  - eventing.knative.dev/v1 (knative-eventing v0.37.0)

Expected Behavior

Service should deloy

Actual Behavior

kn service list
NAME           URL                                              LATEST   AGE   CONDITIONS   READY   REASON
autoscale-go   http://autoscale-go.default.127.0.0.1.sslip.io            9h    0 OK / 3     False   RevisionMissing : Configuration "autoscale-go" does not have any ready Revision.

Steps to Reproduce the Problem

kn quickstart kind
dewi@dewiserver:~/code/knative/docs/docs/serving/autoscaling/autoscale-go$ git checkout  "release-1.10"
M       code-samples/serving/hello-world/helloworld-go/service.yaml
Already on 'release-1.10'
Your branch is up to date with 'origin/release-1.10'.
dewi@dewiserver:~/code/knative/docs/docs/serving/autoscaling/autoscale-go$ kubectl apply -f  service.yaml
Warning: Kubernetes default value is insecure, Knative may default this to secure in a future release: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation, spec.template.spec.containers[0].securityContext.capabilities, spec.template.spec.containers[0].securityContext.runAsNonRoot, spec.template.spec.containers[0].securityContext.seccompProfile
service.serving.knative.dev/autoscale-go configured
dewi@dewiserver:~/code/knative/docs/docs/serving/autoscaling/autoscale-go$

commit 40cb94392cb72b448db2450ae24f5e7e956d3bcc (HEAD -> release-1.10, origin/release-1.10)
Author: Lance Ball <lball@redhat.com>
Date:   Mon May 22 15:42:08 2023 -0400

    Add TOC election information to website banner (#5574)

    Signed-off-by: Lance Ball <lball@redhat.com>

 dewi@dewiserver:~/code/knative/docs/docs/serving/autoscaling/autoscale-go$ cat service.yaml
# Copyright 2018 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: autoscale-go
  namespace: default
spec:
  template:
    metadata:
      annotations:
        # Target 10 in-flight-requests per pod.
        autoscaling.knative.dev/target: "10"
    spec:
      containers:
      - image: gcr.io/knative-samples/autoscale-go:0.1

kube details: https://gist.github.com/dewijones92/7525cd49775441c77b214ba1a6cacdc0

kube logs: https://gist.github.com/dewijones92/b9442115781dd48ae992e3c6124b109a

Many thanks 😊

ReToCode commented 1 year ago

Hi, can you check the logs of the controller in knative-serving and also post the yamls of the Knative resources for your service? See https://knative.dev/docs/install/troubleshooting/#check-the-status-of-the-knative-resources and https://knative.dev/docs/install/troubleshooting/#check-the-status-of-the-knative-resources.

dewijones92 commented 1 year ago

@ReToCode i have found the problem. Looks like the docker image does not exist in the registry?


Status:
  Conditions:
    Last Transition Time:        2023-05-25T06:30:23Z
    Message:                     Revision "autoscale-go-00001" failed with message: Unable to fetch image "gcr.io/knative-samples/autoscale-go:0.1": failed to resolve image to digest: HEAD https://gcr.io/v2/knative-samples/autoscale-go/manifests/0.1: unexpected status code 404 Not Found (HEAD responses have no body, use GET for details).
    Reason:                      RevisionFailed
    Status:                      False
    Type:                        ConfigurationsReady
    Last Transition Time:        2023-05-25T06:30:23Z

chat gpt4 answer:


Based on the provided information, it appears that there is an issue with fetching the image for the "autoscale-go" revision in Knative. The error message states that the image "gcr.io/knative-samples/autoscale-go:0.1" cannot be resolved to a digest. Additionally, it mentions that when attempting to access the image manifest at "https://gcr.io/v2/knative-samples/autoscale-go/manifests/0.1," a 404 Not Found error is encountered.

To fix this issue, you can try the following steps:

    Verify the image URL: Double-check that the image URL "gcr.io/knative-samples/autoscale-go:0.1" is correct. Make sure the image exists in the specified location.

    Check image availability: Ensure that the image repository allows access and that the image is publicly available or that you have the necessary credentials to access it.
ReToCode commented 1 year ago

You are right. That sample is outdated, as we migrated stuff to the github registry. You can use

docker pull ghcr.io/knative/autoscale-go:latest

I'm going to fix the sample.