Skip to content

test: DNS for bare domain fails with fritz.box search domainΒ #9799

@bnoordhuis

Description

@bnoordhuis
  • Version: master
  • Platform: Linux localhost.localdomain 4.8.8-300.fc25.x86_64 deps: update openssl to 1.0.1jΒ #1 SMP Tue Nov 15 18:10:06 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: dns

Discovered while on a LAN with a fritz.box search domain.

$ sudo sh -c 'echo "search fritz.box" >> /etc/resolv.conf'

$ out/Release/node test/parallel/test-net-better-error-messages-port-hostname.js
assert.js:85
  throw new assert.AssertionError({
  ^
AssertionError: 'Unknown system error -74' == 'ENOTFOUND'
    at Socket.<anonymous> (/home/bnoordhuis/src/v1.x/test/parallel/test-net-better-error-messages-port-hostname.js:11:10)
    at Socket.<anonymous> (/home/bnoordhuis/src/v1.x/test/common.js:422:15)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at connectErrorNT (net.js:1025:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

$ strace -s 512 -fe socket,connect,recvfrom,sendmmsg out/Release/node test/parallel/test-net-better-error-messages-port-hostname.js
[...]
[pid 25161] socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 12
[pid 25161] connect(12, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, 16) = 0
[pid 25161] sendmmsg(12, {{{msg_name(0)=NULL, msg_iov(1)=[{"\3102\1\0\0\1\0\0\0\0\0\0\3***\5fritz\3box\0\0\1\0\1", 31}], msg_controllen=0, msg_flags=MSG_DONTWAIT|MSG_EOR|MSG_SYN|MSG_RST|MSG_CMSG_CLOEXEC|0x1ed80010}, 31}, {{msg_name(0)=NULL, msg_iov(1)=[{"\322 \1\0\0\1\0\0\0\0\0\0\3***\5fritz\3box\0\0\34\0\1", 31}], msg_controllen=0, msg_flags=MSG_OOB|MSG_PEEK|MSG_CTRUNC|MSG_WAITALL|MSG_FIN|MSG_SYN|MSG_CONFIRM|MSG_WAITFORONE|MSG_FASTOPEN|0x85b40000}, 31}}, 2, MSG_NOSIGNAL) = 2
[pid 25161] recvfrom(12, "\3102\201\200\0\1\0\1\0\0\0\0\3***\5fritz\3box\0\0\1\0\1\300\f\0\1\0\1\0\0\t\262\0\4\177\00055", 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, [16]) = 47
[pid 25161] recvfrom(12, "\322 \201\200\0\1\0\0\0\1\0\0\3***\5fritz\3box\0\0\34\0\1\300\26\0\6\0\1\0\0\3\203\0005\1a\3nic\300\26\7support\variservices\3com\0X\37\325\341\0\0\7\10\0\0\1,\0\33\257\200\0\0\7\10", 65536, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("8.8.8.8")}, [16]) = 96

Error -74 is EBADMSG. Changing the search domain to something more benign (e.g. domain.local) makes the test pass again. There are more tests with the same issue.

Tests in test/parallel and test/sequential should not need internet access so perhaps it's best to move affected tests to test/internet but that isn't run regularly. Either that or they should be modified to not make actual DNS queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.good first issueIssues that are suitable for first-time contributors.testIssues and PRs related to the tests.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions