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

exception, when I use serverless deploy #14

Closed
huyyxy opened this issue Oct 19, 2022 · 5 comments
Closed

exception, when I use serverless deploy #14

huyyxy opened this issue Oct 19, 2022 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@huyyxy
Copy link

huyyxy commented Oct 19, 2022

when I try knative-docker, like this:

export SERVERLESS_PLATFORM_VENDOR=knative
export SLS_GEO_LOCATION=us serverless deploy

serverless create --template knative-docker --path myService
[root@VM-6-2-centos myService]# cat serverless.yml
service: myservice

frameworkVersion: '3'

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
[root@VM-6-2-centos myService]# sls deploy
Warning: You're relying on provider "knative" defined by a plugin which doesn't provide a validation schema for its config.
Please report the issue at its bug tracker linking: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema
You may turn off this message with "configValidationMode: off" setting

Building Docker image "******/myservice-hello:166616657****"...
✖ Uncaught exception
Environment: linux, node 16.15.0, framework 3.23.0, plugin 6.2.2, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
TypeError: Cannot read properties of undefined (reading 'slice')
    at ReadFileContext.<anonymous> (/root/knative/myService/node_modules/dockerode/lib/util.js:94:32)
    at ReadFileContext.callback (/usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:123:16)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:314:13)
[root@VM-6-2-centos myService]#
@medikoo
Copy link
Contributor

medikoo commented Oct 19, 2022

@huyyxy please report at serverless-knative plugin repository

@medikoo medikoo assigned medikoo and huyyxy and unassigned medikoo Oct 19, 2022
@medikoo medikoo added the question Further information is requested label Oct 19, 2022
@huyyxy
Copy link
Author

huyyxy commented Oct 19, 2022

OK, thinks

@medikoo medikoo closed this as completed Oct 19, 2022
@Trojanku
Copy link

Hi. Do we have any solution to that? I cannot find any details about this anywhere else.

@roskee
Copy link

roskee commented Nov 7, 2023

@Trojanku Hi, Did you find a solution for this?

@kennyhyun
Copy link

kennyhyun commented Jan 17, 2024

it's from dockerode/lib/util.js:94

fix dockerode version to 3.3.2 in your package.json

for npm

  "overrides": {
    "dockerode": "3.3.2"
  },

for pnpm

  "pnpm": {
    "overrides": {
      "dockerode": "3.3.2"
    }
  },

for yarn v1

  "resolutions": {
    "dockerode": "3.3.2"
  },

then it will allow you to build the docker image
but will lead you to the issue #10 lol


got this working using my fork

  "pnpm": {
    "overrides": {
      "serverless-knative": "git://github.com/kennyhyun/serverless-knative#kennyhyun-patch-custom-image",
      "@serverless/knative-serving": "git://github.com/kennyhyun/knative-serving#kennyhyun-patch-image-pull-secrets",
      "dockerode": "3.3.2"
    }
  }

pls have a look kennyhyun#1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants