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.

Comments

manarth created an issue. See original summary.

manarth’s picture

Status: Active » Needs review
StatusFileSize
new4.81 KB

This patch:

  • Adds a status-response constant to represent authentication failure
  • Refactors the two reporting mechanisms (the status-report admin page, and the varnish configuration page) to report authentication failures.
  • Changed the _varnish_terminal_run() routine to prevent it attempting commands on a failed connection.
  • Improved the documentation for some of the functions.

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.

misc’s picture

Status: Needs review » Needs work

Thanks, this patch needs an re-roll against latest dev.

manarth’s picture

Status: Needs work » Needs review
StatusFileSize
new6.34 KB

Rerolled :-)

  • MiSc committed 9fb169a on 8.x-1.x authored by manarth
    Issue #2763989 by manarth: Report "Authentication failure" in...
misc’s picture

Thanks, added and pushed to latest dev.

misc’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.