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/10/27 03:38:56 UTC

[GitHub] [apisix-ingress-controller] crazyMonkey1995 opened a new issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   ### Issue description
   
   When create an empty apisixupstream, ingress-controller panic
   
   ### Environment
   
   * your apisix-ingress-controller version 1.3.0
   * your Kubernetes cluster version 1.18.20
   
   ### Minimal test code / Steps to reproduce the issue
   
   apisixupstream.yaml
   
   ```
   apiVersion: apisix.apache.org/v1
   kind: ApisixUpstream
   metadata:
     name: whatEverSameAsTargetService
     namespace: whatEverSameAsTargetService
   ```
   kubectl apply -f apisixupstream.yaml ———created
   kubectl describe apisixupstream -n whatEverSameAsTargetService whatEverSameAsTargetService
   
   ```
   Events:
     Type    Reason           Age    From           Message
     ----    ------           ----   ----           -------
     Normal  ResourcesSynced  4m22s  ApisixIngress  ApisixIngress synced successfully
   ```
   
   ### What's the actual result? (including assertion message & call stack if applicable)
   
   apisxi-ingress-controller panic, output:
   
   ```
   panic: runtime error: invalid memory address or nil pointer dereference
   [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x17e5223]
   
   goroutine 347 [running]:
   github.com/apache/apisix-ingress-controller/pkg/ingress.(*Controller).syncEndpoint(0xc0003ea6c0, 0x1fdabe0, 0xc00003dfc0, 0x1fc4520, 0xc000414220, 0x0, 0x0)
   	/build/controller/pkg/ingress/controller.go:556 +0x223
   github.com/apache/apisix-ingress-controller/pkg/ingress.(*endpointsController).sync(...)
   	/build/controller/pkg/ingress/endpoint.go:87
   github.com/apache/apisix-ingress-controller/pkg/ingress.(*endpointsController).run.func1()
   	/build/controller/pkg/ingress/endpoint.go:72 +0x92
   created by github.com/apache/apisix-ingress-controller/pkg/ingress.(*endpointsController).run
   	/build/controller/pkg/ingress/endpoint.go:79 +0x284
   ```
   
   ### What's the expected result?
   
   Maybe create apisixupstream failed?(validate failed)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   I used an empty apisixupstream for testing, but no panic occurred.
   
   ```bash
   ➜  ~ kubectl -n foo get au -oyaml                 
   apiVersion: v1
   items:
   - apiVersion: apisix.apache.org/v1
     kind: ApisixUpstream
     metadata:
       annotations:
         kubectl.kubernetes.io/last-applied-configuration: |
           {"apiVersion":"apisix.apache.org/v1","kind":"ApisixUpstream","metadata":{"annotations":{},"name":"foo","namespace":"foo"}}
       creationTimestamp: "2021-11-03T09:33:38Z"
       generation: 1
       name: foo
       namespace: foo
       resourceVersion: "9746"
       uid: 6fad05a4-4cc1-4108-9ea1-f33df2c06239
   kind: List
   metadata:
     resourceVersion: ""
     selfLink: ""
   ➜  ~ kubectl -n foo describe au foo
   Name:         foo
   Namespace:    foo
   Labels:       <none>
   Annotations:  <none>
   API Version:  apisix.apache.org/v1
   Kind:         ApisixUpstream
   Metadata:
     Creation Timestamp:  2021-11-03T09:33:38Z
     Generation:          1
     Managed Fields:
       API Version:  apisix.apache.org/v1
       Fields Type:  FieldsV1
       fieldsV1:
         f:metadata:
           f:annotations:
             .:
             f:kubectl.kubernetes.io/last-applied-configuration:
       Manager:         kubectl-client-side-apply
       Operation:       Update
       Time:            2021-11-03T09:33:38Z
     Resource Version:  9746
     UID:               6fad05a4-4cc1-4108-9ea1-f33df2c06239
   Events:              <none>
   ```
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   Thanks, let me reproduce


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 closed issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   We can use #790  for tracking, I will close this issue.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] gxthrj commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   I think we should add validation in `apisixUpstream`, the `spec` should not be empty.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #722: bug: empty apisixupstream can be apply but it cause panic

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


   Please provide a reproducible example.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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