Ticket #802 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

Assert error in VRT_r_obj_status()

Reported by: David Busby Owned by: phk
Priority: low Milestone:
Component: varnishd Version: 2.1.4
Severity: minor Keywords: VRT_r_obj_status
Cc:

Description

anic message: Assert error in VRT_r_obj_status(), cache_vrt.c line 343:#012  Condition((sp->obj) != NULL) not true.#012thread = (cache-worker)#012ident = Linux,2.6.34.7-56.fc13.i686,i686,-smalloc,-hcritbit,epoll#012Backtrace:#012  0x806d79d: /usr/sbin/varnishd() [0x806d79d]#012  0x80776e8: /usr/sbin/varnishd(VRT_r_obj_status+0x158) [0x80776e8]#012  0x648a32: ./vcl.1P9zoqAU.so(+0x1a32) [0x648a32]#012  0x80731c5: /usr/sbin/varnishd(VCL_fetch_method+0x55) [0x80731c5]#012  0x8059f70: /usr/sbin/varnishd() [0x8059f70]#012  0x805bc42: /usr/sbin/varnishd(CNT_Session+0x3c2) [0x805bc42]#012  0x806f320: /usr/sbin/varnishd() [0x806f320]#012  0x806f70a: /usr/sbin/varnishd() [0x806f70a]#012  0x806fc3e: /usr/sbin/varnishd() [0x806fc3e]#012  0x580919: /lib/libpthread.so.0() [0x580919]#012sp = 0xaca07004 {#012  fd = 12, id = 12, xid = 479311681,#012  client = 127.0.0.1:53031,#012  step = STP_FETCH,#012  handling = deliver,#012  err_code = 500, err_reason = (null),#012  restarts = 0, esis = 0#012  ws = 0xaca0704c { #012    id = "sess",#012    {s,f,r,e} = {0xaca077dc,+536,(nil),+16384},#012  },#012  http[req] = {#012    ws = 0xaca0704c[sess]#012      "GET",#012      "/test.php",#012      "HTTP/1.1",#012      "Host: localhost:8080",#012      "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100920 Fedora/3.6.10-1.fc13 Firefox/3.6.10",#012      "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",#012      "Accept-Language: en-us,en;q=0.5",#012      "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",#012      "Keep-Alive: 115",#012      "Connection: keep-alive",#012      "Cache-Control: max-age=0",#012      "Accept-Encoding: gzip",#012  },#012  worker = 0xac877124 {#012    ws = 0xac87723c { #012      id = "wrk",#012      {s,f,r,e} = {0xac8710d0,+296,(nil),+16384},#012    },#012    http[bereq] = {#012      ws = 0xac87723c[wrk]#012        "GET",#012        "/test.php",#012        "HTTP/1.1",#012        "Host: localhost:8080",#012        "User-Ag

This is using varnish 2.1.4 and the syslog example here:  http://www.varnish-cache.org/trac/wiki/VCLExampleSyslog

Using other variables seems to work fine, trying to use VRT_r_obj_status() leads to the asset error above.

Change History

comment:1 Changed 3 years ago by tfheen

In which VCL function are you trying to read the object status?

comment:2 Changed 3 years ago by David Busby

sub vcl_fetch, which I've just realised using beresp not obj, going to try that now.

comment:3 Changed 3 years ago by David Busby

yes sorry, user error using beresp works fine.

comment:4 Changed 3 years ago by David Busby

Right sorry for the suprious updates, beresp does not work it generates an issue,

