Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message for stage #7 #23

Open
rohitpaulk opened this issue Jan 28, 2024 · 1 comment
Open

Confusing error message for stage #7 #23

rohitpaulk opened this issue Jan 28, 2024 · 1 comment

Comments

@rohitpaulk
Copy link
Member

Screenshot 2024-01-28 at 16 47 47
[stage-7] Running tests for Stage #7: Parse compressed packet
[stage-7] DNS resolver listening on 127.0.0.1:5354
[stage-7] Starting DNS server on 127.0.0.1:2053
[stage-7] Running program
[stage-7] Connecting to 127.0.0.1:2053 using UDP
[your_program] Logs from your program will appear here!
[stage-7] Querying the following in the same request (Messages with >> prefix are part of this log)
[stage-7] >> ;abc.longassdomainname.com. IN A
[stage-7] >> ;def.longassdomainname.com. IN A
[stage-7] Sending Request: (Messages with >>> prefix are part of this log)
[stage-7] >>> ;; opcode: QUERY, status: NOERROR, id: 19542
[stage-7] >>> ;; flags: rd; QUERY: 2, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
[stage-7] >>>
[stage-7] >>> ;; QUESTION SECTION:
[stage-7] >>> ;abc.longassdomainname.com. IN A
[stage-7] >>> ;def.longassdomainname.com. IN A
[stage-7] >>>
[your_program] 2024/01/28 16:45:33 Received 33 bytes from 127.0.0.1:43902: parsed header: &dns.Header{ID:0xb3cc, Compacted:dns.Compacted{QR:true, OPCODE:0x0, AA:false, TC:false, RD:true, RA:false, Z:0, RCODE:0x0}, QDCOUNT:0x1, ANCOUNT:0x0, NSCOUNT:0x0, ARCOUNT:0x0}, questions:[]dns.Question{dns.Question{Name:"codecrafters.io", Type:0x1, Class:0x1}}
[your_program] 2024/01/28 16:45:33 HeaderID: 46028
[your_program] 2024/01/28 16:45:33 Preparing answer for question dns.Question{Name:"codecrafters.io", Type:0x1, Class:0x1}
[stage-7] DNS query failed: dns: overflow unpacking uint16.
[stage-7] If you are seeing this after a while then it is likely that your server is not responding with appropriate id
[stage-7] Test failed
[stage-7] Terminating program
[stage-7] Shutting down DNS resolver server...
[your_program] 2024/01/28 16:45:33 Answer is dns.Answer{Name:"codecrafters.io", Type:0x1, Class:0x1, TTL:0x3c, Length:0x4, Data:0x4020301}
[your_program] 2024/01/28 16:45:33 Received 53 bytes from 127.0.0.1:51659: parsed header: &dns.Header{ID:0x4c56, Compacted:dns.Compacted{QR:true, OPCODE:0x0, AA:false, TC:false, RD:true, RA:false, Z:0, RCODE:0x0}, QDCOUNT:0x2, ANCOUNT:0x0, NSCOUNT:0x0, ARCOUNT:0x0}, questions:[]dns.Question{dns.Question{Name:"abc.longassdomainname.com", Type:0x1, Class:0x1}, dns.Question{Name:"def.longassdomainname.com", Type:0x1, Class:0x1}}
[your_program] 2024/01/28 16:45:33 HeaderID: 19542
[your_program] 2024/01/28 16:45:33 Preparing answer for question dns.Question{Name:"abc.longassdomainname.com", Type:0x1, Class:0x1}
[your_program] 2024/01/28 16:45:33 Answer is dns.Answer{Name:"abc.longassdomainname.com", Type:0x1, Class:0x1, TTL:0x3c, Length:0x4, Data:0x4020301}
[your_program] 2024/01/28 16:45:33 Preparing answer for question dns.Question{Name:"def.longassdomainname.com", Type:0x1, Class:0x1}
[your_program] 2024/01/28 16:45:33 Answer is dns.Answer{Name:"def.longassdomainname.com", Type:0x1, Class:0x1, TTL:0x3c, Length:0x4, Data:0x4020301}
[stage-7] Program terminated successfully

Error message isn't clear. Response header ID is correct because previous stages pass.

@rohitpaulk
Copy link
Member Author

Thanks to @ashusvnath for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant