If Drupal cannot correctly authenticate to Varnish, it logs the authentication failure, then continues to try to run the command.
If you visit the varnish configuration page, it simply says "The Varnish control terminal is not responding".
If you visit the status-report page, you see a similar message: "Varnish connection broken".
There is nothing in these messages to indicate the nature of the problem, or how to solve it.
It's only when you visit the watchdog logs that the issue is indicated:
- Authentication to server failed!
- Recieved status code 101 running status. Full response text: Unknown request. Type 'help' for more info.
This means that developers take longer to identify the issue, and has even resulted in a report to the issue queue: #941788: Need help with control terminal :6082 - received status 101. An authentication failure is a clearly-identifiable issue, with a clearly-identifiable solution, and therefore it would be useful to flag this up with a separate error on the Varnish configuration form and on the status-report page.
I'd suggest throwing a new VarnishAuthenticationException in _varnish_terminal_run(), and catching it then displaying an appropriate message in the relevant places.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2763989-varnish-report-authentication-failure--4.patch | 6.34 KB | manarth |
| #2 | 2763989-varnish-report-authentication-failure.patch | 4.81 KB | manarth |
Comments
Comment #2
manarth commentedThis patch:
_varnish_terminal_run()routine to prevent it attempting commands on a failed connection.I initially thought to throw an Exception, but this would prevent the module from continuing to attempt the commands on other servers in the pool.
Comment #3
misc commentedThanks, this patch needs an re-roll against latest dev.
Comment #4
manarth commentedRerolled :-)
Comment #6
misc commentedThanks, added and pushed to latest dev.
Comment #7
misc commented