<code> Panic message: Assert error in vrt_selecthttp(), cache_vrt.c line 118:#012 Condition((sp->obj) != NULL) not true.#012thread = (cache-worker)#012ident = Linux,2.6.34.7-56.fc13.i686,i686,-smalloc,-hcritbit,epoll#012Backtrace:#012 0x806d79d: /usr/sbin/varnishd() [0x806d79d]#012 0x8076ed0: /usr/sbin/varnishd() [0x8076ed0]#012 0x8078d99: /usr/sbin/varnishd(VRT_GetHdr+0x59) [0x8078d99]#012 0x29da8f: ./vcl.1P9zoqAU.so(+0x1a8f) [0x29da8f]#012 0x80731c5: /usr/sbin/varnishd(VCL_fetch_method+0x55) [0x80731c5]#012 0x8059f70: /usr/sbin/varnishd() [0x8059f70]#012 0x805bc42: /usr/sbin/varnishd(CNT_Session+0x3c2) [0x805bc42]#012 0x806f320: /usr/sbin/varnishd() [0x806f320]#012 0x806f70a: /usr/sbin/varnishd() [0x806f70a]#012 0x806fc3e: /usr/sbin/varnishd() [0x806fc3e]#012sp = 0xaca07004 {#012 fd = 11, id = 11, xid = 269168914,#012 client = 127.0.0.1:43517,#012 step = STP_FETCH,#012 handling = deliver,#012 err_code = 500, err_reason = (null),#012 restarts = 0, esis = 0#012 ws = 0xaca0704c { #012 id = "sess",#012 {s,f,r,e} = {0xaca077dc,+536,(nil),+16384},#012 },#012 http[req] = {#012 ws = 0xaca0704c[sess]#012 "GET",#012 "/test.php",#012 "HTTP/1.1",#012 "Host: localhost:8080",#012 "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100920 Fedora/3.6.10-1.fc13 Firefox/3.6.10",#012 "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",#012 "Accept-Language: en-us,en;q=0.5",#012 "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",#012 "Keep-Alive: 115",#012 "Connection: keep-alive",#012 "Cache-Control: max-age=0",#012 "Accept-Encoding: gzip",#012 },#012 worker = 0xac877124 {#012 ws = 0xac87723c { #012 id = "wrk",#012 {s,f,r,e} = {0xac8710d0,+296,(nil),+16384},#012 },#012 http[bereq] = {#012 ws = 0xac87723c[wrk]#012 "GET",#012 "/test.php",#012 "HTTP/1.1",#012 "Host: localhost:8080",#012 "User-Agent: Mo </code>

I'm assuming this is user error?

comment:5 Changed 3 years ago by tfheen

Can you please include the exact VCL snippet you are using?

comment:6 Changed 3 years ago by David Busby

The following is current what is being tested:

sub vcl_fetch {
        /*
                if internal server error encountered
                set grace to 60s and restart, this should keep serving
                old content untill the backend is returned to service,
                you may want to include other codes on a per application basis (403/503 in drupal for example)
        */
        if( beresp.status == 500 ){
                if(req.restarts < 4){
                        set beresp.grace = 60s;
                        C{

                                syslog(LOG_ERR, "Spurious response from backend: xid %s request %s %s \"%s\" %d \"%s\" \"%s\"", VRT_r_req_xid(sp), VRT_r_req_request(sp), VRT_GetHdr(sp, HDR_REQ, "\005host:"), VRT_r_req_url(sp), VRT_r_beresp_status(sp), VRT_r_beresp_response(sp), VRT_GetHdr(sp, HDR_OBJ, "\011Location:"));
                        }C
                        restart;
                }

...

comment:7 Changed 3 years ago by David Busby

This is the code to recreate the original reported issues

if(req.restarts < 4){
                        set beresp.grace = 60s;
                        C{

                                syslog(LOG_ERR, "Spurious response from backend: xid %s request %s %s \"%s\" %d \"%s\" \"%s\"", VRT_r_req_xid(sp), VRT_r_req_request(sp), VRT_GetHdr(sp, HDR_REQ, "\005host:"), VRT_r_req_url(sp), VRT_r_obj_status(sp), VRT_r_obj_response(sp), VRT_GetHdr(sp, HDR_OBJ, "\011Location:"));
                        }C
                        restart;
                } 

comment:8 Changed 3 years ago by tfheen

  • Status changed from new to closed
  • Resolution set to invalid

There is no obj object in vcl_fetch, but you are using VRT_r_obj_status(sp), VRT_r_obj_response as well as fetching from HDR_OBJ rather than HDR_BERESP. That won't work, use VRT_r_beresp_status and its friends.

Note: See TracTickets for help on using tickets.