serverless-knative icon indicating copy to clipboard operation
serverless-knative copied to clipboard

http error, when i use serverless deploy

Open zhaogaiwen opened this issue 4 years ago • 18 comments

this is my serverless.yml

service: my-knative-java provider: name: knative docker: username: zhaogaiwen password: zhao19901013

functions: hello: handler: hello-world.dockerfile context: ./code plugins:

serverless-knative this is the exception:

Serverless: Deploying Kubernetes namespace "sls-aws-java-maven-dev"... Serverless: Deploying Knative service for function "aws-java-maven-hello"...

Http Error ---------------------------------------------

HttpError: HTTP request failed at Request.localVarRequest [as _callback] (/home/ec2-user/zgw/aws-java-maven/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:254:40) at Request.self.callback (/home/ec2-user/zgw/aws-java-maven/node_modules/request/request.js:185:22) at Request.emit (events.js:198:13) at Request.EventEmitter.emit (domain.js:448:20) at Request. (/home/ec2-user/zgw/aws-java-maven/node_modules/request/request.js:1154:10) at Request.emit (events.js:198:13) at Request.EventEmitter.emit (domain.js:448:20) at IncomingMessage. (/home/ec2-user/zgw/aws-java-maven/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:286:20) at IncomingMessage.emit (events.js:203:15) at IncomingMessage.EventEmitter.emit (domain.js:448:20) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19)

zhaogaiwen avatar Jul 08 '20 01:07 zhaogaiwen

I'm also facing the same issue. running on GKE along with ambassador

thecodacus avatar Aug 05 '20 10:08 thecodacus

Still facing the issue. Any pointers..?

tarzzz avatar May 28 '21 11:05 tarzzz

Same here :( How can I debug/resolve this?

mjacobsson avatar Jun 03 '21 17:06 mjacobsson

Hi, i'm having the same issue.

I installed knative-serving and eventing, using Kourier as networking layer, local kubernetes (v 1.21.2) following the quick start tutorial.

On the function deploy i get

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image "undefined/exportless-knative-hello:1626094940829"...
Serverless: Pushing "undefined/exportless-knative-hello:1626094940829" to Container Registry...
Serverless: Deploying Kubernetes namespace "sls-exportless-knative-dev"...
Serverless: Deploying Knative service for function "exportless-knative-hello"...

 Http Error ----------------------------------------------

  HttpError: HTTP request failed
      at Request._callback (/path/to/exportless-knative/node_modules/@serverless/knative-serving/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:1626:40)
      at Request.self.callback (/path/to/exportless-knative/node_modules/request/request.js:185:22)
      at Request.emit (events.js:315:20)
      at Request.EventEmitter.emit (domain.js:482:12)
      at Request.<anonymous> (/path/to/exportless-knative/node_modules/request/request.js:1154:10)
      at Request.emit (events.js:315:20)
      at Request.EventEmitter.emit (domain.js:482:12)
      at IncomingMessage.<anonymous> (/path/to/exportless-knative/node_modules/request/request.js:1076:12)
      at Object.onceWrapper (events.js:421:28)
      at IncomingMessage.emit (events.js:327:22)
      at IncomingMessage.EventEmitter.emit (domain.js:482:12)
      at endReadableNT (_stream_readable.js:1221:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)

i tried adding a console log right before the error and i can see that the request failing is a PATCH returning 404 - page not found (here the details)

{
  method: 'PATCH',
  qs: {},
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/merge-patch+json'
  },
  uri: 'https://kubernetes.docker.internal:6443/apis/serving.knative.dev/v1alpha1/namespaces/sls-exportless-knative-dev/services/exportless-knative-hello',
  useQuerystring: false,
  json: true,
  body: {
    apiVersion: 'serving.knative.dev/v1alpha1',
    kind: 'Service',
    metadata: {
      name: 'exportless-knative-hello',
      namespace: 'sls-exportless-knative-dev'
    },
    spec: { template: [Object] }
  },
  ca: ....
}

Do you have any suggestion on what could be the problem? i also tried previously with Istio and the result is the same..

stellamargonar avatar Jul 12 '21 13:07 stellamargonar

Same here, on a fresh Docker-Desktop installation.

I also get an unrecognized provider warning, not sure that's related at all?

$ sls deploy

