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

Building apisix 2.10.0-0 results in wrong shebang for /usr/bin/apisix #117

Closed
fbartels opened this issue Oct 25, 2021 · 5 comments
Closed

Comments

@fbartels
Copy link

fbartels commented Oct 25, 2021

In apache/apisix@98be489 the upstream project changed the shebang from #!/usr/bin/env lua to #!/bin/bash which causes the following error when trying to start it:

$ apisix 
/usr/local/openresty/luajit/bin/luajit: /usr/bin/apisix:4: unexpected symbol near '#'

But even when manually changing the shebang back (and the line added afterwards), the application does not start:

root@host:/opt/software# apisix 
/usr/local/openresty/luajit/bin/luajit /usr/local/apisix/apisix/cli/apisix.lua 
/usr/local/openresty/luajit/bin/luajit: /usr/local/apisix/apisix/cli/apisix.lua:31: module 'apisix.cli.env' not found:
        no field package.preload['apisix.cli.env']
        no file '/usr/local/apisix/deps/share/lua/5.1/apisix/cli/env.lua'
        no file './apisix/cli/env.lua'
        no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/apisix/cli/env.lua'
        no file '/usr/local/share/lua/5.1/apisix/cli/env.lua'
        no file '/usr/local/share/lua/5.1/apisix/cli/env/init.lua'
        no file '/usr/local/openresty/luajit/share/lua/5.1/apisix/cli/env.lua'
        no file '/usr/local/openresty/luajit/share/lua/5.1/apisix/cli/env/init.lua'
        no file '/usr/local/apisix/deps/lib64/lua/5.1/apisix/cli/env.so'
        no file '/usr/local/apisix/deps/lib/lua/5.1/apisix/cli/env.so'
        no file './apisix/cli/env.so'
        no file '/usr/local/lib/lua/5.1/apisix/cli/env.so'
        no file '/usr/local/openresty/luajit/lib/lua/5.1/apisix/cli/env.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/usr/local/apisix/deps/lib64/lua/5.1/apisix.so'
        no file '/usr/local/apisix/deps/lib/lua/5.1/apisix.so'
        no file './apisix.so'
        no file '/usr/local/lib/lua/5.1/apisix.so'
        no file '/usr/local/openresty/luajit/lib/lua/5.1/apisix.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        /usr/local/apisix/apisix/cli/apisix.lua:31: in main chunk
        [C]: at 0x5562cfe732b0

Version 2.3.0 starts without problems.

@imjoey
Copy link
Contributor

imjoey commented Oct 28, 2021

@fbartels Hi, thanks for reporting. I'm afraid that the change you mentioned happened a long time ago. Moreover, there's no reletaed changes between 2.4.0 and 2.3.0. The CIs related to verifying the RPM are acted as expected, please see https://github.com/api7/apisix-build-tools/blob/master/.github/workflows/package-apisix-rpm-el7.yml.

Do you mind provide your environments, such as the version of OS distributions, openresty, luajit? Thank you very much.

@imjoey
Copy link
Contributor

imjoey commented Oct 28, 2021

Hi @fbartels, this bug is confirmed. The reason is that the script incorrectly set the shebang, see #107 (comment) for details. I would mark this as duplicated of issue #107, as well as close this for now. Thanks.

@imjoey imjoey closed this as completed Oct 28, 2021
@fbartels
Copy link
Author

👍 thanks for the response and yes on the second look this indeed looks like a duplicate.

My environment was Ubuntu 20.04, openresty 1.19.9.1-1~focal1, liblua5.3-0:amd64 5.3.3-1.1ubuntu2

@imjoey
Copy link
Contributor

imjoey commented Oct 28, 2021

👍 thanks for the response and yes on the second look this indeed looks like a duplicate.

My environment was Ubuntu 20.04, openresty 1.19.9.1-1~focal1, liblua5.3-0:amd64 5.3.3-1.1ubuntu2

@fbartels thank you very much for your report. Will fix that issue soon.

@imjoey
Copy link
Contributor

imjoey commented Oct 29, 2021

Hi @fbartels, this issue has been fixed via #125 . Thank you very much for your report. Please use the latest code for building apisix 2.10.x. Meanwhile, you can install the latest apisix 2.10.1 via https://repos.apiseven.com/packages/centos/7/x86_64/apisix-2.10.1-0.el7.x86_64.rpm. Your feedback is much appreciated.

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

2 participants