Failed to "Make" with Error

712 views
Skip to first unread message

jonathan maderer

unread,
Jul 8, 2022, 9:48:28 AM7/8/22
to mod-pagespeed-discuss
Greetings,

while i tried to install nginxpagespeed the latest version with the following parameter 

"--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,--as-needed' --add-module=/usr/local/src/ngx_cache_purge --add-module=/usr/local/src/nginx-rtmp-module --add-module=/usr/local/src/ngx_brotli --add-module=/usr/local/src/ngx_http_auth_pam_module"


Make is trowing me an error on the end that displays


/root/incubator-pagespeed-ngx-latest-stable/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 ‘->’ ?)
   if (r->headers_out.cache_control.elts == NULL) {
                                    ^~~~
/root/incubator-pagespeed-ngx-latest-stable/src/ngx_pagespeed.cc:408:35: error: cannot convert ‘ngx_table_elt_t**’ {aka ‘ngx_table_elt_s**’} to ‘ngx_array_t*’
     ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Never saw this before so i hope someone got an idea whats wrong with it.

Otto van der Schaaf

unread,
Jul 9, 2022, 5:27:10 AM7/9/22
to mod-pagesp...@googlegroups.com
See https://github.com/apache/incubator-pagespeed-ngx/issues/1749 for both the story around this, as well as the resolution

Otto

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/ff6e80a3-306e-4b43-aa54-63315959b9e5n%40googlegroups.com.

jonathan maderer

unread,
Jul 12, 2022, 5:07:29 PM7/12/22
to mod-pagespeed-discuss
Thank you Otto :) 

jonathan maderer

unread,
Sep 12, 2023, 5:56:17 AM9/12/23
to mod-pagespeed-discuss
One Year later, i'm still not able to understand the source of the bug or upgrade my nginx with pagespeed

I still get


cc:407:36: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’,


I read over and over your linked ressource but 
1) Do not understand the source of the Error
2) Do not understand how to get arround with it

I tried several ways like

Building from Source
https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source

Building automaticly and replace the PSOL with jammy
https://github.com/apache/incubator-pagespeed-ngx/issues/1743#issuecomment-1094110008



I get complete crazy about this.. i mean one year and still no idea how to fix it i'm complete stuck.

shanem...@googlemail.com

unread,
Sep 12, 2023, 6:13:38 AM9/12/23
to mod-pagespeed-discuss
Sorry to say but there is no development happening with this, at all. The error is caused because after Nginx 1.23+ they changed some of the headers and while the fix does work, unless you are using a specific PSOL, Nginx will not compile. I have attached my build script that I found and currently used to build in production - it uses the final usable version of the PSOL before they switched to Bazel. Update the .configure line to your needs and this should get you going. 

Eventually the build script I give will break too and when that happens you'll/I/we need a completely new alternative. I have been looking into things like this: https://requestmetrics.com/web-performance/nginx-image-optimization/ to recover some of the functionality NGX provides, when the time comes. I have also tried to brush up on my programming skills and try to develop a version of this that can be built under Bazel but it's too complicated and unwieldy for me. No one else seems to want to maintain it either.
pagespeed_build.sh

jonathan maderer

unread,
Sep 12, 2023, 7:22:28 AM9/12/23
to mod-pagespeed-discuss
Thank you for your script that is awesome, sorry that i ask again to understand it correctly. 


" while the fix does work, unless you are using a specific PSOL, Nginx will not compile"

so they are not maintaining pagespeed nginx anymore for newer versions? Did i understand that right?  I tought it is a issue with my system or something 

shanem...@googlemail.com

unread,
Sep 12, 2023, 7:32:00 AM9/12/23
to mod-pagespeed-discuss
I'll be super clear, for all intents and purposes, mod/ngx pagespeed is dead. My understanding is that unless the Otto or one of the other creators does something or someone is brave (and skilled) enough to fork the project and take the whole thing forward, there will be no new versions. The code is of course publicly available for use but there is been no focus on Nginx in years and a lot of the core (pagespeed Kernel) contains dependant code that is years out of date. 

I have been an avid follower of ngx_pagespeed for a long time but yes it's time has come and really I'd recommend looking for alternative solutions.

jonathan maderer

unread,
Sep 12, 2023, 8:54:28 AM9/12/23
to mod-pagespeed-discuss
Sad to hear that, but thanks for the information, that saves me a lot of time to figure out why it doesn't work.

Thank you,

Rick Gutierrez

unread,
Sep 12, 2023, 10:02:30 AM9/12/23
to mod-pagesp...@googlegroups.com
El mar, 12 sept 2023 a las 6:13, 'shanem...@googlemail.com' via
mod-pagespeed-discuss (<mod-pagesp...@googlegroups.com>)
escribió:
>
> Sorry to say but there is no development happening with this, at all. The error is caused because after Nginx 1.23+ they changed some of the headers and while the fix does work, unless you are using a specific PSOL, Nginx will not compile. I have attached my build script that I found and currently used to build in production - it uses the final usable version of the PSOL before they switched to Bazel. Update the .configure line to your needs and this should get you going.
>
> Eventually the build script I give will break too and when that happens you'll/I/we need a completely new alternative. I have been looking into things like this: https://requestmetrics.com/web-performance/nginx-image-optimization/ to recover some of the functionality NGX provides, when the time comes. I have also tried to brush up on my programming skills and try to develop a version of this that can be built under Bazel but it's too complicated and unwieldy for me. No one else seems to want to maintain it either.
> On Tuesday, 12 September 2023 at 10:56:17 UTC+1 maderer....@googlemail.com wrote:
>>

Hi Shanem , I am also a fan of pagespeed and in these latest versions
1.24 of nginx it does not compile and gives an error, Have you tried
version 1.4? , here I found a thread from someone who made it work,
maybe it works with your patch.

