Welcome to Centmin Mod Community
Become a Member

[Solved] Nginx_brotli error

Discussion in 'AlmaLinux 8 & Rocky Linux 8 Beta Testing' started by hson4787, Dec 4, 2022.

  1. hson4787

    hson4787 New Member

    13
    1
    3
    Sep 18, 2020
    Ratings:
    +3
    Local Time:
    10:43 AM
    1.19.2
    10.4.14
    The following test environment information is needed relevant to your EL8 server installation. Please provide the info in BBCODE CODE/CODEB tags for better formatting.

    1. Your web host and VPS/dedicated server plan?
    2. Centmin Mod installed version info via command below:
    Code (Text):
    Centmin Mod Quick Info:
    ------------------------------------------------------------------
    Server Location Info
      city: Seattle
      region: Washington
      country: US
      org: 40021 CONTABO
      timezone America/Los_Angeles
    
    Processors physical = 1, cores = 4, virtual = 4, hyperthreading = no
    
          4  2794.748
          4  AMD EPYC 7282 16-Core Processor
          4  512 KB
    
     System Up Since:       2022-12-02 08:18:54
     System Uptime:         up 1 day, 10 hours, 11 minutes
     MySQL Server Started   2022-12-02 18:08:42
     MySQL Uptime:          1 day 21 min 39 sec
     MySQL Uptime (secs):   87699
     Server Type:           kvm
     CentOS Version:        8.7
     Centmin Mod:           130.00beta01.b251
     Nginx PageSpeed:       OFF
     Nginx Version:         1.23.2 (021222-175420-almalinux8-kvm-fe084fb)
     PHP-FPM Version:       8.0.26
     MariaDB Version:       utils
     CSF Firewall:          v14.17
     Memcached Server:      1.6.17
     NSD Version:            -
     Siege Version:         4.1.5
     Maldet Version:        not installed
     ClamAV Version:        not installed
     ElasticSearch:         not installed
    

    Got this error when trying install Nginx_brotli
    Code:
     -o objs/addon/static/ngx_http_brotli_static_module.o \
            ../ngx_brotli/static/ngx_http_brotli_static_module.c
    ../ngx_brotli/deps/brotli/c/enc/encode.c:1473:20: error: argument 5 of type ‘const uint8_t *’ {aka ‘const unsigned char *’} declared as a pointer [-Werror=vla-parameter]
     1473 |     const uint8_t* input_buffer, size_t* encoded_size,
          |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~
    In file included from ../ngx_brotli/deps/brotli/c/enc/encode.c:9:
    /usr/local/nginx-dep/include/brotli/encode.h:314:19: note: previously declared as a variable length array ‘const uint8_t[*encoded_size]’ {aka ‘const unsigned char[*encoded_size]’}
      314 |     const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
          |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../ngx_brotli/deps/brotli/c/enc/encode.c:1474:14: error: argument 7 of type ‘uint8_t *’ {aka ‘unsigned char *’} declared as a pointer [-Werror=vla-parameter]
     1474 |     uint8_t* encoded_buffer) {
          |     ~~~~~~~~~^~~~~~~~~~~~~~
    In file included from ../ngx_brotli/deps/brotli/c/enc/encode.c:9:
    /usr/local/nginx-dep/include/brotli/encode.h:316:13: note: previously declared as a variable length array ‘uint8_t[input_size]’ {aka ‘unsigned char[input_size]’}
      316 |     uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]);
          |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[1]: *** [objs/Makefile:2019: objs/addon/enc/encode.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/svr-setup/nginx-1.23.1'
    make: *** [Makefile:10: build] Error 2
    


     
  2. eva2000

    eva2000 Administrator Staff Member

    54,945
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    1:43 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    how did you install nginx_brotli nginx module? did you use these 2 variables in persistent config file at /etc/centminmod/custom_config.inc ?
    Code (Text):
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    

    what's contents of your persistent config file at /etc/centminmod/custom_config.inc - mask any sensitive info first

    I tried on Almalinux 8 and seems to be working
     
  3. cloud9

    cloud9 Premium Member Premium Member

    435
    118
    43
    Oct 6, 2015
    England
    Ratings:
    +218
    Local Time:
    3:43 AM
    1.25.3
    10.6.x
    Yep, works for me as well
     
  4. hson4787

    hson4787 New Member

    13
    1
    3
    Sep 18, 2020
    Ratings:
    +3
    Local Time:
    10:43 AM
    1.19.2
    10.4.14
    Code (Text):
    LETSENCRYPT_DETECT='y'
    CENTOS_ALPHATEST='y'
    NGINX_VERSION='1.23.2'
    NGINX_ONETWOTHREE_COMPAT='y'
    DEVTOOLSETTEN='n'
    DEVTOOLSETELEVEN='y'
    SELFSIGNEDSSL_ECDSA='y'
    PHPFINFO='y'
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    NGINX_BROTLIDEP_UPDATE='y'
    NGXDYNAMIC_NGXPAGESPEED='n'
    NGINX_PAGESPEED='n'
    ENABLE_MARIADBTENFIVEUPGRADE='y'
    NGINX_IOURING_PATCH='y'
    KEYLENGTH='ec-256'
    PHP_LIBZIP='y'
    PHP_ARGON='y'
    PHP_BROTLI='y'
    PHP_LZFOUR='y'
    PHP_LZF='y'
    PHP_ZSTD='y'
    ACMEDEBUG='y'
    DEVTOOLSET_PHP='y'
    PHPFINFO='y'
    MARCH_TARGETNATIVE='n'
    

    weird, i tried again but still got the same error
     
  5. hson4787

    hson4787 New Member

    13
    1
    3
    Sep 18, 2020
    Ratings:
    +3
    Local Time:
    10:43 AM
    1.19.2
    10.4.14
    Ok, delete this and it works
    Code (Text):
    NGINX_BROTLIDEP_UPDATE='y'
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,945
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    1:43 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    OK thanks will check that out
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,945
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    1:43 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Just tried this on CentOS 7 and it works. Then tried on AlmaLinux 8 and it breaks! I think it might be due to using GCC 11 compiler versus GCC 10 on CentOS 7 for -Werror=vla-parameter marked warnings being treated as errors which previous GCC versions didn't do
    Code (Text):
    ../ngx_brotli/deps/brotli/c/enc/encode.c:1473:20: error: argument 5 of type ‘const uint8_t *’ {aka ‘const unsigned char *’} declared as a pointer [-Werror=vla-parameter]
     1473 |     const uint8_t* input_buffer, size_t* encoded_size,
          |     ~~~~~~~~~~~~~~~^~~~~~~~~~~~
    In file included from ../ngx_brotli/deps/brotli/c/enc/encode.c:9:
    /usr/local/nginx-dep/include/brotli/encode.h:314:19: note: previously declared as a variable length array ‘const uint8_t[input_size]’ {aka ‘const unsigned char[input_size]’}
      314 |     const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
          |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../ngx_brotli/deps/brotli/c/enc/encode.c:1474:14: error: argument 7 of type ‘uint8_t *’ {aka ‘unsigned char *’} declared as a pointer [-Werror=vla-parameter]
     1474 |     uint8_t* encoded_buffer) {
          |     ~~~~~~~~~^~~~~~~~~~~~~~
    /usr/local/nginx-dep/include/brotli/encode.h:316:13: note: previously declared as a variable length array ‘uint8_t[*encoded_size]’ {aka ‘unsigned char[*encoded_size]’}
      316 |     uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]);
          |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[1]: *** [objs/Makefile:2019: objs/addon/enc/encode.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/svr-setup/nginx-1.23.2'
    make: *** [Makefile:10: build] Error 2
    



    @hson4787In future if you run centmin.sh menu option 4 and recompile nginx version = 1.23.2 with the following set in persistent config file at /etc/centminmod/custom_config.inc
    Code (Text):
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    NGINX_BROTLIDEP_UPDATE='y'
    

    If it breaks again for whatever reason, to troubleshoot, you need to check the full nginx upgrade log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the nginx_upgrade.log log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    also what's output of
    Code (Text):
    nginx -t

    when you run centmin.sh menu option 4 there's a nginx upgrade log timestamped at /root/centminlogs

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest nginx_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | grep nginx_upgrade
    -rw-r--r--  1 root root 3.2M Oct 11 15:55 centminmod_1.2.3-eva2000.09.001_111016-155345_nginx_upgrade.log
    -rw-r--r--  1 root root 672K Oct 11 22:06 centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    So the last nginx upgrade log was named centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    then use cat command to output the contents of that log

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of one specific log, in this case most recent nginx_upgrade.log log

    Sharing Logs Via Dropbox



    You can also share the relevant required log files outlined above via Dropbox send via email feature at https://community.centminmod.com/threads/using-dropbox-to-share-server-files.22327/
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,945
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    1:43 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Confirmed as much working on a fix for this for AlmaLinux 8/EL8+ with GCC 11 and GCC 12 compiled Nginx with nginx_brotli module using persistent config file at /etc/centminmod/custom_config.inc
    Code (Text):
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    NGINX_BROTLIDEP_UPDATE='y'

    Nginx 1.23.2 with GCC 11 on AlmaLinux 8 where br-6e975bc is the Brotli last commit for nginx_brotli
    Nginx 1.23.2 with GCC 12 on AlmaLinux 8
    The fix hasn't been committed to 130.00beta01 yet so for now don't use
    NGINX_BROTLIDEP_UPDATE='y' as it doesn't do much as both nginx_brotli used brotli version 1.0.9 is same as Google Brotli upstream 1.0.9 so there shouldn't be any difference that would require using NGINX_BROTLIDEP_UPDATE='y'
     
  9. hson4787

    hson4787 New Member

    13
    1
    3
    Sep 18, 2020
    Ratings:
    +3
    Local Time:
    10:43 AM
    1.19.2
    10.4.14