All,

Is there a desired version of Varnish this module wants to talk with? I'm using Fedora Core 11, 64bit, with varnish 2.0.6 (stock from the vendor), Pressflow 6.16.77, Varnish module 6.x-1.x-dev as of today, which is as of commit #395028. I'm using the Mercury default.vcl.

Here's what I see in my Drupal logs. At least two issues, same general message.

1) On the /admin/settings/varnish page I get the error. This page has been redirected to https via SecurePages. Not sure yet if that has something to do with it. But you will notice the https and the valid IP in the error (not 127.0.0.1).

Jul 20 02:12:00 domU-12 varnishd[17006]: CLI 7 open from telnet 127.0.0.1:45278 127.0.0.1:6082
Jul 20 02:12:00 domU-12 drupal: https://mysite.com|1279606320|varnish|1.2.3.4|https://mysite.com/admin/settings/varnish|http://mysite.com/explore/members/1/photos/26862|1||Socket error: Resource temporarily unavailable
Jul 20 02:12:00 domU-12 varnishd[17006]: CLI 7 result 200 "status"
Jul 20 02:12:00 domU-12 varnishd[17006]: CLI 7 closed

2) On a views output page that also uses the editablefields module to submit content via ajax. It's views 6.x-3.0-alpha3 if it matters.

Jul 20 01:57:33 domU-12 varnishd[17006]: CLI 7 open from telnet 127.0.0.1:45466 127.0.0.1:6082
Jul 20 01:57:33 domU-12 drupal: http://mysite.com|1279605453|varnish|127.0.0.1|http://mysite.com/editablefields_submit|http://mysite.com/members/58/mebytaxonomy?tid=3966&tid_1=124&tid_2=15975|16||Socket error: Resource temporarily unavailable
Jul 20 01:57:33 domU-12 varnishd[17006]: CLI 7 result 200 "purge req.http.host ~ mysite.com && req.url ~ ^/"
Jul 20 01:57:33 domU-12 varnishd[17006]: CLI 7 closed

I'm not yet clear why I'm seeing the above errors. The _varnish_read_socket() function seems to be fairly straight-forward, so my first thought was perhaps you expect a newer Varnish than I am using. If that's the case I'll upgrade, if it's not I may at least move to whatever the module authors are using so we're all looking at the same thing.

By the way, the varnish.module and varnish.admin,inc need their ID tags changed from:

// $Id:

to

// $Id$

They aren't currently showing the version tags.

Thanks for any thoughts.

Comments

chrishaslam’s picture

I am experiencing 'Socket error: Resource temporarily unavailable' to watchdog from both /user and /admin/settings/watchdog

Same as above 6.x-1.x-dev and Varnish 2.0.6 (from epel on RHEL)

Chad_Dupuis’s picture

I'm experiencing the same errors since the recent update to dev (i.e. I didn't seem them in the last dev version). I have Varnish 2.0.3 on ubuntu....

gibbet’s picture

Title: Desired version of Varnish? » Same here...

I am not sure why though, can some one please shed light on how debug this?

rjbrown99’s picture

Title: Same here... » Varnish version - Socket Error

Hello, please keep the issue title related to the problem at hand. I switched it back to something more descriptive.

WhenInRome’s picture

receiving this error in watchdog.

Message Socket error: Resource temporarily unavailable

iaminawe’s picture

Receiving the same error on stackscript built mercury for linode - 1GB memory

joshk’s picture

Looks like there are definitely some varnish version nits. Ideally we want to support anything 2.x, but they changed a bit of their protocol. Investigating.

rjbrown99’s picture

#7 - Thanks. I'd be happy to move to whatever version you know is working now to see if that helps resolve this.

spearhead93’s picture

Status: Active » Needs review
StatusFileSize
new743 bytes

Isn't this bug related to #808314: Secret key variable is never used ? Don't you miss a secret key there?
Under Ubuntu a secret key is required (located in /etc/varnish/secret), then, as nestor.mata pointed out, there is just a key declaration to be added in the code (missing in current dev release: 6.x-1.x-dev, patch provided). Tks to nestor.mata.

rjbrown99’s picture

Thanks #9, this is helpful. Varnish 2.0.6 does not include support for secret - it was introduced in 2.1.0 per the change log. Perhaps this is part of the issue.

Macronomicus’s picture

#10 yes thats the issue :( wasnt really interested in doing a varnish upgrade yet.

Anyone have a copy of the previous dev or is the one in cvs from November 10, 2009 the only other dev release?

Edit: Oh wait im using drush/aegir I should have a copy of the older varnish. Yay crisis averted!

pcambra’s picture

suscribe

mrconnerton’s picture

I'm trying to debug this on my stack, but silly question: how can I tell what version of varnish I have? I used a stack script on linode to install mercury.

Chad_Dupuis’s picture


apt-cache show varnish

mrconnerton’s picture

So do we need version 2.1.0 and the patch in #9 to get this working properly?

EvanDonovan’s picture

Title: Varnish version - Socket Error » Varnish module, latest dev, gives "Socket Error" with Varnish versions < 2.1 (needs documentation)
Category: support » bug

From my testing today, it looks like Varnish 2.0.5 is incompatible with the latest dev release of the Varnish module. I had to use a dev from several months ago, since I don't feel like upgrading Varnish at the moment.

I think that this should probably be documented on the project page. I don't have any higher versions of Varnish than 2.0.5, so I can't confirm that the patch in #9 is required to get the latest dev working.

parasox’s picture

I'm seeing these errors all over, using Version: 2.0.4-2

Base stackscript install on linode mercury/pressflow

