Apisix-dashboard: bug: non-json data causes error logs

Created on 19 Jan 2021  路  6Comments  路  Source: apache/apisix-dashboard

Bug report

Describe the bug

json parse failed log in error.log

How to Reproduce

  1. start Manager API (new installation)
  2. start APISIX (new installation)

Expected behavior

no error log

System information

  • OS: [e.g. macOS, Windows] macOS
  • Browser (if applies) [e.g. Chrome, Safari, Edge]
  • Version: [e.g. 2.0-rc3] master

Additional context

first time installation and start APISIX after the Manager API started.

backend bug

Most helpful comment

@nic-chen I'm afraid I cannot reproduce in my environment. Is the etcd also newly installed? I guess there's something wrong with the data in etcd. So could you please have a try to run etcdctl del "/apisix" --prefix && apisix init && apisix init_etcd to reinitialize the etcd?

a simple reproduce step:

  1. run Manager API
  2. etcdctl del --prefix /apisix
  3. apisix init

in the process don't stop the Manager API.

@nic-chen thanks for the details. I managed to reproduce this issue. The reason is that we should explicitly ignore the init_dir etcd event during Watch etcd process. I would commit an PR to fix this. Thanks for reporting.

All 6 comments

@nic-chen Sorry, I don't get your point. Can you give more info about this?

@nic-chen Any examples?

image

@tokers @starsz

@nic-chen I'm afraid I cannot reproduce in my environment. Is the etcd also newly installed? I guess there's something wrong with the data in etcd. So could you please have a try to run etcdctl del "/apisix" --prefix && apisix init && apisix init_etcd to reinitialize the etcd?

@nic-chen I'm afraid I cannot reproduce in my environment. Is the etcd also newly installed? I guess there's something wrong with the data in etcd. So could you please have a try to run etcdctl del "/apisix" --prefix && apisix init && apisix init_etcd to reinitialize the etcd?

a simple reproduce step:

  1. run Manager API
  2. etcdctl del --prefix /apisix
  3. apisix init

in the process don't stop the Manager API.

@nic-chen I'm afraid I cannot reproduce in my environment. Is the etcd also newly installed? I guess there's something wrong with the data in etcd. So could you please have a try to run etcdctl del "/apisix" --prefix && apisix init && apisix init_etcd to reinitialize the etcd?

a simple reproduce step:

  1. run Manager API
  2. etcdctl del --prefix /apisix
  3. apisix init

in the process don't stop the Manager API.

@nic-chen thanks for the details. I managed to reproduce this issue. The reason is that we should explicitly ignore the init_dir etcd event during Watch etcd process. I would commit an PR to fix this. Thanks for reporting.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stu01509 picture stu01509  路  3Comments

juzhiyuan picture juzhiyuan  路  3Comments

imjoey picture imjoey  路  6Comments

juzhiyuan picture juzhiyuan  路  5Comments

aiyiyi121 picture aiyiyi121  路  4Comments