Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Serverless Function Return Null in Knative #11

Open
himadriganguly opened this issue Jul 9, 2020 · 2 comments
Open

Serverless Function Return Null in Knative #11

himadriganguly opened this issue Jul 9, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@himadriganguly
Copy link

⚠️⚠️ Deployed the sample serverless function from https://www.serverless.com/framework/docs/providers/knative/guide/quick-start/ in Knative on the local machine in minikube. It deployed without any issue but when invoke with serverless invoke -f hello return NULL.

serverless.yml
service: app

provider:
  name: knative
  # optional Docker Hub credentials you need if you're using local Dockerfiles as function handlers
  docker:
    username: ${env:DOCKER_HUB_USERNAME}
    password: ${env:DOCKER_HUB_PASSWORD}

functions:
  hello:
    handler: hello-world.dockerfile
    context: ./code
    # either use a container image URL for your function `handler` as the commented out `handler`
    # below shows or make sure that you update the application code and corresponding Dockerfile
    # to process incoming CloudEvents event data when using the event sources listed below
    # handler: gcr.io/knative-releases/github.com/knative/eventing-contrib/cmd/event_display:latest
    # events:
    #   - custom:
    #       filter:
    #         attributes:
    #           type: greeting
    #   - kafka:
    #       consumerGroup: KAFKA_CONSUMER_GROUP_NAME
    #       bootstrapServers:
    #         - server1
    #         - server2
    #       topics:
    #         - my-topic
    #   - awsSqs:
    #       secretName: aws-credentials
    #       secretKey: credentials
    #       queue: QUEUE_URL
    #   - gcpPubSub:
    #       project: knative-hackathon
    #       topic: foo
    #   - cron:
    #       schedule: '* * * * *'
    #       data: '{"message": "Hello world from a Cron event source!"}'

plugins:
  - serverless-knative
FULL COMMAND NAME output
serverless info

Service Information
service: app
namespace: sls-app-dev
ingress ip: 172.17.0.5

Deployed functions
hello:
  - url: app-hello.sls-app-dev.example.com

serverless invoke -f hello

Return NULL

Installed version

Framework Core: 1.74.1
Plugin: 3.6.15
SDK: 2.3.1
Components: 2.31.12

But the sample application in Knative documentation at https://knative.dev/docs/serving/samples/hello-world/helloworld-python/index.html works exactly fine.

@medikoo medikoo added the help wanted Extra attention is needed label Jul 9, 2020
@zhaogaiwen
Copy link

can you show ksvc?

@himadriganguly
Copy link
Author

Output of kubectl get ksvc -n sls-app-dev

NAME               URL                                                      LATESTCREATED            LATESTREADY   READY   REASON
app-hello   http://app-hello.sls-app-dev.example.com       app-hello-7mdzv                                             False       RevisionMissing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants