Mod Buils Configure Error

88 views
Skip to first unread message

Fred White (freddie9115)

unread,
May 27, 2023, 12:30:41 AM5/27/23
to mod-pagespeed-discuss
Hello Guys, I am no expert in this error of the mod-pagespeed. However, I have it running on Ubuntu Nginx. Eevery time there is an upgrade to Nginx version I have to recompile the mod. For the first time I am getting the following error and  I have search web for a a fix, and I am coming empty. Any help would be welcom.

Thanks.
"speed-ngx/psol/include/url -I objs -I src/http -I src/http/modules \
-o objs/addon/src/ngx_pagespeed.o \
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc: In function ‘ngx_int_t net_instaweb::{anonymous}::ps_set_cache_control(ngx_http_request_t*, char*)’:
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:407:36: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
  407 |   if (r->headers_out.cache_control.elts == NULL) {
      |                                    ^~~~
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:408:35: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
  408 |     ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   ngx_table_elt_t** {aka ngx_table_elt_s**}
In file included from src/core/ngx_core.h:65,
                 from src/http/ngx_http.h:13,
                 from /usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.h:33,
                 from /usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:32:29: note:   initializing argument 1 of ‘ngx_int_t ngx_array_init(ngx_array_t*, ngx_pool_t*, ngx_uint_t, size_t)’
   32 | ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
      |                ~~~~~~~~~~~~~^~~~~
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:415:22: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
  415 |       ngx_array_push(&r->headers_out.cache_control));
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      |
      |                      ngx_table_elt_t** {aka ngx_table_elt_s**}
In file included from src/core/ngx_core.h:65,
                 from src/http/ngx_http.h:13,
                 from /usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.h:33,
                 from /usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:26:
src/core/ngx_array.h:27:35: note:   initializing argument 1 of ‘void* ngx_array_push(ngx_array_t*)’
   27 | void *ngx_array_push(ngx_array_t *a);
      |                      ~~~~~~~~~~~~~^
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc: In function ‘bool net_instaweb::{anonymous}::ps_get_cache_control(ngx_http_request_t*, GoogleString*)’:
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:439:74: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
  439 |   auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
      |                                                                          ^~~~
/usr/local/src/nginx/incubator-pagespeed-ngx/src/ngx_pagespeed.cc:444:59: error: request for member ‘nelts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
  444 |   for (ngx_uint_t i = 0; i < r->headers_out.cache_control.nelts; i++) {
      |                                                           ^~~~~
make[1]: *** [objs/Makefile:1342: objs/addon/src/ngx_pagespeed.o] Error 1
make[1]: Leaving directory '/usr/local/src/nginx/nginx-1.24.0'
make: *** [Makefile:16: modules] Error 2

Василий Кищенко

unread,
May 27, 2023, 9:15:38 AM5/27/23
to mod-pagespeed-discuss
The problem occurs because in your version of NGINX, the ngx_http_headers_out_t structure contains fields that are pointers to ngx_table_elt_t, while the ngx_pagespeed module code tries to access these fields directly.

To solve this problem, you need to use a compatible version of the ngx_pagespeed module

суббота, 27 мая 2023 г. в 07:30:41 UTC+3, Fred White (freddie9115):

Fred White (freddie9115)

unread,
May 27, 2023, 10:22:52 AM5/27/23
to mod-pagespeed-discuss
Thank for this response. But I am not sure what to do here. I have being able to compile the mod on the previous versions on Ubuntu-nginx on still yesterday when I ran the update and upgrade and nginx upgraded to version 1.24.0. That means, Nginx vs 1.24.0 . # nginx -V
nginx version: nginx/1.24.0
built with OpenSSL 1.1.1f  31 Mar 2020
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-JOXHr0/nginx-1.24.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module
 
I know that I should add the above but I am not sure how to do that. I will continue reading.

Thanks

Longinos

unread,
Jun 8, 2023, 8:34:39 AM6/8/23
to mod-pagespeed-discuss
Is a know bug, You need to modify the ngx_pagespeed code as stated here
Reply all
Reply to author
Forward
0 new messages