func icon indicating copy to clipboard operation
func copied to clipboard

Error: deploy error. knative deployer failed to wait for the Knative Service to become ready: timeout: service 'resource-cost-calculator' not ready after 120 seconds

Open matzew opened this issue 1 year ago • 2 comments

Problem with S2i build on latest binary with Openshift

I used this function: https://github.com/keventmesh/llm-tool-provider/blob/main/tools/resource-cost-calculator/func.yaml

and yes, I have removed quay.io lines and the builder, so it looks like:

specVersion: 0.36.0
name: resource-cost-calculator
runtime: go
namespace: default
created: 2024-06-25T14:54:34.256280245-04:00
invoke: cloudevent
deploy:
  namespace: default
  subscriptions:
  - source: chat-broker
    filters:
      type: resource.cost.calculator

Now I am running func deploy as below:

func deploy -b=s2i -v
Building function image
STEP 1/9: FROM registry.access.redhat.com/ubi8/go-toolset
...
...
Successfully tagged <my container registry address>/resource-cost-calculator:latest
Writing built image: '<my container registry address>/resource-cost-calculator:latest' at path: '/home/path/to/the/function/.func/built-image'
🙌 Function built: <my container registry address>/resource-cost-calculator:latest
Pushing function image to the registry "index.docker.io" using the "matzew" user credentials
The push refers to repository [docker.io/matzew/resource-cost-calculator:latest]
latest: digest: sha256:65d0eefa933291eb8327fd882b63fc2b089667932ec9690a0f8fe7d082d493db size: 1541
⬆️  Deploying


Waiting for Knative Service to become ready
{"level":"debug","time":1719915291,"message":"func runtime creating function instance"}
{"level":"warn","time":1719915291,"message":"Environment variable ADDRESS is deprecated and support will be removed in future versions.  Try rebuilding your Function with the latest version of func to use LISTEN_ADDRESS instead."}
{"level":"warn","time":1719915291,"message":"Environment variable PORT is deprecated and support will be removed in future version.s  Try rebuilding your Function with the latest version of func to use LISTEN_ADDRESS instead."}
{"level":"debug","address":"0.0.0.0:8080","time":1719915291,"message":"function starting"}
{"level":"debug","time":1719915291,"message":"function does not implement Start. Skipping"}
{"level":"debug","time":1719915291,"message":"waiting for stop signals or errors"}
{"level":"debug","signal":15,"time":1719915383,"message":"signal received"}
{"level":"debug","time":1719915383,"message":"function stopping"}
Error: deploy error. knative deployer failed to wait for the Knative Service to become ready: timeout: service 'resource-cost-calculator' not ready after 120 seconds

the function gets ready... and eventually it tearsdown as there is no traffic, so scale to zero kicks in.

However my other bits, like the subscriptions are not created and the deployer fails with this error:

Error: deploy error. knative deployer failed to wait for the Knative Service to become ready: timeout: service 'resource-cost-calculator' not ready after 120 seconds

matzew avatar Jul 02 '24 10:07 matzew

Can you invoke the function while func is still "waiting for it to become ready" via curl?

I ask because, it's possible there is a problem with the "wait for ready", which is timing out before moving on to creating the subscriptions.

lkingland avatar Jul 02 '24 12:07 lkingland

@lkingland currently blocked on -> https://github.com/knative/func/issues/2431

matzew avatar Jul 24 '24 07:07 matzew

I was able to recreate this using the default installation of the KnativeServing CR. It fails due to needing either Kourier or Istio network enabled. Enabling one of these resulted in a successful deploy.

Closing this issue. Please re-open if necessary!

lkingland avatar Sep 03 '24 10:09 lkingland

Similar issue for me. I have followed the quickstart tutorial on my MacBook. I'm not sure what the issue is. I've also installed Kourier but I get this output: (I changed my private domain to "example.org" but it should be correctly set)

sudo kn func deploy --registry docker-registry.example.org --build
Password:
Building function image
Still building
Still building
🙌 Function built: docker-registry.example.org/hello:latest
Pushing function image to the registry "docker-registry.example.org" using the "bruno" user credentials

Service output:

Error: deploy error. timeout: service 'hello' not ready after 120 seconds
Error: exit status 1

Kourier should be correctly installed (I hope?). I followed this guide: https://knative.dev/docs/install/yaml-install/serving/install-serving-with-yaml/#install-a-networking-layer

This is the output I get when testing the installation:

kubectl get pods -n knative-serving
NAME                                      READY   STATUS      RESTARTS   AGE
activator-794bf4b5f-6g7db                 1/1     Running     0          3d22h
autoscaler-678cd4b756-wk9bw               1/1     Running     0          3d22h
controller-749fb7bc8b-mfrw4               1/1     Running     0          3d22h
default-domain-qm8g9                      0/1     Completed   0          3d22h
net-kourier-controller-6c6b48b764-g9rw2   1/1     Running     0          3d22h
webhook-7c7d966789-qsxls                  1/1     Running     0          3d22h

I host my own docker registry using the registry docker image. This is the docker-compose.yml:

services:
  registry:
    image: registry:latest
    container_name: registry
    environment:
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
    volumes:
      # Mount the password file
      - ./registry/registry.password:/auth/registry.password
      # Mount the data directory
      - ./registry/data:/data
    ports:
      - 5000:5000
    networks:
      - docker_main
networks:
  docker_main:
    external: true

I set up Nginx to host the registry on https://docker-registry.example.org. The data folder of my docker registry grows in size each time I deploy a function. So my guess is that the image is successfully uploaded but something else fails?

brunomueller93 avatar Dec 13 '24 13:12 brunomueller93