OpenFunction icon indicating copy to clipboard operation
OpenFunction copied to clipboard

Node.js samples can not work

Open xiaocode opened this issue 3 years ago • 4 comments

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/[email protected]: 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

xiaocode avatar Jul 27 '22 19:07 xiaocode

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.

webup avatar Jul 28 '22 01:07 webup

Also I trid the golang sample, the BUILDSTATE failed with log shows: Failure: (ID: 32633c29) go: github.com/OpenFunction/[email protected]: 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"

benjaminhuo avatar Jul 28 '22 01:07 benjaminhuo

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.

xiaocode avatar Jul 28 '22 17:07 xiaocode

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?

webup avatar Jul 29 '22 08:07 webup