Would be nice to know how to get rid of these errors if anyone knows.

EvanDonovan’s picture

@parasox: You won't be able to use a version of Varnish below 2.1 with the latest version of this module, I believe. The syntax for connecting to Varnish apparently changed.

parasox’s picture

Evan, sorry a bit noobish here, can I like 'apt-get install varnish" and voila? Says above you don't want to upgrade varnish yourself, so I guess not huh. ;)

I guess I'll wait for something magical to happen, I don't see any problems associated with this error, other than the errors themselves.

Chad_Dupuis’s picture

Unless I'm mistaken the latest varnish available via apt-get (on ubuntu anyhow) still works and is < 2.1. I installed it via apt-get install varnish and everything is working as far as I can tell. I do see this error from time to time but I'm not sure it is causing any problems for anyone....

pcambra’s picture

I'm in the same situation as Chad, varnish < 2.1 in Ubuntu, get the errors (on cron run?) but the headers of the request are served by varnish and the stats look fine?

EvanDonovan’s picture

@parasox: The VCL syntax changed in the last few point releases. I'd have to update all my configuration rules.

fabsor’s picture

Hi!

The problem seems to occur when we try to read from the socket in varnish.module on line 206:

// If there is a CLI banner message (varnish >= 2.1.x), try to read it and move on.
$status = _varnish_read_socket($client);

Since there is no banner message, this will always fail. Try commenting this out, and you will not get the error. How should we solve this? We could add a version setting that the user could change on the settings page?

EvanDonovan’s picture

@fabsor: Thanks for this.

I wonder if there is a way to read the Varnish version from CLI. If there is, the module could do that during hook_install() and set a variable that stores the Varnish version. Then this line of code could be conditional.

If someone upgraded Varnish then, they could change the variable setting from the module administration page. That way, people would only need to worry about the configuration setting if their version changed.

fabsor’s picture

StatusFileSize
new2.66 KB

There are no way (as far as I know) to check the varnish version through the terminal. I don't think we should try to do this in hook_install, since we can't be sure that the default configuration is ok for everyone. If it isn't then the automatic setup will fail anyway.

Here is a patch that takes the following approach:

* Add a setting on the varnish settings page (Varnish legacy mode)
* Check if we're running in legacy mode in _varnish_terminal_run and if so, don't try to get a status message or try to authenticate.

EvanDonovan’s picture

Seems like a reasonable approach. I'll try to test it soon.

rjbrown99’s picture

I applied the patch from #25, enabled legacy mode, and still get Socket error: Resource temporarily unavailable. This is with 2.0.6.

fabsor’s picture

StatusFileSize
new2.67 KB

Hi. The previous patch didn't work, since I checked for the wrong value from settings. Here's one that works =)

rjbrown99’s picture

I manually applied #28 and it seems to have fixed the problem. So far no socket errors in the log. I'll keep watching it for the next few days. If you do not hear back from me, assume that it's working properly. Thanks fabsor.

EDIT: I have been running all day now with the patch and zero messages. This looks good!

_-.’s picture

i'm running,

varnishd -V
varnishd (varnish-2.1.3 SVN 5049:5055)
Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS

built from src (varnish-2.1.3.tar.gz) tarball, on openSUSE 11.3 x86_64.

with latest varnish module -dev,

drush pm-list | grep -i varnish
Caching Varnish (varnish) Module Enabled 6.x-1.x-dev
grep Id ./sites/all/modules/varnish/varnish.info
; $Id: varnish.info,v 1.2 2010/05/04 16:08:53 joshk Exp $

and, i've applied the patch from "#23",

http://drupal.org/comment/reply/859116/3502726#comment-3502726

still, at 'first' use of 'drush up', i see,

drush up
...
No code updates available. [ok]
No database updates required [success]
WD varnish: Socket error: Resource temporarily unavailable [error]
WD varnish: Socket error: Resource temporarily unavailable [error]
WD varnish: Recieved status code running purge req.http.host ~ www.devsite.loc && req.url ~ ^/. Full [error]
response text:
'all' cache was cleared [success]
Finished performing updates. [ok]

then, at an _immediately_ subsequent,

drush up
...
No code updates available. [ok]
No database updates required [success]
'all' cache was cleared [success]
Finished performing updates. [ok]

damienmckenna’s picture

Am experiencing the same issue with 2.0.4-2 on Mercury installation at Linode.

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #28 is working well for me, thanks fabsor.

damienmckenna’s picture

@dev001: I think that's a different problem, please open a new issue.

_-.’s picture

bibo’s picture

subscribing.

zzolo’s picture

Patch in #28 did remove error message for me (though I am still having issue, but unsure if related).

pcambra’s picture

+1 to RTBC of #28 solved my problems in a linode box

damienmckenna’s picture

Priority: Normal » Major

So, is there anything else necessary to get this committed? Several people have responded to say that the patch in #28 resolves this rather major issue, having the patch committed and a new release rolled out would greatly benefit people attempting to use the module. Thanks.

hongpong’s picture

subscribing - this is pernicious! thx

fabsor’s picture

Status: Reviewed & tested by the community » Fixed

Commited. Thanks to all reviewers and people involved!

Status: Fixed » Closed (fixed)

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

anschauung’s picture

For anyone coming across this issue while Googling for the "Socket Error" message after installing this module (this thread is the top hit for me): you may need to check your settings at admin/settings/varnish.

There was a "Varnish Version" control added to to the module some time after this thread was closed. The default setting is for 2.1.X, but my Varnish version was 2.0.6. Changing it to the correct setting fixed these errors for me.