Open
Description
Current Behavior
apisix.core.utils.gethostname returns "" in apache/apisix:3.11.o-redhat, not the hostname or string “unknow”
Expected Behavior
The apisix.core.utils.gethostname function returns the correct hostname in systems where '/bin/hostname' is not present.
Error Logs
2025/05/30 02:35:24 [warn] 51#51: *1 [lua] plugin.lua:957: decrypt_conf(): failed to get schema for plugin: zero-trust-auth, context: init_worker_by_lua*
2025/05/30 02:35:24 [warn] 51#51: *1 [lua] plugin.lua:957: decrypt_conf(): failed to get schema for plugin: idaas-cas, context: init_worker_by_lua*
2025/05/30 02:35:24 [warn] 51#51: *1 [lua] plugin.lua:957: decrypt_conf(): failed to get schema for plugin: zero-trust-auth, context: init_worker_by_lua*
sh: /bin/hostname: No such file or directory
Steps to Reproduce
git clone https://github.com/apache/apisix-docker.git
cd apisix-docker/example
- modify apisix docker image to apache/apisix:3.11.0-redhat in apisix-docker/example/docker-compose.yml
services:
apisix:
image: apache/apisix:${APISIX_IMAGE_TAG:-3.11.0-redhat}
BTW, the "apache/apisix:3.12.0-redhat" does not exist.
docker-compose -p apisix up -d
docker logs -f apisix-apisix-1
, you will see 'sh: /bin/hostname: No such file or directory' in the logcurl http://127.0.0.1:9092/v1/server_info
, you will see the hostname is ""{"boot_time":1748572529,"etcd_version":"3.5.0","id":"eb7f4459-4920-4555-9fe9-833a4babb889","version":"3.11.0","hostname":""}
### Environment
- APISIX version (run `apisix version`): 3.11.0
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
📋 Backlog