varnish failed to restart for VCC compiler error: expected of 'acl', 'sub', 'backend',

varnish failed to restart for VCC compiler error: expected of 'acl', 'sub', 'backend',

October 2, 2026 · Illustrated author avatarBy Stefan Bogdanescu
varnish failed to restart for VCC compiler error: expected of 'acl', 'sub', 'backend',

Troubleshooting Varnish Failed Start on Amazon Linux

Introduction

Varnish is a popular open-source web accelerator that can significantly improve the performance of your web server by caching frequently accessed content. However, you might encounter issues when trying to start Varnish after installing it on an Amazon Linux instance.

Understanding the Error Message

When you try to start the Varnish service using service varnish start, you receive a failure message:

[root@ip-172-31-10-xxx sysconfig]# service varnish start
Starting Varnish Cache:                                    [FAILED]

This indicates that there is an issue preventing Varnish from starting successfully.

Debugging the VCL Configuration

To debug further, let’s run varnishd with debugging options and the default VCL configuration file:

[root@ip-172-31-10-xxx sysconfig]# varnishd -d -f /etc/sysconfig/varnish

This command will provide detailed information about any errors in your Varnish configuration. In the provided error log, we can see that there is a syntax issue with the NFILES line:

Message from VCC-compiler:
Expected one of
        'acl', 'sub', 'backend', 'director', 'probe',  or 'import'
Found: 'NFILES' at
('input' Line 8 Pos 1)
NFILES=131072
######-------

Running VCC-compiler failed, exit 1

VCL compilation failed

Analyzing the Varnish Configuration File

The full Varnish configuration file is quite extensive. It contains four alternatives for configuring Varnish. However, we can see that there are two main issues contributing to this error:

  1. The NFILES line appears in the comments of Alternative 3, which seems to be the active configuration.
# Maximum number of open files (for ulimit -n)
NFILES=131072

In Varnish version 4 and above, this line is no longer needed as it’s handled by systemd. The presence of NFILES in the active configuration is causing a syntax error.

  1. There are several contradictory configurations for DAEMON_OPTS, which might be causing confusion when starting the service.

Resolving the Issue

To fix this issue, we need to make the following changes:

  1. Remove or comment out the line containing NFILES from Alternative 3 in the Varnish configuration file.

  2. Ensure that there is only one active set of DAEMON_OPTS. You can either use an appropriate pre-configured alternative or define a single, unified set of options.

Conclusion

In this post, we’ve identified and resolved a common issue where Varnish fails to start due to syntax errors in the configuration file. By understanding how Varnish handles its configuration and removing unnecessary lines from the active section, you can successfully start your Varnish service after installation.

Remember that proper configuration is key to leveraging Varnish’s performance benefits. Always ensure that your VCL files are properly written and that all necessary options are defined in a single, consistent manner.

For more detailed guides on configuring Varnish for optimal performance, consider visiting LaravelCompany’s blog where we regularly share best practices and in-depth tutorials.

Cache Performance API Admin

Our network