geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.37k stars 646 forks source link

Varnish 6.1 startup fails with 'VCL compilation failed' #1851

Closed geerlingguy closed 6 years ago

geerlingguy commented 6 years ago

Issue Type

Full console output

RUNNING HANDLER [geerlingguy.varnish : restart varnish] ************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": " * Stopping HTTP accelerator varnishd\n   ...fail!\n * Starting HTTP accelerator varnishd\n   ...fail!\nMessage from VCC-compiler:\nExpected one of\n\t'acl', 'sub', 'backend', 'director', 'probe',  or 'import'\nFound: 'vcl' at\n('input' Line 1 Pos 1)\nvcl 4.0;\n###-----\n\nRunning VCC-compiler failed, exit 1\n\nVCL compilation failed\n"}

Summary

I just updated the Varnish role to default to the latest version of Varnish, 6.1; and now the ubuntu1404 test build is failing with the above message.

We probably need to make a few small changes to the Drupal VM VCL; see guide: https://varnish-cache.org/docs/6.0/whats-new/upgrading-6.0.html#vcl-4-0-and-4-1

geerlingguy commented 6 years ago

I'm planning on booting an instance locally, and using varnishd -C -f /etc/default/varnish.vcl to verify syntax changes. Hopefully it's just one directive or something that's changed slightly. Hopefully not as bad as the 2.x -> 4.x transition was!

geerlingguy commented 6 years ago

Hmm... under Ubuntu 16.04 nothing fails.

geerlingguy commented 6 years ago

I'm just going to drop 14.04 from CI testing, since it's going to be more and more a pain. Varnish 6.x already doesn't support 14.04 at all, and some other packages are likely dropping support soon too. It EOLs in a few months, and I'll slowly sunset support for it here and in all my roles as it's usually the sole thorn in my side, being the only OS not using systemd anymore. Well, with the exception of CentOS 6. But we don't talk about CentOS 6.

JasonWeakley commented 5 years ago

Well, I need you to talk about CentOS 6, I am trying to emulate our AWS server environment on a local VM...

I am getting the following error when trying to vagrant up

TASK [geerlingguy.varnish : Ensure Varnish services are started and enabled on startup.] *** failed: [mdo4] (item=varnish) => {"changed": false, "item": "varnish", "msg": "Starting varnish HTTP accelerator: [FAILED]\r\n"}

geerlingguy commented 5 years ago

@JasonWeakley - I would suggest logging into the VM and looking at any Varnish logs inside /var/log; I would hope there are details in there.

geerlingguy commented 5 years ago

Also if you find any errors there, please feel free to open an issue against the Varnish role repository (or if it's definitely related to Drupal VM's configuration, in this repo).

JasonWeakley commented 5 years ago

I do not see a log specifically for Varnish:

[06:39 PM]-[vagrant@mdo1]-[/var/log]
$ sudo ls -la httpd
total 180
drwx------. 2 root root   4096 Oct 29 15:17 .
drwxr-xr-x. 8 root root   4096 Oct 29 20:07 ..
-rw-r--r--. 1 root root      0 Oct 29 15:17 default_vhost_443_access_ssl.log
-rw-r--r--. 1 root root   2401 Oct 29 21:03 default_vhost_443_error_ssl.log
-rw-r--r--. 1 root root 163335 Oct 30 18:34 default_vhost_80_access.log
-rw-r--r--. 1 root root      0 Oct 29 15:17 default_vhost_80_error.log
-rw-r--r--. 1 root root   2470 Oct 29 21:03 error_log
-rw-r--r--. 1 root root      0 Oct 29 15:17 vhost1_access.log
-rw-r--r--. 1 root root      0 Oct 29 15:17 vhost1_error.log

and when I do a grep search for "varnish" I get nothing:

[06:48 PM]-[vagrant@mdo1]-[/var/log]
$ grep -r "varnish" .
grep: ./yum.log: Permission denied
grep: ./puppetlabs/pxp-agent: Permission denied
grep: ./puppetlabs/mcollective: Permission denied
grep: ./puppetlabs/puppet: Permission denied
grep: ./cron: Permission denied
grep: ./maillog: Permission denied
grep: ./audit: Permission denied
grep: ./tallylog: Permission denied
grep: ./btmp: Permission denied
grep: ./secure: Permission denied
grep: ./php-fpm.log: Permission denied
grep: ./spooler: Permission denied
grep: ./httpd: Permission denied
grep: ./php-fpm: Permission denied
grep: ./anaconda.syslog: Permission denied
grep: ./messages: Permission denied
grep: ./httpd24: Permission denied

and when I use sudo:

[06:47 PM]-[vagrant@mdo1]-[/var/log]
$ sudo grep -R "varnish" .
./secure:Oct 30 18:48:02 mdo1 sudo:  vagrant : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/bin/grep -R varnish .

[06:48 PM]-[vagrant@mdo1]-[/var/log]
$ sudo grep -r "varnish" .
./secure:Oct 30 18:48:02 mdo1 sudo:  vagrant : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/bin/grep -R varnish .
./secure:Oct 30 18:48:26 mdo1 sudo:  vagrant : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/bin/grep -r varnish .
geerlingguy commented 5 years ago

@JasonWeakley - Could you file a new issue with this problem and we can take a look at what might be going on? It looks like Varnish isn't even installed, or something weird like that.

JasonWeakley commented 5 years ago

@geerlingguy Absolutely, thank you!