Forum Discussion

yasserMalah's avatar
yasserMalah
Icon for Nimbostratus rankNimbostratus
Jul 16, 2025

getting compiling error when enabling Nginx App_potect

i m trying to install NGinx plus with App_ptotect but when trying to enable app_protect module after installing it i get the following error

 

nginx: [emerg] APP_PROTECT config_set_id 1752649466-871-149162 not found within 45 seconds
nginx: [emerg] APP_PROTECT fstat() "/opt/app_protect/config/compile_error_msg.json" failed (2: No such file or directory)

 

and i can not start the nginx service, any idea about the issue?

 

5 Replies

  • This error usually means the NGINX App Protect compiler service is either not running or lacks the permissions to write its configuration files.

    Quick Fix Steps

    1. Restart the Services: Ensure the background agents are active. Run:
    2. sudo systemctl restart nginx-appprotect enforcerd
    3. Fix Permissions: The error compile_error_msg.json failed suggests a lock on the directory. Run:
    4. sudo chown -R nginx:nginx /opt/app_protect/
    5. Check Memory: App Protect needs at least 4GB of RAM to compile. If your VPS is low on memory, it will timeout at the 45-second mark.
    6. SELinux: If using RHEL/CentOS, temporarily run setenforce 0 to see if a security policy is blocking the fstat() call.
       i hope this will help you to fix this issue!
    • yasserMalah's avatar
      yasserMalah
      Icon for Nimbostratus rankNimbostratus

      Hi 

      thanks for your reply but i am sure it is installed here is the output query for the isntalled packages 

       

      apt list --installed | grep -E 'nginx-plus|app-protect'

      WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

      app-protect-attack-signatures/stable,now 2025.07.10-1~focal amd64 [installed]
      app-protect-bot-signatures/stable,now 2025.07.09-1~focal amd64 [installed,automatic]
      app-protect-common/now 11.336.0-1~focal amd64 [installed,local]
      app-protect-compiler/now 11.336.0-1~focal amd64 [installed,local]
      app-protect-geoip/stable,now 2023.10.30-1~focal amd64 [installed,auto-removable]
      app-protect-graphql/now 0.7.0-1~focal amd64 [installed,local]
      app-protect-module-plus/stable,now 34+5.342.0-1~focal amd64 [installed]
      app-protect-plugin/stable,now 6.12.0-1~focal amd64 [installed]
      app-protect-threat-campaigns/stable,now 2025.07.13-1~focal amd64 [installed,automatic]
      nginx-plus-module-appprotect/stable,now 34+5.342.0-1~focal amd64 [installed,automatic]
      nginx-plus/stable,now 34-2~focal amd64 [installed]

      • developer's avatar
        developer
        Icon for Nimbostratus rankNimbostratus

        Nginx team: See this bug for why the users are searching for compiler issues when evaluating NAP.

        https://github.com/nginx/documentation/issues/1516 and consider instead providing the new steps to ensure policies are added to the steps shown in the WAF installation guide. The link provided to the original poster doesn't appear to be a "troubleshooting guide" for WAF, but the knowledge base AI results will return this thread as one of only 2 top results for the specific NAP error message during nginx config testing or execution with NAP. 😀

        If the file .../compile_error_msg.json isn't present or readable, because of permissions and/or some NAP subprocess had silently failed (compilation? nothing shown even with -vvv)) during config evaluation (e.g. load module .., app_protect on; app_protect policy...) or even NAP installation, then touching that file into existence and changing the owner to nginx:nginx (or the running nginx user:group) successfully bypasses that error. 

        NGINX config files will still fail to successfully test even if the installation guide is followed and file exists, because nginx is receiving numeric exit status codes, instead of the JSON NAP subprocess wants to see to evaluate and successfully enable it is my best guess. I will also file this bug and reference these posts.