Traffic Server
  1. Traffic Server
  2. TS-580

server fail assert when dns request does not match any rule from splitdns.config

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.1.5
    • Component/s: DNS
    • Labels:
      None
    • Environment:

      ts 2.1.4 or svn trunk

      Description

      here is my splitdns.config:
      dest_domain=zymlinux.net named="216.69.185.26;208.109.255.26"
      dest_domain=zymlinux.info named="216.69.185.26;208.109.255.26"
      dest_domain=img01.taobaocdn.com named="127.0.0.1"
      dest_domain=!zymlinux.net named="127.0.0.1"

      here is my remap.config:
      map http://cdn.zymlinux.net/_sp_cache-internal http://

      {cache-internal}

      map http://cdn.zymlinux.net/_sp_cache http://

      {cache}

      map http://cdn.zymlinux.net/_sp_stat http://

      {stat}

      map http://cdn.zymlinux.net/_sp_test http://

      {test}

      map http://cdn.zymlinux.net/_sp_hostdb http://

      {hostdb}

      map http://cdn.zymlinux.net/_sp_net http://

      {net}

      map http://cdn.zymlinux.net/_sp_http/ http://

      {http}

      /
      map http://cdn.zymlinux.net/ http://source.zymlinux.net/
      map http://cdn.zymlinux.info/ http://zymlinux.info/source
      map http://ddn.zymlinux.net/ http://img01.taobaocdn.com/source
      map http://img02.taobaocdn.com/ http://img02.taobaocdn.com/

      here is the traffic.out:
      http://pastebin.com/NPBz5Pnh

      server will assert just after cache enabled, when doing dns query with 127.0.0.1 for PTR

        Activity

        Hide
        qianshi added a comment -

        Start the dns handler by default. When split dns did not find default server, use dns handler as backup.

        Show
        qianshi added a comment - Start the dns handler by default. When split dns did not find default server, use dns handler as backup.
        Hide
        Leif Hedstrom added a comment -

        I can not duplicate this problem, that assert should never happen. I have a config like

        dest_domain=yahoo.com named="192.168.201.1"
        dest_domain=google.com named="192.168.201.16"

        for all other domains, it falls back on the default resolver from resolv.conf. Do you not have such a default?

        Show
        Leif Hedstrom added a comment - I can not duplicate this problem, that assert should never happen. I have a config like dest_domain=yahoo.com named="192.168.201.1" dest_domain=google.com named="192.168.201.16" for all other domains, it falls back on the default resolver from resolv.conf. Do you not have such a default?
        Hide
        Leif Hedstrom added a comment -

        Also, the intent of the code changes I made was that with SplitDNS, you don't need the "default" handler from DNS.cc. Undoing this ought to mean you have two default DNS handlers now, which is completely unecessary. I'm not sure I understand why your default handler from SplitDNS isn't working? I think that's the real issue, not enabling the default DNS handler from DNS.cc.

        Show
        Leif Hedstrom added a comment - Also, the intent of the code changes I made was that with SplitDNS, you don't need the "default" handler from DNS.cc. Undoing this ought to mean you have two default DNS handlers now, which is completely unecessary. I'm not sure I understand why your default handler from SplitDNS isn't working? I think that's the real issue, not enabling the default DNS handler from DNS.cc.
        Hide
        Leif Hedstrom added a comment -

        This is the relevant function in SplitDNS.cc:

        SplitDNSRecord *
        createDefaultServer()

        { ... }
        Show
        Leif Hedstrom added a comment - This is the relevant function in SplitDNS.cc: SplitDNSRecord * createDefaultServer() { ... }
        Hide
        Zhao Yongming added a comment -

        after deep debug, I have find out that the assert is caused by a invalid PTR request, and I still have no idea why I get this invalid PTR request.

        [Dec 7 22:14:08.308] Server

        {47332150290192} DEBUG: (hostdb) probe 127.0.0.1 F9D5E018CA21DEE0 1 [ignore_timeout = 0]
        [Dec 7 22:14:08.308] Server {47332150290192}

        DEBUG: (hostdb) immediate answer for 127.0.0.1
        [Dec 7 22:14:08.308] Server

        {47332150290192} DEBUG: (hostdb) probe (null) AA30DE0F80A82135 0 [ignore_timeout = 0]
        [Dec 7 22:14:08.309] Server {47332150290192}

        DEBUG: (hostdb) delaying force 0 answer for (null)
        [Dec 7 22:14:08.309] Server

        {47332167898896} DEBUG: (hostdb) probe AA30DE0F80A82135 0 [ignore_timeout = 0]
        [Dec 7 22:14:08.309] Server {47332167898896}

        DEBUG: (hostdb) DNS IP 127.0.0.1
        [Dec 7 22:14:08.309] Server

        {47332167898896}

        DEBUG: (dns) received query  type = 12, timeout = 0
        FATAL: DNS.cc:262: failed assert `dnsH`
        /usr/bin/traffic_server - STACK TRACE:
        /usr/bin/traffic_server(ink_fatal_va+0xab)[0x6bda1b]

        you can make simple invalid request if you enable http_ui by query : http://localhost/hostdb/ip?ip=1
        that will trigger the assert

        Show
        Zhao Yongming added a comment - after deep debug, I have find out that the assert is caused by a invalid PTR request, and I still have no idea why I get this invalid PTR request. [Dec 7 22:14:08.308] Server {47332150290192} DEBUG: (hostdb) probe 127.0.0.1 F9D5E018CA21DEE0 1 [ignore_timeout = 0] [Dec 7 22:14:08.308] Server {47332150290192} DEBUG: (hostdb) immediate answer for 127.0.0.1 [Dec 7 22:14:08.308] Server {47332150290192} DEBUG: (hostdb) probe (null) AA30DE0F80A82135 0 [ignore_timeout = 0] [Dec 7 22:14:08.309] Server {47332150290192} DEBUG: (hostdb) delaying force 0 answer for (null) [Dec 7 22:14:08.309] Server {47332167898896} DEBUG: (hostdb) probe AA30DE0F80A82135 0 [ignore_timeout = 0] [Dec 7 22:14:08.309] Server {47332167898896} DEBUG: (hostdb) DNS IP 127.0.0.1 [Dec 7 22:14:08.309] Server {47332167898896} DEBUG: (dns) received query  type = 12, timeout = 0 FATAL: DNS.cc:262: failed assert `dnsH` /usr/bin/traffic_server - STACK TRACE: /usr/bin/traffic_server(ink_fatal_va+0xab) [0x6bda1b] you can make simple invalid request if you enable http_ui by query : http://localhost/hostdb/ip?ip=1 that will trigger the assert
        Hide
        Zhao Yongming added a comment -

        last commit does not include these change, which is in qianshi's patch. I have remake this patch for trunk.

        Show
        Zhao Yongming added a comment - last commit does not include these change, which is in qianshi's patch. I have remake this patch for trunk.
        Hide
        Leif Hedstrom added a comment -

        Most of what you have in that patch is already there, the if() statement had a typo though on trunk, which I fixed. Let me know if this works.

        Show
        Leif Hedstrom added a comment - Most of what you have in that patch is already there, the if() statement had a typo though on trunk, which I fixed. Let me know if this works.

          People

          • Assignee:
            Leif Hedstrom
            Reporter:
            Zhao Yongming
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development