Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run an example 404 #2860

Closed
braumzhu opened this issue Oct 26, 2023 · 17 comments
Closed

Run an example 404 #2860

braumzhu opened this issue Oct 26, 2023 · 17 comments
Labels
need-user-input Require inputs from reporter/user

Comments

@braumzhu
Copy link

Fission/Kubernetes version

$ fission version
client:
  fission/core:
    BuildDate: "2023-05-18T12:33:09Z"
    GitCommit: f955d118
    Version: v1.19.0
server:
  fission/core:
    BuildDate: "2023-05-18T12:33:09Z"
    GitCommit: f955d118
    Version: v1.19.0
$ kubectl version
kubectl version
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.4

Kubernetes platform (e.g. Google Kubernetes Engine)

Describe the bug

To Reproduce

fission function test --name hello-js
Error: Error calling function hello-js: 404; Please try again or fix the error: 404 page not found

Error: Error getting function logs from controller: error executing get logs request: no active pods found. Try to get logs from log database.
Warning: version<1.18 used fission-function as pod's default namespace. Specify appropriate namespace with --pod-namespace tag or export an environment variable for function-namespace FUNCTION_NAMESPACE

Options:
--name='' Function name
--method=[GET] HTTP Methods: GET,POST,PUT,DELETE,HEAD. To mention single method: --method GET
and for multiple methods --method GET --method POST. [DEPRECATED for 'fn create',
use 'route create' instead]
--header=[] (-H) Request headers
--body='' (-b) Request body
--query=[] (-q) Request query parameters: -q key1=value1 -q key2=value2
--timeout=1m0s (-t) Length of time to wait for the response. If set to zero or negative number, no
timeout is set
--dbtype='kubernetes' Log database type, e.g. influxdb (currently influxdb and kubernetes logs are
supported)
--subpath='' Sub Path to check if function internally supports routing

Global Options:
--server='' Server URL
--verbosity=1 (-v) CLI verbosity (0 is quiet, 1 is the default, 2 is verbose)
--kube-context='' Kubernetes context to be used for the execution of Fission commands
--namespace='' (-n) If present, the namespace scope for this CLI request

Usage:
fission function test [options]

Error: error getting function response
Expected result

Actual result

Screenshots/Dump file

$ fission support dump

Additional context

@braumzhu
Copy link
Author

just run fission function test --name hello-js The command returned an error. Error: Error calling function hello-js: 404; Please try again or fix the error: 404 page not found。 I'm unsure about the potential impact of the following error. fission-v1-19-0-fission-v1.19.0-153-fxpdr 0/1 Completed 0 145m

@braumzhu
Copy link
Author

fission function list
NAME ENV EXECUTORTYPE MINSCALE MAXSCALE MINCPU MAXCPU MINMEMORY MAXMEMORY SECRETS CONFIGMAPS NAMESPACE
hello-go go poolmgr 0 0 0 0 0 0 fission
hello-js nodejs poolmgr 0 0 0 0 0 0 fission
hello-js-1 nodejs poolmgr 0 0 0 0 0 0 fission
hello-py python poolmgr 0 0 0 0 0 0 fission

@braumzhu
Copy link
Author

fission pkg list
NAME BUILD_STATUS ENV LASTUPDATEDAT NAMESPACE
hello-js-1-ba99aa48-6421-4d6b-a129-7d2c38e38a4b succeeded nodejs 26 Oct 23 19:55 CST fission
hello-js-eb1cd64c-f8ec-4d56-8889-b41e4e7cd4b6 succeeded nodejs 26 Oct 23 19:35 CST fission
hello-py-62d3ecb2-8f5a-4ce2-b689-8c289f918b78 succeeded python 26 Oct 23 19:30 CST fission
hello-py-fcddf0f9-1bf3-439a-a5c1-9d2e119009df succeeded python 26 Oct 23 17:40 CST fission
hello-go-f760ee10-1247-4c67-b845-4a95080f91a1 pending go 26 Oct 23 17:32 CST fission

@sanketsudake
Copy link
Member

sanketsudake commented Oct 26, 2023

Can you share please following command output ?

  1. helm get values fission -n fission
  2. kubectl get functions -A
  3. kubectl get environments -A

@sanketsudake sanketsudake added the need-user-input Require inputs from reporter/user label Oct 26, 2023
@braumzhu
Copy link
Author

I did not use Helm to install Fission. I used the method without Helm. After that, I installed Helm and executed the command, and the result is as follows:

helm get values fission -n fission
Error: release: not found

kubectl get functions -A
NAMESPACE NAME AGE
fission hello-go 16h
fission hello-js 13h
fission hello-js-1 13h
fission hello-py 14h

kubectl get environments -A
NAMESPACE NAME AGE
fission go 16h
fission nodejs 13h
fission python 15h

@braumzhu
Copy link
Author

{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "pods "executor-5c8cbff789-4qkr7" is forbidden: User "system:anonymous" cannot get resource "pods/log" in API group "" in the namespace "fission"",
"reason": "Forbidden",
"details": {
"name": "executor-5c8cbff789-4qkr7",
"kind": "pods"
},
"code": 403
}

@braumzhu
Copy link
Author

@james-mchugh
Copy link

Looks like the same issue as #2729 and #2811

@sanketsudake
Copy link
Member

Unable to download any zip from above dump.

Please check kubectl get deployment executor -n fission -o yaml | grep -A 2 FISSION

Eg.

 kubectl get deployment executor -n fission -o yaml | grep -A 2 FISSION
