Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl: (52) Empty reply from server #3437

Closed
ShaoZeMing opened this issue Jan 27, 2021 · 7 comments
Closed

curl: (52) Empty reply from server #3437

ShaoZeMing opened this issue Jan 27, 2021 · 7 comments

Comments

@ShaoZeMing
Copy link

ShaoZeMing commented Jan 27, 2021

Issue description

目前执行:
curl http://127.0.0.1:80/apisix/plugin/jwt/sign?key=user-key -i
或者 curl http://127.0.0.1:80

报错误 curl: (52) Empty reply from server

添加了全局cors 插件+zipkin 差距

没有添加任何本机/* 域名代理

Environment

  • apisix version 2.2 (docker-centos):
  • OS: Linux xxxx-o1 3.10.0-1160.6.1.el7.x86_64 change: added doc of how to load plugin. #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • OpenResty / Nginx version: (nginx version: openresty/1.19.3.1)
  • etcd version, if have: 3.4
  • apisix-dashboard 2.3
@Firstsawyou
Copy link
Contributor

Please provide your configuration information. This will help troubleshoot the problem.

@ShaoZeMing
Copy link
Author

ShaoZeMing commented Jan 27, 2021

install

docker pull apache/apisix:2.2-centos
mkdir -p  /data/apisix/


docker run --restart=always -d --name apisix-server \
    --network apisix \
    -p 80:9080 \
    -p 443:9443 \
    -v /data/apisix/conf/config.yaml:/usr/local/apisix/conf/config.yaml  \
    -v /data/apisix/logs:/usr/local/apisix/logs  \
    apache/apisix:2.2-centos

conf


etcd:
  host:
   - "http://etcd-server:2379"
#
# To configure via environment variables, you can use `${{VAR}}` syntax. For instance:
#
# etcd:
#     host:
#       - "http://${{ETCD_HOST}}:2379"
#
# And then run `export ETCD_HOST=$your_host` before `make init`.
#
# If the configured environment variable can't be found, an error will be thrown.
apisix:
  admin_key:
    -
      name: "admin"
      # yamllint disable rule:comments-indentation
      key: edd1c9f034335f136f87ad84b625c8f1  # using fixed API token has security risk, please
      # update it when you deploy to production environment
      # yamllint enable rule:comments-indentation
      role: admin

image
Snipaste_2021-01-27_22-00-31
Snipaste_2021-01-27_22-03-41

image

@Firstsawyou
Copy link
Contributor

This is not caused by apisix, you should check the curl command for errors.

@ShaoZeMing
Copy link
Author

This is not caused by apisix, you should check the curl command for errors.

But the same happens when I use http request.

@ShaoZeMing
Copy link
Author

apisix/logs/error.log


2021/01/28 05:52:18 [warn] 49#49: *1 [lua] plugin.lua:206: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2021/01/28 05:52:18 [warn] 50#50: *2 [lua] plugin.lua:206: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2021/01/28 05:52:18 [warn] 51#51: *3 [lua] plugin.lua:206: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2021/01/28 05:52:18 [warn] 52#52: *4 [lua] plugin.lua:206: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2021/01/28 05:52:18 [warn] 55#55: *5 [lua] plugin.lua:206: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2021/01/28 05:52:18 [warn] 49#49: *7 [lua] init.lua:288: sync_local_conf_to_etcd(): sync local conf to etcd, context: ngx.timer
2021/01/28 05:52:50 [error] 51#51: *2271 failed to run header_filter_by_lua*: /usr/local/apisix/apisix/core/lrucache.lua:159: invalid value (nil) at index 1 in table for 'concat'
stack traceback:
        [C]: in function 'concat'
        /usr/local/apisix/apisix/core/lrucache.lua:159: in function 'plugin_ctx'
        /usr/local/apisix/apisix/plugins/cors.lua:168: in function 'phase_func'
        /usr/local/apisix/apisix/init.lua:164: in function 'run_plugin'
        /usr/local/apisix/apisix/init.lua:625: in function 'common_phase'
        /usr/local/apisix/apisix/init.lua:662: in function 'http_header_filter_phase'
        header_filter_by_lua:2: in main chunk, client: 192.168.0.139, server: , request: "GET / HTTP/1.1", host: "192.168.3.130"

@spacewander
Copy link
Member

Fixed by #3332?

@spacewander
Copy link
Member

Consider solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants