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/07/09 03:38:47 UTC

[GitHub] [apisix] gxthrj opened a new issue #4571: bug: `Skywalking` plugin can not be enabled both in Global and Route rules.

gxthrj opened a new issue #4571:
URL: https://github.com/apache/apisix/issues/4571


   ### Issue description
   When`Skywalking` plugin is enabled both in Global and Route rules. 
   The route will be failed.
   ```
   curl: (52) Empty reply from server
   ```
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.6
   * OS (cmd: `uname -a`): centos 7 and docker
   
   ### Minimal test code / Steps to reproduce the issue
   
   Bug report without steps to reproduce will be ignored or closed.
   
   1. Binding `skywalking` plugin in route
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uris": [
           "/*"
       ],
       "plugins": {
           "skywalking": {
               "sample_ratio": 1
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       }
   }'
   ```
   2. take a request
   ```
   curl -i http://127.0.0.1:9080/ip
   HTTP/1.1 200 OK
   Content-Type: application/json
   Content-Length: 45
   Connection: keep-alive
   Date: Fri, 09 Jul 2021 03:29:39 GMT
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Server: APISIX/2.6
   
   {
     "origin": "172.19.0.1, 58.208.180.202"
   }
   ```
   3.Now add Global rule with `skywalking` plugin.
   ```
   curl -X PUT \
     http://127.0.0.1:9080/apisix/admin/global_rules/1 \
     -H 'Content-Type: application/json' \
     -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
     -d '{
           "plugins": {
               "skywalking": {
                   "sample_ratio":1
               }
           }
       }'
   ```
   4. take a request
   ```
   curl -iv http://127.0.0.1:9080/ip
   *   Trying 127.0.0.1...
   * TCP_NODELAY set
   * Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
   > GET /ip HTTP/1.1
   > Host: 127.0.0.1:9080
   > User-Agent: curl/7.64.1
   > Accept: */*
   >
   * Empty reply from server
   * Connection #0 to host 127.0.0.1 left intact
   curl: (52) Empty reply from server
   * Closing connection 0
   ```
   
   And the error log
   ```
   2021/07/09 03:37:03 [error] 45#45: *1029911 failed to run body_filter_by_lua*: /usr/local/apisix//deps/share/lua/5.1/skywalking/span.lua:196: attempt to index local 'span' (a nil value)
   stack traceback:
           /usr/local/apisix//deps/share/lua/5.1/skywalking/span.lua:196: in function 'setComponentId'
           /usr/local/apisix/apisix/plugins/skywalking.lua:94: in function 'phase_func'
           /usr/local/apisix/apisix/plugin.lua:689: in function 'run_plugin'
           /usr/local/apisix/apisix/init.lua:530: in function 'common_phase'
           /usr/local/apisix/apisix/init.lua:581: in function 'http_body_filter_phase'
           body_filter_by_lua:2: in main chunk while sending to client, client: 172.19.0.1, server: _, request: "GET /ip HTTP/1.1", upstream: "http://18.235.124.214:80/ip", host: "127.0.0.1:9080"
   2021/07/09 03:37:03 [error] 45#45: *1029911 failed to run log_by_lua*: /usr/local/apisix//deps/share/lua/5.1/skywalking/span.lua:190: attempt to index field 'owner' (a nil value)
   stack traceback:
           /usr/local/apisix//deps/share/lua/5.1/skywalking/span.lua:190: in function 'finish'
           /usr/local/apisix//deps/share/lua/5.1/skywalking/tracer.lua:108: in function 'prepareForReport'
           /usr/local/apisix/apisix/plugins/skywalking.lua:104: in function 'phase_func'
           /usr/local/apisix/apisix/plugin.lua:689: in function 'run_plugin'
           /usr/local/apisix/apisix/init.lua:530: in function 'common_phase'
           /usr/local/apisix/apisix/init.lua:639: in function 'http_log_phase'
           log_by_lua(nginx.conf:268):2: in main chunk while logging request, client: 172.19.0.1, server: _, request: "GET /ip HTTP/1.1", upstream: "http://18.235.124.214:80/ip", host: "127.0.0.1:9080"
   ```
   
   


-- 
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] spacewander closed issue #4571: bug: `Skywalking` plugin can not be enabled both in Global and Route rules.

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #4571:
URL: https://github.com/apache/apisix/issues/4571


   


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