Open t4lz opened 2 years ago
Running directly on the target pod with kubectl exec -it <POD-NAME> -- /bin/bash
and installing nc
(apt update && apt install netcat-openbsd
), nc -u -6 <HOST> <PORT>
fails, so maybe this is not a bug in mirrord? I guess we can install node
on the pod and run the same script and verify we get the same result.
This fails with a different reason now:
2022-10-26T17:45:48.154344Z DEBUG ThreadId(24) getaddrinfo: mirrord_layer::socket::ops: getaddrinfo -> result 0x00007f1cd8002480 rawish_node=Some("localhost") rawish_service=None raw_hints=Some(addrinfo { ai_flags: 0, ai_family: 10, ai_socktype: 1, ai_protocol: 0, ai_addrlen: 0, ai_addr: 0x0, ai_canonname: 0x0, ai_next: 0x0 })
2022-10-26T17:45:48.154413Z TRACE ThreadId(24) getaddrinfo: mirrord_layer::socket::ops: exit rawish_node=Some("localhost") rawish_service=None raw_hints=Some(addrinfo { ai_flags: 0, ai_family: 10, ai_socktype: 1, ai_protocol: 0, ai_addrlen: 0, ai_addr: 0x0, ai_canonname: 0x0, ai_next: 0x0 })
file:///home/meowjesty/dev/metalbear/playground/test_outgoing_traffic_udp6_client.mjs:22
throw err
^
Error: send EINVAL localhost:31415
at doSend (node:dgram:713:16)
at defaultTriggerAsyncIdScope (node:internal/async_hooks:466:18)
at GetAddrInfoReqWrap.afterDns [as callback] (node:dgram:659:5)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:8) {
errno: -22,
code: 'EINVAL',
syscall: 'send',
address: 'localhost',
port: 31415
}
2022-10-26T17:51:02.042132Z TRACE ThreadId(03) handle_client_message: mirrord_agent: GetAddrInfoRequest -> response GetAddrInfoResponse(
Ok(
DnsLookup(
[
LookupRecord {
name: "localhost",
ip: 127.0.0.1,
},
],
),
),
) GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") })
2022-10-26T17:51:02.042143Z TRACE ThreadId(03) handle_client_message:respond: mirrord_agent: enter GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") }) response=GetAddrInfoResponse(GetAddrInfoResponse(Ok(DnsLookup([LookupRecord { name: "localhost", ip: 127.0.0.1 }]))))
2022-10-26T17:51:02.042156Z TRACE ThreadId(03) handle_client_message:respond: actix_codec::framed: flushing framed transport GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") }) response=GetAddrInfoResponse(GetAddrInfoResponse(Ok(DnsLookup([LookupRecord { name: "localhost", ip: 127.0.0.1 }]))))
2022-10-26T17:51:02.042158Z TRACE ThreadId(03) handle_client_message:respond: actix_codec::framed: writing; remaining=18 GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") }) response=GetAddrInfoResponse(GetAddrInfoResponse(Ok(DnsLookup([LookupRecord { name: "localhost", ip: 127.0.0.1 }]))))
2022-10-26T17:51:02.042168Z TRACE ThreadId(03) handle_client_message:respond: actix_codec::framed: framed transport flushed GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") }) response=GetAddrInfoResponse(GetAddrInfoResponse(Ok(DnsLookup([LookupRecord { name: "localhost", ip: 127.0.0.1 }]))))
2022-10-26T17:51:02.042177Z TRACE ThreadId(03) handle_client_message:respond: mirrord_agent: exit GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") }) response=GetAddrInfoResponse(GetAddrInfoResponse(Ok(DnsLookup([LookupRecord { name: "localhost", ip: 127.0.0.1 }]))))
2022-10-26T17:51:02.042180Z TRACE ThreadId(03) handle_client_message: mirrord_agent: exit GetAddrInfoRequest(GetAddrInfoRequest { node: Some("localhost") })
Bug Description
Outgoing UDP messages fail if destination is specified by name, not address, because of a DNS error on the agent.
Steps to Reproduce
localhost
):Backtrace
Relevant Logs
Agent logs:
Your operating system and version
macOS Monterey 12.5.1
Local process
/opt/homebrew/bin/node: Mach-O 64-bit executable arm64
Local process version
No response
Additional Info
I do not know if this issue is limited to attempts to send UDP messages.