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

http error, when i use serverless deploy #10

Open
zhaogaiwen opened this issue Jul 8, 2020 · 18 comments
Open

http error, when i use serverless deploy #10

zhaogaiwen opened this issue Jul 8, 2020 · 18 comments
Labels
help wanted Extra attention is needed

Comments

@zhaogaiwen
Copy link

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)

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

thecodacus commented Aug 5, 2020

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

@tarzzz
Copy link

tarzzz commented May 28, 2021

Still facing the issue. Any pointers..?

@mjacobsson
Copy link

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

@stellamargonar
Copy link

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..

@batjko
Copy link

batjko commented Jul 26, 2021

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.

@Richardmbs12
Copy link

Richardmbs12 commented Aug 18, 2021

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

@insuusvenerati
Copy link

Are you all testing this with a local kubernetes setup?

@batjko
Copy link

batjko commented Sep 16, 2021

Are you all testing this with a local kubernetes setup?

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

@cloudops-mboudreau
Copy link

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

@Richardmbs12
Copy link

Same, also using EKS

@ksingh7
Copy link

ksingh7 commented Oct 22, 2021

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

@medikoo
Copy link
Contributor

medikoo commented Oct 25, 2021

@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

@ksingh7
Copy link

ksingh7 commented Oct 29, 2021

Thanks, @medikoo for clarifying the situation on this.

@inventionlabsSydney
Copy link

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

@xiaolong2013
Copy link

xiaolong2013 commented Feb 25, 2022

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
Copy link

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
Copy link

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
Copy link

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

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