You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/06/24 13:04:23 UTC

[GitHub] [apisix-ingress-controller] Caelebs opened a new issue #560: request help: Why does the ingress log keep printing service not found?

Caelebs opened a new issue #560:
URL: https://github.com/apache/apisix-ingress-controller/issues/560


   ### Issue description
   
   I installed apisix-ingress-controller in kubesphere, and found that some info-level logs have been printed in the backend log.
   
   ```
   2021-06-24T21:01:55+08:00	info	ingress/endpoint.go:94	service kube-system/kube-controller-manager not found
   [GIN] 2021/06/24 - 21:01:57 | 200 |      73.896µs |       10.0.2.15 | GET      "/healthz"
   2021-06-24T21:01:58+08:00	info	ingress/endpoint.go:94	service kube-system/kube-scheduler not found
   2021-06-24T21:01:58+08:00	info	ingress/endpoint.go:94	service kube-system/kube-controller-manager not found
   E0624 21:01:59.605613       1 reflector.go:138] pkg/mod/k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v2alpha1.ApisixConsumer: failed to list *v2alpha1.ApisixConsumer: apisixconsumers.apisix.apache.org is forbidden: User "system:serviceaccount:apisix-ws:apisix-ingress-controller" cannot list resource "apisixconsumers" in API group "apisix.apache.org" at the cluster scope
   2021-06-24T21:02:00+08:00	info	ingress/endpoint.go:94	service kube-system/kube-scheduler not found
   2021-06-24T21:02:00+08:00	info	ingress/endpoint.go:94	service kube-system/kube-controller-manager not found
   ```
   
   ```
   2021-06-24T21:02:17+08:00	error	translation/apisix_route.go:154	failed to get service port in backend	{"backend": {"serviceName":"httpbin","servicePort":80,"resolveGranularity":"","weight":null,"subset":""}, "apisix_route": {"kind":"ApisixRoute","apiVersion":"apisix.apache.org/v2alpha1","metadata":{"name":"httpserver-route","namespace":"kubesphere-system","selfLink":"/apis/apisix.apache.org/v2alpha1/namespaces/kubesphere-system/apisixroutes/httpserver-route","uid":"307b21a0-fc90-4759-afbe-1d054c5e2fab","resourceVersion":"37638200","generation":1,"creationTimestamp":"2021-06-23T08:56:19Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"apisix.apache.org/v2alpha1\",\"kind\":\"ApisixRoute\",\"metadata\":{\"annotations\":{},\"name\":\"httpserver-route\",\"namespace\":\"kubesphere-system\"},\"spec\":{\"http\":[{\"backend\":{\"serviceName\":\"httpbin\",\"servicePort\":80},\"match\":{\"hosts\":[\"local.httpbin.org\"],\"paths\":[\"/*\"]},\"name\":\"rul
 e1\"}]}}\n"},"managedFields":[{"manager":"kubectl","operation":"Update","apiVersion":"apisix.apache.org/v2alpha1","time":"2021-06-23T08:56:19Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}}},"f:spec":{".":{},"f:http":{}}}}]},"spec":{"http":[{"name":"rule1","match":{"paths":["/*"],"hosts":["local.httpbin.org"]},"backend":{"serviceName":"httpbin","servicePort":80,"resolveGranularity":"","weight":null,"subset":""},"backends":null,"websocket":false}]},"status":{"conditions":[{"type":"ResourcesAvailable","status":"False","lastTransitionTime":"2021-06-23T09:50:58Z","reason":"ResourceSyncAborted","message":"service \"httpbin\" not found"}]}}, "error": "service \"httpbin\" not found"}
   2021-06-24T21:02:17+08:00	error	ingress/apisix_route.go:151	failed to translate ApisixRoute v2alpha1	{"error": "service \"httpbin\" not found", "object": {}}
   2021-06-24T21:02:17+08:00	warn	ingress/apisix_route.go:243	sync ApisixRoute failed, will retry	{"object": {"Type":1,"Object":{"Key":"kubesphere-system/httpserver-route","OldObject":null,"GroupVersion":"apisix.apache.org/v2alpha1"},"Tombstone":null}, "error": "service \"httpbin\" not found"}
   2021-06-24T21:02:17+08:00	error	ingress/status.go:91	failed to record status change for ApisixRoute	{"error": "apisixroutes.apisix.apache.org \"httpserver-route\" is forbidden: User \"system:serviceaccount:apisix-ws:apisix-ingress-controller\" cannot update resource \"apisixroutes/status\" in API group \"apisix.apache.org\" in the namespace \"kubesphere-system\"", "name": "httpserver-route", "namespace": "kubesphere-system"}
   ```
   
   I checked that there is indeed no related service in the cluster, Does this log have any effect? Or is there any way to avoid outputting these logs?
   
   ### Environment
   
   * your apisix-ingress-controller version `1.0.0`
   * your Kubernetes cluster version
   ```
   Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:12:48Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
   Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:04:18Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] gxthrj commented on issue #560: request help: Why does the ingress log keep printing service not found?

Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #560:
URL: https://github.com/apache/apisix-ingress-controller/issues/560#issuecomment-868270611


   Please ignore the `info` and `warn` level, they will not cause any error.
   But the error log
   ```
   021-06-24T21:02:17+08:00	error	translation/apisix_route.go:154	failed to get service port in backend	{"backend": {"serviceName":"httpbin","servicePort":80,"resolveGranularity":"","weight":null,"subset":""}, "apisix_route": {"kind":"ApisixRoute","apiVersion":"apisix.apache.org/v2alpha1","metadata":{"name":"httpserver-route","namespace":"kubesphere-system","selfLink":"/apis/apisix.apache.org/v2alpha1/namespaces/kubesphere-system/apisixroutes/httpserver-route","uid":"307b21a0-fc90-4759-afbe-1d054c5e2fab","resourceVersion":"37638200","generation":1,"creationTimestamp":"2021-06-23T08:56:19Z","annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"apisix.apache.org/v2alpha1\",\"kind\":\"ApisixRoute\",\"metadata\":{\"annotations\":{},\"name\":\"httpserver-route\",\"namespace\":\"kubesphere-system\"},\"spec\":{\"http\":[{\"backend\":{\"serviceName\":\"httpbin\",\"servicePort\":80},\"match\":{\"hosts\":[\"local.httpbin.org\"],\"paths\":[\"/*\"]},\"name\":\"rule
 1\"}]}}\n"},"managedFields":[{"manager":"kubectl","operation":"Update","apiVersion":"apisix.apache.org/v2alpha1","time":"2021-06-23T08:56:19Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}}},"f:spec":{".":{},"f:http":{}}}}]},"spec":{"http":[{"name":"rule1","match":{"paths":["/*"],"hosts":["local.httpbin.org"]},"backend":{"serviceName":"httpbin","servicePort":80,"resolveGranularity":"","weight":null,"subset":""},"backends":null,"websocket":false}]},"status":{"conditions":[{"type":"ResourcesAvailable","status":"False","lastTransitionTime":"2021-06-23T09:50:58Z","reason":"ResourceSyncAborted","message":"service \"httpbin\" not found"}]}}, "error": "service \"httpbin\" not found"}
   2021-06-24T21:02:17+08:00	error	ingress/apisix_route.go:151	failed to translate ApisixRoute v2alpha1	{"error": "service \"httpbin\" not found", "object": {}}
   ```
   
   APISIX Ingress will look for the backend service defined in the `ApisixRoute` resource. If there is no corresponding k8s service, it will report an error and enter the retry phase.
   
   To solve this error log, you need to create the corresponding k8s service. In this example, you need to supplement the `httpbin` service and ensure that the port declared in `ApisixRoute` is consistent with the k8s service port.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] Caelebs commented on issue #560: request help: Why does the ingress log keep printing service not found?

Posted by GitBox <gi...@apache.org>.
Caelebs commented on issue #560:
URL: https://github.com/apache/apisix-ingress-controller/issues/560#issuecomment-868376529


   I checked and found that because the namespace was not specified when `kubectl apply -f httpbin-route.yaml` was executed, this crd was created under the `kubesphere-system` namespace, and it has now been deleted. and now there is no error level log. 
   Thanks for your reply. @gxthrj @tokers


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] Caelebs closed issue #560: request help: Why does the ingress log keep printing service not found?

Posted by GitBox <gi...@apache.org>.
Caelebs closed issue #560:
URL: https://github.com/apache/apisix-ingress-controller/issues/560


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-ingress-controller] tokers commented on issue #560: request help: Why does the ingress log keep printing service not found?

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #560:
URL: https://github.com/apache/apisix-ingress-controller/issues/560#issuecomment-868347536


   @Caelebs 
   
   For those logs reported by the endpoints.go: some endpoints are used as the lock, which are not created by the k8s endpoints controller. So for those endpoints, there are not the corresponding service objects there.
   
   For those reported by apisix route controller, you may refer to a non-existent k8s service?
   
   The "unstream is not referenced" error is harmless as apisix ingress controller watches all services in k8s, if these services are not referenced by apisix routes, these logs will be printed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org