Serverless: Configuration warning: Unrecognized provider 'knative'
Serverless:  
Serverless: You're relying on provider plugin which doesn't provide a validation schema for its config.
Serverless: Please report the issue at its bug tracker linking: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema
Serverless: You may turn off this message with "configValidationMode: off" setting
Serverless:  
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image "batjko/knative-svc1-hello:1627334320821"...
Serverless: Pushing "batjko/knative-svc1-hello:1627334320821" to Container Registry...
Serverless: Deploying Kubernetes namespace "sls-knative-svc1-dev"...
Serverless: Deploying Knative service for function "knative-svc1-hello"...
 
 Http Error ----------------------------------------------
 
  HttpError: HTTP request failed
      at Request._callback (/mnt/d/dev/knative-svc1/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:1626:40)
      at Request.self.callback (/mnt/d/dev/knative-svc1/node_modules/request/request.js:185:22)
[...]

Serverless docs for Knative don't mention anything about setting up any networking etc, so not sure what's needed here.

batjko avatar Jul 26 '21 21:07 batjko

Same on my side.

Can we please traction on this. We truly wanted to use serverless knative for various projects and teams at my company. This issue is blocking it completely.

➜ my-service git:(master) ✗ serverless deploy Serverless: Load command interactiveCli Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command config:tabcompletion Serverless: Load command config:tabcompletion:install Serverless: Load command config:tabcompletion:uninstall Serverless: Load command create Serverless: Load command install Serverless: Load command package Serverless: Load command deploy Serverless: Load command deploy:function Serverless: Load command deploy:list Serverless: Load command deploy:list:functions Serverless: Load command invoke Serverless: Load command invoke:local Serverless: Load command info Serverless: Load command logs Serverless: Load command metrics Serverless: Load command print Serverless: Load command remove Serverless: Load command rollback Serverless: Load command rollback:function Serverless: Load command slstats Serverless: Load command plugin Serverless: Load command plugin Serverless: Load command plugin:install Serverless: Load command plugin Serverless: Load command plugin:uninstall Serverless: Load command plugin Serverless: Load command plugin:list Serverless: Load command plugin Serverless: Load command plugin:search Serverless: Load command config Serverless: Load command config:credentials Serverless: Load command upgrade Serverless: Load command uninstall Serverless: Load command login Serverless: Load command logout Serverless: Load command generate-event Serverless: Load command test Serverless: Load command dashboard Serverless: Load command output Serverless: Load command output:get Serverless: Load command output:list Serverless: Load command param Serverless: Load command param:get Serverless: Load command param:list Serverless: Load command studio Serverless: Skipping variables resolution with old resolver (new resolver reported no more variables to resolve) Serverless: Configuration warning: Unrecognized provider 'knative' Serverless: Serverless: You're relying on provider plugin which doesn't provide a validation schema for its config. Serverless: Please report the issue at its bug tracker linking: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema Serverless: You may turn off this message with "configValidationMode: off" setting Serverless: Serverless: Invoke deploy Serverless: Invoke package Serverless: Packaging service... Serverless: Excluding development dependencies... Serverless: Deploying Kubernetes namespace "sls-my-service-dev"... Serverless: Deploying Knative service for function "my-service-hello"...

Http Error ----------------------------------------------

