mirrord: gRPC + Linkerd mirroring doesn't work

Bug Description

We have several languages and golang and c++ appear to be working basically out of the box. However while our python services start and seem to run fine, they don’t see any grpc traffic forwarded.

I tried a couple different approaches, running with python ... and compiling using cython (which we leverage to improve performance) to create an executable, but both hit this same root issue. Running file on the cythonized binary gives:

ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=a83e70e25eebc70926938d868e78b474efaa369c, not stripped

Couldnt find any issues like this one, curious if this pattern-matches anything you’ve seen before. It’s curious that it only happens to python. If it helps, we’re compiling / running using bazel

Steps to Reproduce

I’m hoping this matches something you’ve seen before - our setup is quite complicated so a reproducible example might be tricky but can do this if it would be helpful

Backtrace

No response

mirrord layer logs

There are a lot, including what i feel is relevant:

On startup

2025-01-03T00:16:46.374178Z TRACE start:create_and_connect:try_new:operator_installed: mirrord_operator::client::discovery: return=false
2025-01-03T00:16:47.231933Z DEBUG start:create_and_connect: mirrord_kube::api::kubernetes: OpenShift was not detected.
2025-01-03T00:16:49.225508Z TRACE start:create_and_connect:create_agent{target=TargetConfig { path: Some(Pod(PodTarget { pod: "...", container: Some("...") })), namespace: Some("...") } config=Some(LayerConfig { accept_invalid_certificates: None, skip_processes: None, skip_build_tools: true, connect_tcp: None, operator: None, kubeconfig: None, sip_binaries: None, target: TargetConfig { path: Some(Pod(PodTarget { pod: "...", container: Some("...") })), namespace: Some("...") }, agent: AgentConfig { log_level: "info", json_log: false, namespace: Some("..."), image: AgentImageConfig("ghcr.io/metalbear-co/mirrord:3.128.0"), image_pull_policy: "IfNotPresent", image_pull_secrets: None, ttl: 1, ephemeral: false, communication_timeout: None, startup_timeout: 60, network_interface: None, flush_connections: true, disabled_capabilities: None, tolerations: None, resources: None, check_out_of_pods: true, privileged: true, nftables: false, dns: AgentDnsConfig { timeout: None, attempts: None }, labels: None, annotations: None, node_selector: None, service_account: None }, container: ContainerConfig { cli_image: "ghcr.io/metalbear-co/mirrord-cli:3.128.0", cli_extra_args: [], cli_prevent_cleanup: false, cli_image_lib_path: "/opt/mirrord/lib/libmirrord_layer.so" }, feature: FeatureConfig { env: EnvConfig { include: None, exclude: None, override: None, load_from_process: None, unset: None, env_file: None, mapping: None }, fs: FsConfig { mode: Read, read_write: None, read_only: None, local: Some(Multiple([".*.runfiles/.*", ".*.runfiles_manifest$"])), not_found: None, mapping: None }, network: NetworkConfig { incoming: IncomingConfig { port_mapping: {}, ignore_localhost: false, ignore_ports: {}, mode: Mirror, http_filter: HttpFilterConfig { header_filter: None, path_filter: None, all_of: None, any_of: None, ports: PortList(Multiple([80, 8080])) }, listen_ports: {}, on_concurrent_steal: Abort, ports: None }, outgoing: OutgoingConfig { tcp: true, udp: true, ignore_localhost: false, filter: None, unix_streams: None }, dns: DnsConfig { enabled: true, filter: None } }, copy_target: CopyTargetConfig { enabled: false, scale_down: false }, hostname: true, split_queues: SplitQueuesConfig({}) }, telemetry: true, kube_context: None, internal_proxy: InternalProxyConfig { connect_tcp: None, client_tls_certificate: None, client_tls_key: None, start_idle_timeout: 60, idle_timeout: 5, socket_timeout: 31536000, log_level: None, log_destination: None, container_mode: false }, external_proxy: ExternalProxyConfig { tls_enable: true, tls_certificate: None, tls_key: None, start_idle_timeout: 60, idle_timeout: 5, log_level: None, log_destination: None }, use_proxy: true, experimental: ExperimentalConfig { tcp_ping4_mock: true, readlink: false, trust_any_certificate: true, enable_exec_hooks_linux: true, hide_ipv6_interfaces: false, disable_reuseaddr: false, use_dev_null: true, readonly_file_buffer: 0 } }) tls_cert=None}:wait_for_agent_startup{pod_name="mirrord-agent-rlinlprwbm-zkk7q" container_name="mirrord-agent"}: mirrord_kube::api::container::util: return=Ok(Some("3.128.0"))
2025-01-03T00:16:49.226078Z  INFO start:create_and_connect:create_agent{target=TargetConfig { path: Some(Pod(PodTarget { pod: "...", container: Some("...") })), namespace: Some("...") } config=Some(LayerConfig { accept_invalid_certificates: None, skip_processes: None, skip_build_tools: true, connect_tcp: None, operator: None, kubeconfig: None, sip_binaries: None, target: TargetConfig { path: Some(Pod(PodTarget { pod: "...", container: Some("...") })), namespace: Some("...") }, agent: AgentConfig { log_level: "info", json_log: false, namespace: Some("..."), image: AgentImageConfig("ghcr.io/metalbear-co/mirrord:3.128.0"), image_pull_policy: "IfNotPresent", image_pull_secrets: None, ttl: 1, ephemeral: false, communication_timeout: None, startup_timeout: 60, network_interface: None, flush_connections: true, disabled_capabilities: None, tolerations: None, resources: None, check_out_of_pods: true, privileged: true, nftables: false, dns: AgentDnsConfig { timeout: None, attempts: None }, labels: None, annotations: None, node_selector: None, service_account: None }, container: ContainerConfig { cli_image: "ghcr.io/metalbear-co/mirrord-cli:3.128.0", cli_extra_args: [], cli_prevent_cleanup: false, cli_image_lib_path: "/opt/mirrord/lib/libmirrord_layer.so" }, feature: FeatureConfig { env: EnvConfig { include: None, exclude: None, override: None, load_from_process: None, unset: None, env_file: None, mapping: None }, fs: FsConfig { mode: Read, read_write: None, read_only: None, local: Some(Multiple([".*.runfiles/.*", ".*.runfiles_manifest$"])), not_found: None, mapping: None }, network: NetworkConfig { incoming: IncomingConfig { port_mapping: {}, ignore_localhost: false, ignore_ports: {}, mode: Mirror, http_filter: HttpFilterConfig { header_filter: None, path_filter: None, all_of: None, any_of: None, ports: PortList(Multiple([80, 8080])) }, listen_ports: {}, on_concurrent_steal: Abort, ports: None }, outgoing: OutgoingConfig { tcp: true, udp: true, ignore_localhost: false, filter: None, unix_streams: None }, dns: DnsConfig { enabled: true, filter: None } }, copy_target: CopyTargetConfig { enabled: false, scale_down: false }, hostname: true, split_queues: SplitQueuesConfig({}) }, telemetry: true, kube_context: None, internal_proxy: InternalProxyConfig { connect_tcp: None, client_tls_certificate: None, client_tls_key: None, start_idle_timeout: 60, idle_timeout: 5, socket_timeout: 31536000, log_level: None, log_destination: None, container_mode: false }, external_proxy: ExternalProxyConfig { tls_enable: true, tls_certificate: None, tls_key: None, start_idle_timeout: 60, idle_timeout: 5, log_level: None, log_destination: None }, use_proxy: true, experimental: ExperimentalConfig { tcp_ping4_mock: true, readlink: false, trust_any_certificate: true, enable_exec_hooks_linux: true, hide_ipv6_interfaces: false, disable_reuseaddr: false, use_dev_null: true, readonly_file_buffer: 0 } }) tls_cert=None}: mirrord_kube::api::kubernetes: Created agent pod agent_connect_info=AgentKubernetesConnectInfo { pod_name: "mirrord-agent-rlinlprwbm-zkk7q", agent_port: 53056, namespace: Some("..."), agent_version: Some("3.128.0") }
2025-01-03T00:16:49.226222Z TRACE start:create_and_connect: mirrord_kube::api::kubernetes::portforwarder: port-forward to pod AgentKubernetesConnectInfo { pod_name: "mirrord-agent-rlinlprwbm-zkk7q", agent_port: 53056, namespace: Some("..."), agent_version: Some("3.128.0") }
2025-01-03T00:16:49.474332Z TRACE start:get_remote_env: mirrord::execution: Agent responded with the remote env remote_env= ...
2025-01-03T00:16:50.367974Z TRACE mirrord::execution: watch_stderr cancelled
2025-01-03T00:16:50.368064Z TRACE start:create_and_connect:wrap_raw_connection: mirrord_kube::api: No more client messages, disconnecting
2025-01-03T00:16:50.392543Z TRACE ThreadId(02) mirrord_layer::load: Loading into process: ..._ccbin invoked as ..._ccbin.
2025-01-03T00:16:50.398168Z TRACE ThreadId(02) mirrord_layer: hooked "close"
2025-01-03T00:16:50.398198Z TRACE ThreadId(02) mirrord_layer: hooked "__close_nocancel"
2025-01-03T00:16:50.398214Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.398220Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.398225Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libc.so.6", hooking
2025-01-03T00:16:50.398229Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398235Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libpthread.so.0", hooking
2025-01-03T00:16:50.398239Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.398244Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.398248Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398253Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "librt.so.1", hooking
2025-01-03T00:16:50.398257Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398269Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libm.so.6", hooking
2025-01-03T00:16:50.398274Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398279Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libdl.so.2", hooking
2025-01-03T00:16:50.398283Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.398289Z TRACE ThreadId(02) mirrord_layer::hooks: found "__close" in "libutil.so.1", hooking
2025-01-03T00:16:50.398293Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__close" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398313Z TRACE ThreadId(02) mirrord_layer: hooked "fork"
2025-01-03T00:16:50.398326Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "socket"
2025-01-03T00:16:50.398338Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "recvfrom"
2025-01-03T00:16:50.398348Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "sendto"
2025-01-03T00:16:50.398358Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "recvmsg"
2025-01-03T00:16:50.398371Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "sendmsg"
2025-01-03T00:16:50.398383Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "bind"
2025-01-03T00:16:50.398393Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "listen"
2025-01-03T00:16:50.398404Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "connect"
2025-01-03T00:16:50.398418Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "fcntl"
2025-01-03T00:16:50.398429Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "dup"
2025-01-03T00:16:50.398440Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "dup2"
2025-01-03T00:16:50.398451Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "getpeername"
2025-01-03T00:16:50.398462Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "getsockname"
2025-01-03T00:16:50.398471Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "gethostname"
2025-01-03T00:16:50.398484Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "accept4"
2025-01-03T00:16:50.398495Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "dup3"
2025-01-03T00:16:50.398505Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "accept"
2025-01-03T00:16:50.398518Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "gethostbyname"
2025-01-03T00:16:50.398531Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "getaddrinfo"
2025-01-03T00:16:50.398543Z TRACE ThreadId(02) mirrord_layer::socket::hooks: hooked "freeaddrinfo"
2025-01-03T00:16:50.398555Z TRACE ThreadId(02) mirrord_layer::exec_hooks::hooks: hooked "execv"
2025-01-03T00:16:50.398566Z TRACE ThreadId(02) mirrord_layer::exec_hooks::hooks: hooked "execve"
2025-01-03T00:16:50.398580Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "open"
2025-01-03T00:16:50.398587Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.398594Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.398599Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libc.so.6", hooking
2025-01-03T00:16:50.398603Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398608Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libpthread.so.0", hooking
2025-01-03T00:16:50.398612Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.398617Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.398622Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398627Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "librt.so.1", hooking
2025-01-03T00:16:50.398631Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398636Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libm.so.6", hooking
2025-01-03T00:16:50.398640Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398645Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libdl.so.2", hooking
2025-01-03T00:16:50.398649Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.398654Z TRACE ThreadId(02) mirrord_layer::hooks: found "open64" in "libutil.so.1", hooking
2025-01-03T00:16:50.398658Z TRACE ThreadId(02) mirrord_layer::hooks: hook "open64" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398671Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "openat"
2025-01-03T00:16:50.398678Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.398682Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.398687Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libc.so.6", hooking
2025-01-03T00:16:50.398691Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398696Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libpthread.so.0", hooking
2025-01-03T00:16:50.398700Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.398705Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.398709Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398714Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "librt.so.1", hooking
2025-01-03T00:16:50.398718Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398725Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libm.so.6", hooking
2025-01-03T00:16:50.398730Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398735Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libdl.so.2", hooking
2025-01-03T00:16:50.398739Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.398744Z TRACE ThreadId(02) mirrord_layer::hooks: found "openat64" in "libutil.so.1", hooking
2025-01-03T00:16:50.398748Z TRACE ThreadId(02) mirrord_layer::hooks: hook "openat64" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.398760Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "read"
2025-01-03T00:16:50.398774Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "closedir"
2025-01-03T00:16:50.398785Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "dirfd"
2025-01-03T00:16:50.398799Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "pread"
2025-01-03T00:16:50.398810Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "readv"
2025-01-03T00:16:50.398820Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "preadv"
2025-01-03T00:16:50.398832Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "readlink"
2025-01-03T00:16:50.398843Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "mkdir"
2025-01-03T00:16:50.398855Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "mkdirat"
2025-01-03T00:16:50.398865Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "lseek"
2025-01-03T00:16:50.398876Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "write"
2025-01-03T00:16:50.398887Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "pwrite"
2025-01-03T00:16:50.398899Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "access"
2025-01-03T00:16:50.398909Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "faccessat"
2025-01-03T00:16:50.398919Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "fsync"
2025-01-03T00:16:50.398930Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "fdatasync"
2025-01-03T00:16:50.398942Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "realpath"
2025-01-03T00:16:50.398954Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "statx"
2025-01-03T00:16:50.398965Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "__xstat"
2025-01-03T00:16:50.398972Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.398976Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.398981Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libc.so.6", hooking
2025-01-03T00:16:50.398985Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.398992Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libpthread.so.0", hooking
2025-01-03T00:16:50.398996Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.399002Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.399006Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399011Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "librt.so.1", hooking
2025-01-03T00:16:50.399015Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399020Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libm.so.6", hooking
2025-01-03T00:16:50.399024Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399029Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libdl.so.2", hooking
2025-01-03T00:16:50.399033Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.399038Z TRACE ThreadId(02) mirrord_layer::hooks: found "__xstat64" in "libutil.so.1", hooking
2025-01-03T00:16:50.399042Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__xstat64" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399054Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "__lxstat"
2025-01-03T00:16:50.399059Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.399064Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.399069Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libc.so.6", hooking
2025-01-03T00:16:50.399073Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399078Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libpthread.so.0", hooking
2025-01-03T00:16:50.399082Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.399087Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.399091Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399096Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "librt.so.1", hooking
2025-01-03T00:16:50.399100Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399105Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libm.so.6", hooking
2025-01-03T00:16:50.399109Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399114Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libdl.so.2", hooking
2025-01-03T00:16:50.399120Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.399125Z TRACE ThreadId(02) mirrord_layer::hooks: found "__lxstat64" in "libutil.so.1", hooking
2025-01-03T00:16:50.399129Z TRACE ThreadId(02) mirrord_layer::hooks: hook "__lxstat64" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399140Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "lstat"
2025-01-03T00:16:50.399150Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "fstat"
2025-01-03T00:16:50.399160Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "stat"
2025-01-03T00:16:50.399171Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "fstatat"
2025-01-03T00:16:50.399182Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "fstatfs"
2025-01-03T00:16:50.399192Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "fdopendir"
2025-01-03T00:16:50.399203Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "readdir_r"
2025-01-03T00:16:50.399209Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.399213Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.399218Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libc.so.6", hooking
2025-01-03T00:16:50.399223Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399228Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libpthread.so.0", hooking
2025-01-03T00:16:50.399232Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.399237Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.399241Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399246Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "librt.so.1", hooking
2025-01-03T00:16:50.399250Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399255Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libm.so.6", hooking
2025-01-03T00:16:50.399260Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399264Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libdl.so.2", hooking
2025-01-03T00:16:50.399269Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.399274Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir64_r" in "libutil.so.1", hooking
2025-01-03T00:16:50.399278Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir64_r" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399291Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "readdir64"
2025-01-03T00:16:50.399297Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libpython3.9.so.1.0", hooking
2025-01-03T00:16:50.399301Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libpython3.9.so.1.0" failed with err Function already replaced
2025-01-03T00:16:50.399306Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libc.so.6", hooking
2025-01-03T00:16:50.399311Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libc.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399316Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libpthread.so.0", hooking
2025-01-03T00:16:50.399320Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libpthread.so.0" failed with err Function already replaced
2025-01-03T00:16:50.399325Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libgcc_s.so.1", hooking
2025-01-03T00:16:50.399329Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libgcc_s.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399334Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "librt.so.1", hooking
2025-01-03T00:16:50.399338Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "librt.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399343Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libm.so.6", hooking
2025-01-03T00:16:50.399347Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libm.so.6" failed with err Function already replaced
2025-01-03T00:16:50.399352Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libdl.so.2", hooking
2025-01-03T00:16:50.399356Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libdl.so.2" failed with err Function already replaced
2025-01-03T00:16:50.399361Z TRACE ThreadId(02) mirrord_layer::hooks: found "readdir" in "libutil.so.1", hooking
2025-01-03T00:16:50.399366Z TRACE ThreadId(02) mirrord_layer::hooks: hook "readdir" in "libutil.so.1" failed with err Function already replaced
2025-01-03T00:16:50.399376Z TRACE ThreadId(02) mirrord_layer::file::hooks: hooked "opendir"
2025-01-03T00:16:50.399756Z  INFO ThreadId(02) mirrord_layer: Initializing mirrord-layer!
2025-01-03T00:16:50.399942Z DEBUG ThreadId(02) mirrord_layer: Loaded into executable executable=Some("...ccbin") args=Some(ExecuteArgs { exec_name: "...ccbin", invoked_as: "...ccbin", args: ["...ccbin", "--run_dir", "/rundir", "--resolved_workspace", "/root/workspace/workspace.pb.txt", "--log_level", "INFO"] }) pid=1177389 parent_pid=1171540 env_vars=Vars { inner: ...
2025-01-03T00:16:50.401298Z TRACE ThreadId(02) mirrord_layer::file::hooks: path Success(
    "/home/zack/.cache/bazel/_bazel_zack/.../pyvenv.cfg",
) | open_options OpenOptionsInternal {
    read: true,
    write: false,
    append: false,
    truncate: false,
    create: false,
    create_new: false,
}

After the service begins, I repeatedly see this log. I expect the service to be serving on :10010


2025-01-03T00:18:08.421680Z TRACE ThreadId(03) mirrord_layer::socket::ops: in connect LazyLock(
    Mutex {
        data: {
            12: UserSocket {
                domain: 2,
                type_: 1,
                protocol: 0,
                state: Listening(
                    Bound {
                        requested_address: 0.0.0.0:10010,
                        address: 0.0.0.0:10010,
                    },
                ),
                kind: Tcp(
                    1,
                ),
            },
            16: UserSocket {
                domain: 1,
                type_: 524289,
                protocol: 0,
                state: Initialized,
                kind: Tcp(
                    524289,
                ),
            },
            9: UserSocket {
                domain: 2,
                type_: 524289,
                protocol: 0,
                state: Listening(
                    Bound {
                        requested_address: 0.0.0.0:9000,
                        address: 0.0.0.0:9000,
                    },
                ),
                kind: Tcp(
                    524289,
                ),
            },
            15: UserSocket {
                domain: 2,
                type_: 524289,
                protocol: 0,
                state: Connected(
                    Connected {
                        remote_address: Ip(
                            52.218.185.57:443,
                        ),
                        local_address: Ip(
                            10.10.39.115:42654,
                        ),
                        layer_address: Some(
                            Ip(
                                127.0.0.1:43875,
                            ),
                        ),
                    },
                ),
                kind: Tcp(
                    524289,
                ),
            },
            13: UserSocket {
                domain: 2,
                type_: 524289,
                protocol: 0,
                state: Connected(
                    Connected {
                        remote_address: Ip(
                            169.254.169.254:80,
                        ),
                        local_address: Ip(
                            10.10.39.115:59038,
                        ),
                        layer_address: Some(
                            Ip(
                                127.0.0.1:35321,
                            ),
                        ),
                    },
                ),
                kind: Tcp(
                    524289,
                ),
            },
            14: UserSocket {
                domain: 2,
                type_: 1,
                protocol: 0,
                state: Listening(
                    Bound {
                        requested_address: 0.0.0.0:10000,
                        address: 0.0.0.0:10000,
                    },
                ),
                kind: Tcp(
                    1,
                ),
            },
        },
        poisoned: false,
        ..
    },
)

mirrord intproxy logs

  2025-01-03T00:16:50.400598Z  INFO mirrord_intproxy::layer_initializer: new session, process_info: ProcessInfo { pid: 1177389, name: "..._ccbin", cmdline: ["..._ccbin", "--run_dir", "/rundir", "--resolved_workspace", "/root/workspace/workspace.pb.txt", "--log_level", "INFO"], loaded: true }
    at mirrord/intproxy/src/layer_initializer.rs:63

  2025-01-03T00:17:13.243504Z  INFO mirrord_intproxy::layer_initializer: new session, process_info: ProcessInfo { pid: 1177490, name: "uname", cmdline: ["uname", "-p"], loaded: true }
    at mirrord/intproxy/src/layer_initializer.rs:63

mirrord agent logs

agent ready - version 3.128.0
  2025-01-02T21:59:01.752731Z  WARN mirrord_agent::outgoing::udp: interceptor_task -> no messages left
    at mirrord/agent/src/outgoing/udp.rs:225 on ThreadId(7)

  2025-01-02T21:59:07.710225Z  WARN mirrord_agent::outgoing::udp: LayerUdpOutgoing::Write -> Failed with RemoteIO(
    RemoteIOError {
        raw_os_error: Some(
            111,
        ),
        kind: ConnectionRefused,
    },
)
    at mirrord/agent/src/outgoing/udp.rs:181 on ThreadId(9)

mirrord config

{
    "agent": {
        "privileged": true
    },
    "experimental": {
        "trust_any_certificate": true
    },
    "feature": {
        "fs": {
            "local": [
                ".*.runfiles\/.*",
                ".*.runfiles_manifest$"
            ]
        }
    }
}

mirrord CLI version

3.128.0

mirrord-agent version

3.128.0

mirrord-operator version (if relevant)

No response

plugin kind and version (if relevant)

No response

Your operating system and version

Ubuntu 22.04.2 LTS

Local process

ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=a83e70e25eebc70926938d868e78b474efaa369c, not stripped

Local process version

No response

Additional Info

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

Havent tried with purely mirroring yet but my most recent testing has been with steal https://github.com/metalbear-co/mirrord/issues/3002#issuecomment-2741091785 maybe it was helped by another change that was made?

I can revisit this thread after trying mirroring out as well

Hey Zack, sorry it takes so long. We’ve been heavily occupied with other stuff 😅

The good news is I started implementing a solution for this

@gememma @aviramha any updates on this issue? I see the linked issues but its unclear to me if this might land in the next few weeks, or if it may take months

Hey, we think this will be fixed in the next few weeks. We’ll keep you posted if our estimate changes. Thanks for patience 😅

Debugged with the user- stealing works, mirroring doesn’t I am quite confident this happens due to our “new request” detection not working in that scenario, probably because no connections are made (linkerd keeps the connections up) and we don’t detect new gRPC requests within existing connection