+ kubectl get deployment executor -n fission -o yaml
        - name: FISSION_BUILDER_NAMESPACE
        - name: FISSION_FUNCTION_NAMESPACE
        - name: FISSION_DEFAULT_NAMESPACE
          value: default
        - name: FISSION_RESOURCE_NAMESPACES
          value: default
        - name: HELM_RELEASE_NAME

You should be creating functions, and environments in only namespace which are part of FISSION_RESOURCE_NAMESPACES

@braumzhu
Copy link
Author

@braumzhu
Copy link
Author

kubectl get deployment executor -n fission -o yaml | grep -A 2 FISSION
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"chart":"fission-all-v1.19.0","svc":"executor"},"name":"executor","namespace":"fission"},"spec":{"replicas":1,"selector":{"matchLabels":{"svc":"executor"}},"template":{"metadata":{"annotations":{"prometheus.io/path":"/metrics","prometheus.io/port":"8080","prometheus.io/scrape":"true"},"labels":{"svc":"executor"}},"spec":{"containers":[{"args":["--executorPort","8888"],"command":["/fission-bundle"],"env":[{"name":"FETCHER_IMAGE","value":"fission/fetcher:v1.19.0"},{"name":"FETCHER_IMAGE_PULL_POLICY","value":"IfNotPresent"},{"name":"FISSION_BUILDER_NAMESPACE","value":""},{"name":"FISSION_FUNCTION_NAMESPACE","value":""},{"name":"FISSION_DEFAULT_NAMESPACE","value":"default"},{"name":"RUNTIME_IMAGE_PULL_POLICY","value":"IfNotPresent"},{"name":"ADOPT_EXISTING_RESOURCES","value":"false"},{"name":"POD_READY_TIMEOUT","value":"300s"},{"name":"ENABLE_ISTIO","value":"false"},{"name":"FETCHER_MINCPU","value":"10m"},{"name":"FETCHER_MINMEM","value":"16Mi"},{"name":"FETCHER_MAXCPU","value":""},{"name":"FETCHER_MAXMEM","value":""},{"name":"DEBUG_ENV","value":"false"},{"name":"PPROF_ENABLED","value":"false"},{"name":"OBJECT_REAPER_INTERVAL","value":"5"},{"name":"SERVICEACCOUNT_CHECK_ENABLED","value":"true"},{"name":"SERVICEACCOUNT_CHECK_INTERVAL","value":"0"},{"name":"FISSION_RESOURCE_NAMESPACES","value":"default"},{"name":"HELM_RELEASE_NAME","value":"fission-v1-19-0"},{"name":"OTEL_EXPORTER_OTLP_ENDPOINT","value":""},{"name":"OTEL_EXPORTER_OTLP_INSECURE","value":"true"},{"name":"OTEL_TRACES_SAMPLER","value":"parentbased_traceidratio"},{"name":"OTEL_TRACES_SAMPLER_ARG","value":"0.1"},{"name":"OTEL_PROPAGATORS","value":"tracecontext,baggage"}],"image":"ghcr.io/fission/fission-bundle:v1.19.0","imagePullPolicy":"IfNotPresent","livenessProbe":{"httpGet":{"path":"/healthz","port":8888},"initialDelaySeconds":35,"periodSeconds":5},"name":"executor","ports":[{"containerPort":8080,"name":"metrics"},{"containerPort":8888,"name":"http"}],"readinessProbe":{"failureThreshold":30,"httpGet":{"path":"/healthz","port":8888},"initialDelaySeconds":1,"periodSeconds":1},"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"securityContext":{"fsGroup":10001,"runAsGroup":10001,"runAsNonRoot":true,"runAsUser":10001},"serviceAccountName":"fission-executor"}}}}
creationTimestamp: "2023-10-26T09:25:55Z"
generation: 1
--
- name: FISSION_BUILDER_NAMESPACE
- name: FISSION_FUNCTION_NAMESPACE
- name: FISSION_DEFAULT_NAMESPACE
value: default
- name: RUNTIME_IMAGE_PULL_POLICY
--
- name: FISSION_RESOURCE_NAMESPACES
value: default
- name: HELM_RELEASE_NAME

@braumzhu
Copy link
Author

I couldn't find the pod for the function. I'm not sure if this is normal.

@sanketsudake
Copy link
Member

So you have configured/ created functions in fission namespace.

kubectl get functions -A
NAMESPACE NAME AGE
fission hello-go 16h
fission hello-js 13h
fission hello-js-1 13h
fission hello-py 14h

kubectl get environments -A
NAMESPACE NAME AGE
fission go 16h
fission nodejs 13h
fission python 15h

Where as fission expects functions in default namespace.

- name: FISSION_RESOURCE_NAMESPACES
value: default

You can try creating function default namespace and see if that works.

Also similar discussion in Slack space.
https://fissionio.slack.com/archives/C3LUX6BBP/p1697690907794599?thread_ts=1697614202.956899&cid=C3LUX6BBP

https://fissionio.slack.com/archives/C3LUX6BBP/p1697562243769999

@braumzhu
Copy link
Author

Yes, indeed, it is this issue. I just tried creating in the default namespace and it worked. Thank you.

@braumzhu braumzhu reopened this Oct 30, 2023
@braumzhu
Copy link
Author

How can I join Slack? My google email is zd514591981@163.com.

@sanketsudake
Copy link
Member

sanketsudake commented Oct 30, 2023

https://fission.io/slack

@braumzhu
Copy link
Author

braumzhu commented Nov 3, 2023

Indeed, when I modify the function creation to the default namespace and test it, it can run successfully. However, other components of Fission, including the route, are all within the fission namespace. As a result, my HTTP calls cannot succeed. Is there a way for me to avoid creating in the default namespace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-user-input Require inputs from reporter/user
Projects
None yet
Development

No branches or pull requests

3 participants