Skip to content

Conversation

@fengxsong
Copy link
Contributor

@fengxsong fengxsong commented Jan 5, 2023

Signed-off-by: fengxsong fengxsong@outlook.com

When etcd.use_grpc=true, without etcdctl binary tool apisix will crash infinite report error.

In order to build multi-arch images, use multistage build.

Signed-off-by: fengxsong <fengxsong@outlook.com>
@fengxsong fengxsong force-pushed the add_etcdctl_when_use_grpc branch from f4bc119 to c729018 Compare January 5, 2023 13:06
Copy link
Member

@spacewander spacewander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The etcdctl is packed in
https://github.com/api7/apisix-build-tools/blob/7fbbde6bdbd5b1c6404a5c610b38be5344503e6f/build-apisix-base.sh#L186

And we already have code to check the existence of etcdctl:
https://github.com/apache/apisix/blob/1609ce6990b6d93262ea80efb29836eab2109c0e/apisix/cli/etcd.lua#L487

Could you provide a stand-alone example to reproduce this issue?

@fengxsong
Copy link
Contributor Author

fengxsong commented Jan 6, 2023

when using image apache/apisix:3.1.0-debian, logs printed as follow

root@10.74.36.168:~# kubectl -n ingress-apisix logs -f apisix-5cd9bf77db-lqx9w
/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init

WARNING: using fixed Admin API token has security risk.
Please modify "admin_key" in conf/config.yaml .


/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init_etcd
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found
sh: 1: etcdctl: not found

@fengxsong
Copy link
Contributor Author

fengxsong commented Jan 6, 2023

All right, looks like the $PATH did not set correctly.

root@10:/usr/local/apisix# find / -name 'etcd*'
find: '/proc/63/map_files': Permission denied
find: '/proc/64/map_files': Permission denied
find: '/proc/65/map_files': Permission denied
find: '/proc/66/map_files': Permission denied
find: '/proc/67/map_files': Permission denied
/usr/local/apisix/apisix/cli/etcd.lua
/usr/local/apisix/apisix/core/etcd.lua
/usr/local/apisix/deps/share/lua/5.1/resty/etcd
/usr/local/apisix/deps/share/lua/5.1/resty/etcd.lua
/usr/local/openresty/bin/etcdctl
/etcd-ssl
root@10:/usr/local/apisix# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I'll make another PR later.

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

Successfully merging this pull request may close these issues.

2 participants