HttpError: HTTP request failed at Request._callback (/mnt/c/Users/Richard/Documents/SBSA-Repositories/knative-samples/my-service/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:1626:40) at Request.self.callback (/mnt/c/Users/Richard/Documents/SBSA-Repositories/knative-samples/my-service/node_modules/request/request.js:185:22) at Request.emit (events.js:315:20) at Request.EventEmitter.emit (domain.js:485:12) at Request. (/mnt/c/Users/Richard/Documents/SBSA-Repositories/knative-samples/my-service/node_modules/request/request.js:1154:10) at Request.emit (events.js:315:20) at Request.EventEmitter.emit (domain.js:485:12) at IncomingMessage. (/mnt/c/Users/Richard/Documents/SBSA-Repositories/knative-samples/my-service/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at IncomingMessage.EventEmitter.emit (domain.js:485:12) at endReadableNT (_stream_readable.js:1224:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com

Your Environment Information --------------------------- Operating System: linux Node Version: 14.4.0 Framework Version: 2.54.0 (standalone) Plugin Version: 5.4.3 SDK Version: 4.2.6 Components Version: 3.15.0

Richardmbs12 avatar Aug 18 '21 07:08 Richardmbs12

Are you all testing this with a local kubernetes setup?

insuusvenerati avatar Sep 13 '21 15:09 insuusvenerati

Are you all testing this with a local kubernetes setup?

Indeed. In my case the Kubernetes cluster Docker Desktop gives you.

batjko avatar Sep 16 '21 21:09 batjko

Same for me ... I'm working with a cluster in EKS ...

cloudops-mboudreau avatar Sep 27 '21 23:09 cloudops-mboudreau

Same, also using EKS

Richardmbs12 avatar Sep 28 '21 20:09 Richardmbs12

Hi @medikoo would you be kind enough to help with this year long issue. I hope you might have some expert suggestion for the community here for a greater good.

Serverless: Skipping variables resolution with old resolver (new resolver reported no more variables to resolve)
Serverless: Configuration warning: Unrecognized provider 'knative'
Serverless:
Serverless: You're relying on provider plugin which doesn't provide a validation schema for its config.
Serverless: Please report the issue at its bug tracker linking: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema
Serverless: You may turn off this message with "configValidationMode: off" setting
Serverless:
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image "karansingh/hello-world-python-service-hello:1634929846195"...
Serverless: Pushing "karansingh/hello-world-python-service-hello:1634929846195" to Container Registry...
Serverless: Deploying Kubernetes namespace "sls-hello-world-python-service-dev"...
Serverless: Deploying Knative service for function "hello-world-python-service-hello"...

 Http Error ----------------------------------------------

  HttpError: HTTP request failed
      at Request._callback (/Users/karasing/git/knative-serverless/serverless-framework/hello-world-python-service/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:1626:40)
      at Request.self.callback (/Users/karasing/git/knative-serverless/serverless-framework/hello-world-python-service/node_modules/request/request.js:185:22)
      at Request.emit (events.js:315:20)
      at Request.EventEmitter.emit (domain.js:485:12)
      at Request.<anonymous> (/Users/karasing/git/knative-serverless/serverless-framework/hello-world-python-service/node_modules/request/request.js:1154:10)
      at Request.emit (events.js:315:20)
      at Request.EventEmitter.emit (domain.js:485:12)
      at IncomingMessage.<anonymous> (/Users/karasing/git/knative-serverless/serverless-framework/hello-world-python-service/node_modules/request/request.js:1076:12)
      at Object.onceWrapper (events.js:421:28)
      at IncomingMessage.emit (events.js:327:22)
      at IncomingMessage.EventEmitter.emit (domain.js:485:12)
      at endReadableNT (_stream_readable.js:1224:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              14.4.0
     Framework Version:         2.64.1 (standalone)
     Plugin Version:            5.5.0
     SDK Version:               4.3.0
     Components Version:        3.17.1

ksingh7 avatar Oct 22 '21 19:10 ksingh7

@ksingh7 thanks for pinging, still unfortunately at this point we (Serverless Inc.) do not have the resources to handle this plugin.

We will be happy to provide maintenance rights to anyone familiar with knative, who will be willing to push this project forward

medikoo avatar Oct 25 '21 11:10 medikoo

Thanks, @medikoo for clarifying the situation on this.

ksingh7 avatar Oct 29 '21 20:10 ksingh7

@zhaogaiwen you may want to remove your docker-hub credentials from this post....

inventionlabsSydney avatar Nov 08 '21 12:11 inventionlabsSydney

I have fixed the problem

env: node : 16.4.0 npm: 7.19.0 docker: Docker version 20.10.12, build e91ed57. docker-desktop Kubernetes: v1.22.5 istio: 1.13.0 knative: 1.2.0

image

three modify 1. serverless.yml add configValidationMode: off 2. my-service/node_modules/@serverless/knative-serving/serverless.js update from knativeVersion: 'v1alpha1' to knativeVersion: 'v1', 3. my-service/node_modules/@serverless/knative-serving/serverless.js update // "private" methods async getIstioIngressIp(k8s) { const res = await k8s.readNamespacedService('istio-ingressgateway', 'istio-system') //return res.body.status.loadBalancer.ingress[0].ip return res.body.status.loadBalancer.ingress[0].hostname }

xiaolong2013 avatar Feb 25 '22 11:02 xiaolong2013

Hi, i'm having the same issue.

I installed knative-serving and eventing, using Kourier as networking layer, local kubernetes (v 1.21.2) following the quick start tutorial.

On the function deploy i get

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image "undefined/exportless-knative-hello:1626094940829"...
Serverless: Pushing "undefined/exportless-knative-hello:1626094940829" to Container Registry...
Serverless: Deploying Kubernetes namespace "sls-exportless-knative-dev"...
Serverless: Deploying Knative service for function "exportless-knative-hello"...

 Http Error ----------------------------------------------

  HttpError: HTTP request failed
      at Request._callback (/path/to/exportless-knative/node_modules/@serverless/knative-serving/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:1626:40)
      at Request.self.callback (/path/to/exportless-knative/node_modules/request/request.js:185:22)
      at Request.emit (events.js:315:20)
      at Request.EventEmitter.emit (domain.js:482:12)
      at Request.<anonymous> (/path/to/exportless-knative/node_modules/request/request.js:1154:10)
      at Request.emit (events.js:315:20)
      at Request.EventEmitter.emit (domain.js:482:12)
      at IncomingMessage.<anonymous> (/path/to/exportless-knative/node_modules/request/request.js:1076:12)
      at Object.onceWrapper (events.js:421:28)
      at IncomingMessage.emit (events.js:327:22)
      at IncomingMessage.EventEmitter.emit (domain.js:482:12)
      at endReadableNT (_stream_readable.js:1221:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)

i tried adding a console log right before the error and i can see that the request failing is a PATCH returning 404 - page not found (here the details)

{
  method: 'PATCH',
  qs: {},
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/merge-patch+json'
  },
  uri: 'https://kubernetes.docker.internal:6443/apis/serving.knative.dev/v1alpha1/namespaces/sls-exportless-knative-dev/services/exportless-knative-hello',
  useQuerystring: false,
  json: true,
  body: {
    apiVersion: 'serving.knative.dev/v1alpha1',
    kind: 'Service',
    metadata: {
      name: 'exportless-knative-hello',
      namespace: 'sls-exportless-knative-dev'
    },
    spec: { template: [Object] }
  },
  ca: ....
}

Do you have any suggestion on what could be the problem? i also tried previously with Istio and the result is the same..

Refer to my comment

xiaolong2013 avatar Feb 25 '22 11:02 xiaolong2013

Same here, on a fresh Docker-Desktop installation.

I also get an unrecognized provider warning, not sure that's related at all?

$ sls deploy

Serverless: Configuration warning: Unrecognized provider 'knative'
Serverless:  
Serverless: You're relying on provider plugin which doesn't provide a validation schema for its config.
Serverless: Please report the issue at its bug tracker linking: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema
Serverless: You may turn off this message with "configValidationMode: off" setting
Serverless:  
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image "batjko/knative-svc1-hello:1627334320821"...
Serverless: Pushing "batjko/knative-svc1-hello:1627334320821" to Container Registry...
Serverless: Deploying Kubernetes namespace "sls-knative-svc1-dev"...
Serverless: Deploying Knative service for function "knative-svc1-hello"...
 
 Http Error ----------------------------------------------
 
  HttpError: HTTP request failed
      at Request._callback (/mnt/d/dev/knative-svc1/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:1626:40)
      at Request.self.callback (/mnt/d/dev/knative-svc1/node_modules/request/request.js:185:22)
[...]

Serverless docs for Knative don't mention anything about setting up any networking etc, so not sure what's needed here. before fix i have problem as same as you

xiaolong2013 avatar Feb 25 '22 11:02 xiaolong2013

this is my serverless.yml

service: my-knative-java provider: name: knative docker: username: zhaogaiwen password: zhao19901013

functions: hello: handler: hello-world.dockerfile context: ./code plugins:

serverless-knative this is the exception:

Serverless: Deploying Kubernetes namespace "sls-aws-java-maven-dev"... Serverless: Deploying Knative service for function "aws-java-maven-hello"...

Http Error ---------------------------------------------

HttpError: HTTP request failed at Request.localVarRequest [as _callback] (/home/ec2-user/zgw/aws-java-maven/node_modules/@kubernetes/client-node/dist/gen/api/customObjectsApi.js:254:40) at Request.self.callback (/home/ec2-user/zgw/aws-java-maven/node_modules/request/request.js:185:22) at Request.emit (events.js:198:13) at Request.EventEmitter.emit (domain.js:448:20) at Request. (/home/ec2-user/zgw/aws-java-maven/node_modules/request/request.js:1154:10) at Request.emit (events.js:198:13) at Request.EventEmitter.emit (domain.js:448:20) at IncomingMessage. (/home/ec2-user/zgw/aws-java-maven/node_modules/request/request.js:1076:12) at Object.onceWrapper (events.js:286:20) at IncomingMessage.emit (events.js:203:15) at IncomingMessage.EventEmitter.emit (domain.js:448:20) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19)

Refer to me

xiaolong2013 avatar Feb 25 '22 11:02 xiaolong2013