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

Fail to run Kong from compiled source code as mentioned on DEVELOPER.md #11554

Closed
1 task done
DGideas opened this issue Sep 12, 2023 · 3 comments
Closed
1 task done

Comments

@DGideas
Copy link

DGideas commented Sep 12, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.4.0

Current Behavior

I use a clean Ubuntu 22.04 LTS on a x86_64 machine. And I want to compile Kong from source code. The following bash script is majorly from DEVELOPER.md and I run them as root user:

cd ~
sudo apt update \
&& sudo apt install -y \
    automake \
    build-essential \
    curl \
    file \
    git \
    libyaml-dev \
    libprotobuf-dev \
    m4 \
    perl \
    pkg-config \
    procps \
    unzip \
    valgrind \
    zlib1g-dev \
    docker-compose
git clone https://github.com/Kong/kong
cd kong
git checkout 3.4.0
export GITHUB_TOKEN=github_xxx
make build-venv

When finish building Kong, I use the following code originally from DEVELOPER.md try to start Kong:

source /root/kong/bazel-bin/build/kong-dev-venv.sh # venv
start_services
kong migrations bootstrap
kong start

When executes on kong start, I met this exception:

# kong start
2023/09/12 20:52:26 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
2023/09/12 20:52:26 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Error: ...azel-bin/build/kong-dev/share/lua/5.1/kong/cmd/start.lua:98: nginx: [error] init_by_lua error: ...el-bin/build/kong-dev/share/lua/5.1/kong/tools/utils.lua:786: error loading module 'kong.plugins.opentelemetry.handler':
...s/kong/bazel-bin/build/kong-dev/share/lua/5.1/protoc.lua:342: module load error: opentelemetry/proto/collector/trace/v1/trace_service.proto
	opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
	./opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
	/usr/local/kong/include/opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
	/usr/local/opt/protobuf/include//opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
	/usr/include/opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
	kong/include/opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
	spec/fixtures/grpc/opentelemetry/proto/collector/trace/v1/trace_service.proto: No such file or directory
stack traceback:
	[C]: in function 'error'
	...s/kong/bazel-bin/build/kong-dev/share/lua/5.1/protoc.lua:342: in function 'f'
	...s/kong/bazel-bin/build/kong-dev/share/lua/5.1/protoc.lua:1149: in function 'do_compile'
	...s/kong/bazel-bin/build/kong-dev/share/lua/5.1/protoc.lua:1165: in function 'compilefile'
	...s/kong/bazel-bin/build/kong-dev/share/lua/5.1/protoc.lua:1178: in function 'loadfile'
	...g-dev/share/lua/5.1/kong/plugins/opentelemetry/proto.lua:9: in function 'load_proto'
	...g-dev/share/lua/5.1/kong/plugins/opentelemetry/proto.lua:12: in main chunk
	[C]: in function 'require'
	...ng-dev/share/lua/5.1/kong/plugins/opentelemetry/otlp.lua:1: in main chunk
	[C]: in function 'require'
	...dev/share/lua/5.1/kong/plugins/opentelemetry/handler.lua:4: in main chunk
	[C]: at 0x7f55a26e0310
	[C]: in function 'xpcall'
	...el-bin/build/kong-dev/share/lua/5.1/kong/tools/utils.lua:777: in function 'load_module_if_exists'
	...bin/build/kong-dev/share/lua/5.1/kong/db/dao/plugins.lua:154: in function 'load_plugin_handler'
	...bin/build/kong-dev/share/lua/5.1/kong/db/dao/plugins.lua:260: in function 'load_plugin'
	...bin/build/kong-dev/share/lua/5.1/kong/db/dao/plugins.lua:312: in function 'load_plugin_schemas'
	...ong/bazel-bin/build/kong-dev/share/lua/5.1/kong/init.lua:629: in function 'init'
	init_by_lua:3: in main chunk
stack traceback:
	[C]: in function 'error'
	...el-bin/build/kong-dev/share/lua/5.1/kong/tools/utils.lua:786: in function 'load_module_if_exists'
	...bin/build/kong-dev/share/lua/5.1/kong/db/dao/plugins.lua:154: in function 'load_plugin_handler'
	...bin/build/kong-dev/share/lua/5.1/kong/db/dao/plugins.lua:260: in function 'load_plugin'
	...bin/build/kong-dev/share/lua/5.1/kong/db/dao/plugins.lua:312: in function 'load_plugin_schemas'
	...ong/bazel-bin/build/kong-dev/share/lua/5.1/kong/init.lua:629: in function 'init'
	init_by_lua:3: in main chunk


  Run with --v (verbose) or --vv (debug) for more details

Expected Behavior

The Kong should start normally.

Steps To Reproduce

(Please see "Current Behavior" section, I have paste all the script I executed there)

Anything else?

n/a

@DGideas DGideas changed the title Fail to run Kong from source as mentioned on DEVELOPER.md Fail to run Kong from compiled source code as mentioned on DEVELOPER.md Sep 12, 2023
@DGideas
Copy link
Author

DGideas commented Sep 12, 2023

By the way, I fixed it by executing make install as root user. However, this behavior has not been mentioned in DEVELOPER.md. I am curious if other users are able to start their development environment successfully without executing make install?

@DGideas

This comment was marked as outdated.

@DGideas DGideas closed this as completed Sep 12, 2023
@DGideas
Copy link
Author

DGideas commented Sep 12, 2023

If you meet exception from opentelemetry or PATH, you need to execute the following code:

echo 'PATH=$PATH:~/home/user/kong/bazel-bin/build/kong-dev/openresty/bin' | sudo tee -a ~/.bashrc
echo 'PATH=$PATH:~/home/user/kong/bazel-bin/build/kong-dev/openresty/nginx/sbin' | sudo tee -a ~/.bashrc
echo 'PATH=$PATH:~/home/user/kong/bazel-bin/build/kong-dev/bin' | sudo tee -a ~/.bashrc

The user mentioned above could be /root, these code from .github/workflows/perf.yml:63

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

1 participant