dantegarden opened a new issue #50:
URL: https://github.com/apache/apisix-python-plugin-runner/issues/50


   I wrote a custom plugin to control the permission of my application deployed 
in k8s. 
   The upstream is a code-server web application. 
   It can be accessed normally under nginx-ingress.
   When I switched from ingress to apisix, most requests can be proxied 
normally, except for one ttf request like:
   
   
`http://a1.webide.demo.test/static/out/vs/base/browser/ui/codicons/codicon/codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6`
   This request returned 503.
   
   Then I looked at the log of apisix, I saw the following error messages:
   ```
   2022/03/18 13:26:32 [error] 44#44: *295957 [lua] init.lua:703: phase_func(): 
failed to receive RPC_HTTP_REQ_CALL: timeout, client: 192.168.1.64, server: _, 
request: "GET 
/static/out/vs/base/browser/ui/codicons/codicon/codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6
 HTTP/1.1", host: "a1.webide.demo.test"
   2022/03/18 13:26:32 [warn] 44#44: *295957 [lua] plugin.lua:724: 
run_plugin(): ext-plugin-pre-req exits with http status code 503, client: 
192.168.1.64, server: _, request: "GET 
/static/out/vs/base/browser/ui/codicons/codicon/codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6
 HTTP/1.1", host: "a1.webide.demo.test"
   192.168.1.64 - - [18/Mar/2022:13:26:32 +0000] a1.webide.demo.test "GET 
/static/out/vs/base/browser/ui/codicons/codicon/codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6
 HTTP/1.1" 503 596 60.004 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36" - - - 
"http://a1.webide.demo.test";
   192.168.1.64 - - [18/Mar/2022:13:26:33 +0000] a1.webide.demo.test "GET 
/favicon.ico HTTP/1.1" 304 0 0.308 
"http://a1.webide.demo.test/static/out/vs/base/browser/ui/codicons/codicon/codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6";
 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/99.0.4844.74 Safari/537.36" 10.7.230.250:9999 304 0.012 
"http://a1.webide.demo.test/favicon.ico";
   2022/03/18 13:27:23 [warn] 54#54: *351 [lua] init.lua:775: Exception in 
thread Thread-44:
   Traceback (most recent call last):
     File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
   , context: ngx.timer
   2022/03/18 13:27:23 [warn] 54#54: *351 [lua] init.lua:775:     self.run()
     File "/usr/lib/python3.9/threading.py", line 892, in run
       self._target(*self._args, **self._kwargs)
     File 
"/usr/lib/python3.9/site-packages/apache_apisix-0.2.0-py3.9.egg/apisix/runner/server/server.py",
 line 60, in _threaded
       response = handler.dispatch()
     File 
"/usr/lib/python3.9/site-packages/apache_apisix-0.2.0-py3.9.egg/apisix/runner/server/handle.py",
 line 41, in dispatch
       req = NewHttpRequest(self.r)
     File 
"/usr/lib/python3.9/site-packages/apache_apisix-0.2.0-py3.9.egg/apisix/runner/http/request.py",
 line 63, in __init__
       self.__init()
     File 
"/usr/lib/python3.9/site-packages/apache_apisix-0.2.0-py3.9.egg/apisix/runner/http/request.py",
 line 398, in __init
   , context: ngx.timer
   2022/03/18 13:27:23 [warn] 54#54: *351 [lua] init.lua:775:     arg_dict = 
runner_utils.parse_dict_vector(req, runner_utils.VECTOR_TYPE_QUERY)
   , context: ngx.timer
   2022/03/18 13:27:23 [warn] 54#54: *351 [lua] init.lua:775:   File 
"/usr/lib/python3.9/site-packages/apache_apisix-0.2.0-py3.9.egg/apisix/runner/utils/common.py",
 line 228, in parse_dict_vector
   , context: ngx.timer
   2022/03/18 13:27:23 [warn] 54#54: *351 [lua] init.lua:775:     val = 
getattr(cls, fn)(i).Value().decode()
   AttributeError: 'NoneType' object has no attribute 'decode'
   , context: ngx.timer
   
   ```
   
   It seems that some part of the plugin that I haven't changed has blocked the 
TTF request. Maybe bugs?
   How to solve this problem?
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to