error: ‘struct ngx_table_elt_t’ has no member named ‘next’
gbc921 opened this issue · 3 comments
Describe the bug
When trying to compile the otel module using the default main git Nginx repo,
almost finishing the compilation I get this error:
[100%] Linking CXX static library libgrpc++.a
[100%] Built target grpc++
[100%] Generating opentelemetry/proto/common/v1/common.pb.cc, opentelemetry/proto/resource/v1/resource.pb.cc, opentelemetry/proto/trace/v1/trace.pb.cc, opentelemetry/proto/collector/trace/v1/trace_service.pb.cc, opentelemetry/proto/collector/trace/v1/trace_service.grpc.pb.cc
Scanning dependencies of target ngx_otel_module
[100%] Building C object CMakeFiles/ngx_otel_module.dir/src/modules.c.o
[100%] Building CXX object CMakeFiles/ngx_otel_module.dir/opentelemetry/proto/resource/v1/resource.pb.cc.o
[100%] Building CXX object CMakeFiles/ngx_otel_module.dir/src/http_module.cpp.o
[100%] Building CXX object CMakeFiles/ngx_otel_module.dir/opentelemetry/proto/common/v1/common.pb.cc.o
[100%] Building CXX object CMakeFiles/ngx_otel_module.dir/opentelemetry/proto/trace/v1/trace.pb.cc.o
[100%] Building CXX object CMakeFiles/ngx_otel_module.dir/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc.o
[100%] Building CXX object CMakeFiles/ngx_otel_module.dir/opentelemetry/proto/collector/trace/v1/trace_service.grpc.pb.cc.o
/home/linuxmint/vr-nginx-otel/nginx-otel/src/http_module.cpp: In function ‘ngx_int_t {anonymous}::setHeader(ngx_http_request_t*, StrView, StrView)’:
/home/linuxmint/vr-nginx-otel/nginx-otel/src/http_module.cpp:254:17: error: ‘struct ngx_table_elt_t’ has no member named ‘next’
254 | header->next = NULL;
| ^~~~
make[2]: *** [CMakeFiles/ngx_otel_module.dir/build.make:85: CMakeFiles/ngx_otel_module.dir/src/http_module.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1055: CMakeFiles/ngx_otel_module.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
To reproduce
Steps to reproduce the behavior:
#!/bin/bash
# Prepare files
mkdir ~/nginx-otel-github;
cd ~/nginx-otel-github;
git clone https://github.com/nginx/nginx.git
git clone https://github.com/nginxinc/nginx-otel.git && mkdir nginx-otel/build
# Compile
cd nginx && auto/configure --with-compat;
cd ../nginx-otel/build;
cmake -DNGX_OTEL_NGINX_BUILD_DIR=~/nginx-otel-github/nginx/objs ..;
make
Expected behavior
To have a binary named ngx_otel_module.so
Your environment
- https://github.com/nginxinc/nginx-otel/tree/main (as of 2023-09-17)
- https://github.com/nginx/nginx/tree/master (as of 2023-09-17)
Here is my distro used
$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20.3
DISTRIB_CODENAME=una
DISTRIB_DESCRIPTION="Linux Mint 20.3 Una"
$ uname -a
Linux linuxmint203 5.4.0-162-generic #179-Ubuntu SMP Mon Aug 14 08:51:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Here are the dependencies installed
$ sudo apt list cmake build-essential libssl-dev zlib1g-dev libpcre3-dev pkg-config libc-ares-dev libre2-dev
Listing... Done
build-essential/focal-updates,now 12.8ubuntu1.1 amd64 [installed]
build-essential/focal-updates 12.8ubuntu1.1 i386
cmake/focal-updates,now 3.16.3-1ubuntu1.20.04.1 amd64 [installed]
cmake/focal-updates 3.16.3-1ubuntu1.20.04.1 i386
libc-ares-dev/focal-updates,focal-security,now 1.15.0-1ubuntu0.3 amd64 [installed]
libc-ares-dev/focal-updates,focal-security 1.15.0-1ubuntu0.3 i386
libpcre3-dev/focal-updates,focal-security,now 2:8.39-12ubuntu0.1 amd64 [installed]
libpcre3-dev/focal-updates,focal-security 2:8.39-12ubuntu0.1 i386
libre2-dev/focal,now 20200101+dfsg-1build1 amd64 [installed]
libre2-dev/focal 20200101+dfsg-1build1 i386
libssl-dev/focal-updates,focal-security,now 1.1.1f-1ubuntu2.19 amd64 [installed]
libssl-dev/focal-updates,focal-security 1.1.1f-1ubuntu2.19 i386
pkg-config/focal,now 0.29.1-0ubuntu4 amd64 [installed]
pkg-config/focal 0.29.1-0ubuntu4 i386
zlib1g-dev/focal-updates,focal-security,now 1:1.2.11.dfsg-2ubuntu1.5 amd64 [installed]
zlib1g-dev/focal-updates,focal-security 1:1.2.11.dfsg-2ubuntu1.5 i386
Additional context
Just as a note, that I also tried specifically the nginx v1.20.1, but same error, at the same point happen too.
Thank you for reporting!
Looking at src/core/ngx_hash.h:99 ngx_table_elt_t
is supposed to have the member next
:
https://github.com/nginx/nginx/blob/b489ba83e9be446923facfe1a2fe392be3095d1f/src/core/ngx_hash.h#L99C28-L99C28
Also, I can't see the issue in my local env. Can you confirm next
is there in your Nginx code and there's no local changes.
make clean
/removing nginx/obj
and running cd nginx && auto/configure --with-compat
afterwards might also help.
Hi! Thanks for the fast reply.
I found out that it is not a bug, but my mistake:
I discovered that the problem was that I tried to compile using the (old) nginx-1.20.1 version first (which I am assuming it is not supported anymore, thus not a bug), then later I switched to main nginx to see if it works.
The problem appeared later, on the main version, as I switched the versions. Generically I made:
- Get Git repo from nginx-1.20.1 (
wget -O nginx-release-1.20.1.zip https://github.com/nginx/nginx/archive/refs/tags/release-1.20.1.zip;
) - Unzip and run
auto/configure --with-compat
- Then compile otel
- See the error.
- Get Git repo from main nginx
git clone https://github.com/nginx/nginx.git
- Run
auto/configure --with-compat
- Then compile otel
- See the same error
Thanks for the assistance, you can close this on my side.
Thank you for the details and confirmation that it is not an issue!
Closing this issue.