[GH-ISSUE #9] Getting count is not defined randomly #8

Closed
opened 2026-02-26 04:33:45 +03:00 by kerem · 0 comments
Owner

Originally created by @mageddo on GitHub (Sep 27, 2016).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/9

After some test I've discover that the cache has a problem:

If you merge two questions answers in the same answer you will got ReferenceError: count is not defined (more details below) so I have fixed it

m=resolveDnsLocally, status=begin, question=accounts.youtube.com
m=resolveDnsLocally, status=notFound, question=accounts.youtube.com
m=solve, from=json
m=resolveDnsLocally, status=begin, question=accounts.youtube.com
m=resolveDnsLocally, status=notFound, question=accounts.youtube.com
m=solve, from=remote
m=proxy, status=begin, questionName= accounts.youtube.com , type= 1
m=proxy, status=resolvedFromCache, host=accounts.youtube.com, cacheSize=168, qtd=27
m=doAnswer, host=accounts.youtube.com, answer=27, authority=4, additional=4
m=parallel, status=questions done, action=sending answers, msg=success
ReferenceError: count is not defined
    at writeTruncate (/opt/docker-dns-server/node_modules/native-dns-packet/packet.js:223:22)
    at Function.Packet.write (/opt/docker-dns-server/node_modules/native-dns-packet/packet.js:416:19)
    at Packet.send (/opt/docker-dns-server/node_modules/native-dns/lib/packet.js:43:16)
    at /opt/docker-dns-server/app.js:85:12
    at /opt/docker-dns-server/node_modules/async/lib/async.js:726:13
    at /opt/docker-dns-server/node_modules/async/lib/async.js:52:16
    at done (/opt/docker-dns-server/node_modules/async/lib/async.js:241:17)
    at /opt/docker-dns-server/node_modules/async/lib/async.js:44:16
    at /opt/docker-dns-server/node_modules/async/lib/async.js:723:17
    at /opt/docker-dns-server/node_modules/async/lib/async.js:167:37
m=request, questions= 1
m=solve, requestFrom= 172.17.0.1 , for= daisy.ubuntu.com , type= A
m=solve, from=containers
m=resolveDnsLocally, status=begin, question=daisy.ubuntu.com
m=resolveDnsLocally, status=notFound, question=daisy.ubuntu.com
m=solve, from=json
m=resolveDnsLocally, status=begin, question=daisy.ubuntu.com
m=resolveDnsLocally, status=notFound, question=daisy.ubuntu.com
m=solve, from=remote
Originally created by @mageddo on GitHub (Sep 27, 2016). Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/9 After some test I've discover that the cache has a problem: If you merge two questions answers in the same answer you will got `ReferenceError: count is not defined` (more details below) so I have fixed it ``` m=resolveDnsLocally, status=begin, question=accounts.youtube.com m=resolveDnsLocally, status=notFound, question=accounts.youtube.com m=solve, from=json m=resolveDnsLocally, status=begin, question=accounts.youtube.com m=resolveDnsLocally, status=notFound, question=accounts.youtube.com m=solve, from=remote m=proxy, status=begin, questionName= accounts.youtube.com , type= 1 m=proxy, status=resolvedFromCache, host=accounts.youtube.com, cacheSize=168, qtd=27 m=doAnswer, host=accounts.youtube.com, answer=27, authority=4, additional=4 m=parallel, status=questions done, action=sending answers, msg=success ReferenceError: count is not defined at writeTruncate (/opt/docker-dns-server/node_modules/native-dns-packet/packet.js:223:22) at Function.Packet.write (/opt/docker-dns-server/node_modules/native-dns-packet/packet.js:416:19) at Packet.send (/opt/docker-dns-server/node_modules/native-dns/lib/packet.js:43:16) at /opt/docker-dns-server/app.js:85:12 at /opt/docker-dns-server/node_modules/async/lib/async.js:726:13 at /opt/docker-dns-server/node_modules/async/lib/async.js:52:16 at done (/opt/docker-dns-server/node_modules/async/lib/async.js:241:17) at /opt/docker-dns-server/node_modules/async/lib/async.js:44:16 at /opt/docker-dns-server/node_modules/async/lib/async.js:723:17 at /opt/docker-dns-server/node_modules/async/lib/async.js:167:37 m=request, questions= 1 m=solve, requestFrom= 172.17.0.1 , for= daisy.ubuntu.com , type= A m=solve, from=containers m=resolveDnsLocally, status=begin, question=daisy.ubuntu.com m=resolveDnsLocally, status=notFound, question=daisy.ubuntu.com m=solve, from=json m=resolveDnsLocally, status=begin, question=daisy.ubuntu.com m=resolveDnsLocally, status=notFound, question=daisy.ubuntu.com m=solve, from=remote ```
kerem 2026-02-26 04:33:45 +03:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/dns-proxy-server-mageddo#8
No description provided.