OpenFunction / OpenFunction

Cloud Native Function-as-a-Service Platform (CNCF Sandbox Project)
https://openfunction.dev
Apache License 2.0
1.51k stars 162 forks source link

Node.js samples can not work #335

Open xiaocode opened 2 years ago

xiaocode commented 2 years ago

I followed the guide(https://github.com/OpenFunction/samples/tree/main/functions/knative/hello-world-node/commonjs), But after building successfully, the SERVINGSTATE is always "Starting", and the URL is empty.

Also I trid the golang sample, the BUILDSTATE failed with log shows: Failure: (ID: 32633c29) go: github.com/OpenFunction/functions-framework-go@v0.3.0: Get "https://proxy.golang.org/github.com/%!!(MISSING)o(MISSING)pen%!!(MISSING)f(MISSING)unction/functions-framework-go/@v/v0.3.0.mod": dial tcp 172.217.163.49:443: i/o timeout function package: {"name":"hello","imports":{"fmt":{},"github.com/OpenFunction/functions-framework-go/functions":{},"net/http":{}}}ERROR: failed to build: exit status 1

webup commented 2 years ago

Could you please check ksvc status? "SERVINGSTATE is always "Starting", and the URL is empty" usually caused by knative service not running, let's have a check.

benjaminhuo commented 2 years ago

Also I trid the golang sample, the BUILDSTATE failed with log shows: Failure: (ID: 32633c29) go: github.com/OpenFunction/functions-framework-go@v0.3.0: Get "https://proxy.golang.org/github.com/%!!(MISSING)o(MISSING)pen%!!(MISSING)f(MISSING)unction/functions-framework-go/@v/v0.3.0.mod": dial tcp 172.217.163.49:443: i/o timeout function package: {"name":"hello","imports":{"fmt":{},"github.com/OpenFunction/functions-framework-go/functions":{},"net/http":{}}}ERROR: failed to build: exit status 1

You'll need to turn on the go proxy by setting the FUNC_GOPROXY env for go functions

apiVersion: core.openfunction.io/v1beta1
kind: Function
metadata:
  name: logs-async-handler
spec:
  version: "v2.0.0"
  image: openfunctiondev/logs-async-handler:v1
  imageCredentials:
    name: push-secret
  build:
    builder: openfunction/builder-go:latest
    env:
...
      # Use FUNC_GOPROXY to set the goproxy
      FUNC_GOPROXY: "https://goproxy.cn"
    srcRepo:
      url: "https://github.com/OpenFunction/samples.git"
      sourceSubPath: "functions/async/logs-handler-function/"
      revision: "main"
xiaocode commented 2 years ago

I check the ksvc status, it shows that the reason is IngressNotConfigured.I installed the openfunction with the command "ofn install --all --region-cn", and everything installed successfully.

webup commented 2 years ago

I check the ksvc status, it shows that the reason is IngressNotConfigured.I installed the openfunction with the command "ofn install --all --region-cn", and everything installed successfully.

So it's clear the problem lies in knative related part, could you please try configure kourier by following this guide?