https://github.com/karljohns0n/nginx-more/issues/40#issuecomment-1708456985

--
rickygm

http://gnuforever.homelinux.com

shanem...@googlemail.com

unread,
Sep 12, 2023, 10:35:06 AM9/12/23
to mod-pagespeed-discuss
Hiya, 

I hadn't actually tried Nginx 1.24 but I just gave it a go and using the script earlier in the thread (attached again for reference), I was able to get it to build under Nginx 1.24.0.. see screenshot:

A couple of notes:
The script for some reason didn't download Nginx by itself, I downloaded 1.24 manually from the Nginx website, extracted the .tar.gz it and ran the ./configure arguments manually. Once the configure finished then ran "make" followed by "make install".

Screenshot from 2023-09-12 15-28-09.png
pagespeed_build.sh

Rick Gutierrez

unread,
Sep 12, 2023, 6:40:36 PM9/12/23
to mod-pagesp...@googlegroups.com
El mar, 12 sept 2023 a las 10:35, 'shanem...@googlemail.com' via mod-pagespeed-discuss (<mod-pagesp...@googlegroups.com>) escribió:
Hiya, 

I hadn't actually tried Nginx 1.24 but I just gave it a go and using the script earlier in the thread (attached again for reference), I was able to get it to build under Nginx 1.24.0.. see screenshot:

A couple of notes:
The script for some reason didn't download Nginx by itself, I downloaded 1.24 manually from the Nginx website, extracted the .tar.gz it and ran the ./configure arguments manually. Once the configure finished then ran "make" followed by "make install".

Screenshot from 2023-09-12 15-28-09.png

 

Thnk  for your quick response, I am trying to do it on Debian 11 with nginx 1.24 and it does not recognize the psol directory

adding module in /rpm/incubator-pagespeed-ngx

You have set --with-debug for building nginx, but precompiled Debug binaries for
PSOL, which ngx_pagespeed depends on, aren't available.  If you're trying to
debug PSOL you need to build it from source.  If you just want to run nginx with
debug-level logging you can use the Release binaries.

Use the available Release binaries? [Y/n] Y
./configure: 164: /rpm/incubator-pagespeed-ngx/config: [[: not found
./configure: 164: /rpm/incubator-pagespeed-ngx/config: Y: not found
mod_pagespeed_dir=/rpm/incubator-pagespeed-ngx/psol/include
build_from_source=false
checking for psol ... not found
./configure: error: module ngx_pagespeed requires the pagespeed optimization library.
Look in /rpm/nginx-1.24.0/objs/autoconf.err for more details.
 
cd /rpm

ls -ls incubator-pagespeed-ngx
total 76
16 -rw-r--r-- 1 root root 13676 Sep 12 16:35 config
 4 -rw-r--r-- 1 root root  1183 Sep 12 16:35 config.make
 4 -rw-r--r-- 1 root root  2881 Sep 12 16:35 cpp_feature
 4 drwxr-xr-x 4 root root  4096 Sep 12 16:35 docker
12 -rw-r--r-- 1 root root 11342 Sep 12 16:35 LICENSE
 4 -rw-r--r-- 1 root root   488 Sep 12 16:35 NOTICE
 4 drwxr-xr-x 4 root root  4096 Dec 29  2021 psol
 4 -rw-r--r-- 1 root root   265 Sep 12 16:35 PSOL_BINARY_URL
 4 -rw-r--r-- 1 root root  1610 Sep 12 16:35 README.md
 4 -rw-r--r-- 1 root root   101 Sep 12 16:35 RETIRED.txt
 4 drwxr-xr-x 2 root root  4096 Sep 12 16:35 scripts
 4 drwxr-xr-x 2 root root  4096 Sep 12 16:35 src
 4 drwxr-xr-x 2 root root  4096 Sep 12 16:35 test
 4 drwxr-xr-x 8 root root  4096 Sep 12 16:35 testing-dependencies

any ideas?

--

shanem...@googlemail.com

unread,
Sep 13, 2023, 4:09:29 AM9/13/23
to mod-pagespeed-discuss
The answer to the problem will be in the log file: /rpm/nginx-1.24.0/objs/autoconf.err

The error "error: module ngx_pagespeed requires the pagespeed optimization library.", usually throws if the PSOL is not complete (files missing) or pagespeed_automatic.a static library is not correct. 

Otto van der Schaaf

unread,
Sep 13, 2023, 4:59:05 AM9/13/23
to mod-pagespeed-discuss
re: unless the Otto or one of the other creators does something or someone is brave (and skilled) enough to fork the project and take the whole thing forward

I forked mod_pagespeed out to https://github.com/We-Amp/mod_pagespeed.
But as of today I'm only committed to keeping the main (bazelified/modernized) branch of mod_pagespeed alive and update to date over there, and nothing more.
This branch is able to produce mod_pagespeed.so as well as the required pagespeed library for ngx_pagespeed, but ngx_pagespeed needs work to be able to build against that (mostly because of some of the header locations having changed).

Otto

shanem...@googlemail.com

unread,
Sep 13, 2023, 5:13:38 AM9/13/23
to mod-pagespeed-discuss
This is fabulous news! Thank you :)

I really struggled with ngx... It's not just the headers but due to the build process a lot of the dependencies were missing too. Almost everything in psol/include & psol/lib is in the wrong places or missing. Also, ngx is built on C++ 12 but some of the newer dependencies wouldn't compile unless under 14+ - that means a lot of syntax changes and deprecations  to unravel. After that I gave up. Bazel and Ngx together did not appear to be a quick job - at least not with my skillset!

Reply all
Reply to author
Forward
0 new messages