Bad Config Files

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Symptom

The Edge Router is implemented by using NGINX. During the Edge upgrade process, or when changing the configuration of the Router, you might see NGINX configuration errors. When these errors occur, Edge marks all the NGINX configuration files that caused the issue to /opt/nginx/conf.d:

-rw-r--r-- 1 apigee apigee 522 Jul 20 08:41 0-default.conf.bad 
-rw-r--r-- 1 apigee apigee 577 Jul 20 08:42 0-fallback.conf 
-rw-r--r-- 1 apigee apigee 1062 Jul 20 08:18 0-map.conf 
-rw-r--r-- 1 apigee apigee 1887 Jul 20 08:42 custorg_test_default.conf.bad

Error Messages

You will not see any error messages. However, you might not be able to execute your API proxies because of the bad config files.

Possible Causes

Typically the NGINX config files are marked bad either because incorrect value(s) are set to NGINX property(ies) in the /opt/apigee/customer/application/router.properties file or incorrect changes are made to a virtual host.

Diagnosis

  1. Remove the .bad suffix from the file names in the /opt/nginx/conf.d directory so they end in .conf.
  1. Run the NGINX configtest tool to determine the reason for the failure:
    /opt/nginx/scripts/apigee-nginx configtest

Resolution

  1. If the config test identifies the reason for the bad config files, then fix the issue by making the appropriate changes to the specific property in the /opt/apigee/customer/application/router.properties file or virtual host.
  1. Remove the /opt/nginx/conf.d directory:
    rm -rf /opt/nginx/conf.d
  1. Restart the Router:
    /opt/apigee/apigee-service/bin/apigee-service edge-router restart
  1. You should no longer see bad config files in the /opt/nginx/conf.d directory.

If the problem persists, contact Apigee Edge Support.

Here’s an example that shows how to fix the problem based on the information provided by the NGINX config test.

Example 1: Incorrect Value set for a NGINX property

  1. Let’s say you updated the property “proxy_busy_buffers_size” to 128K in the /opt/apigee/customer/application/router.properties file, as shown below:
    conf_load_balancing_load.balancing.driver.proxy.busy.buffer.size=128k 

This caused the config files to be marked as bad in /opt/apigee/nginx/conf.d directory.

  1. Run the NGINX configtest command to determine the reason for failure:
    /opt/nginx/scripts/apigee-nginx configtest
    nginx: [emerg] "proxy_busy_buffers_size" must be equal to or greater than the maximum of the value of "proxy_buffer_size" and one of the "proxy_buffers" in /opt/nginx/conf/nginx.conf:47
    nginx: configuration file /opt/nginx/conf/nginx.conf test failed

The configtest results indicates that the value for the property proxy_busy_buffers_size should be equal to or greater than proxy_buffer_size, but seems to be set with an incorrect value.

  1. Check the values set for the properties proxy_buffer_size and proxy_busy_buffers_size in the 0-default.conf file:
    proxy_buffer_size 512k;
    proxy_busy_buffers_size 128k;
  1. Update the value of proxy_busy_buffers_size to 512K in the /opt/apigee/customer/application/router.properties file:
    conf_load_balancing_load.balancing.driver.proxy.busy.buffer.size=512k
  1. Remove the /opt/nginx/conf.d folder:
    rm -rf /opt/nginx/conf.d
  1. Restart the router:
    /opt/apigee/apigee-service/bin/apigee-service edge-router restart

The issue was fixed and the bad config files were removed.

Example 2: The process fails to upgrade NGINX (Private Cloud 18.01 only)

Let's say you run configtest and get back the following responses:

/apigee-nginx configtest

 nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
 nginx: [emerg] zero size shared memory zone "perclient"
 nginx: configuration file /opt/nginx/conf/nginx.conf test failed

This failure indicates that the process failed to upgrade NGINX from 1.10.x to 1.12.x. There is a known bug related to upgrading Edge Private Cloud to version 18.01.

To properly diagnose this problem (only if you are on Private Cloud 18.01), do the following:

rpm -aq | grep apigee-nginx

This command should return the installed rpm as version 1.12.x. If it does not, follow these steps:

  1. Stop the edge-router component.
  2. Backup the edge-router component.
  3. Run this command to upgrade to apigee-nginx 1.2.x:
  4. sudo yum update apigee-nginx
  5. Delete all *.bad files under /opt/apigee/nginx/conf.d.
  6. Restart the edge-router component.