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/25 06:57:13 UTC

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

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