metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.75k stars 101 forks source link

analytics fails on certificate access? #2783

Open aviramha opened 4 days ago

aviramha commented 4 days ago

To reproduce:

RUST_BACKTRACE=full MIRRORD_PROGRESS_MODE=off RUST_LOG=mirrord=trace mirrord exec -t deployment/ip-visit-counter ./sha2.sh

Logs:

2024-09-27T15:20:07.198345Z TRACE start: mirrord_sip::main: Checking the SIP status of ./sha2.sh (or of the binary in its shebang, if applicable) failed with FileNotFound("./sha2.sh"). Continuing without SIP-sidestepping.This is not necessarily an error.
2024-09-27T15:20:07.199366Z ERROR mirrord: Couldn't execute Errno(Errno { code: 2, description: Some("No such file or directory") })
2024-09-27T15:20:07.199501Z TRACE mirrord::execution: watch_stderr finished
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.12.5/src/async_impl/client.rs:1901:38:
Client::new(): reqwest::Error { kind: Builder, source: Custom { kind: NotFound, error: "could not load certs from dir /etc/ssl/certs/ca-certificates.crt: No such file or directory (os error 2)" } }
stack backtrace:
   0:        0x105a7f294 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd504cdf75dd790a5
   1:        0x105aa2eac - core::fmt::write::h5707604b140ad434
   2:        0x105a7b32c - std::io::Write::write_fmt::h4786975223352ad5
   3:        0x105a7f0ec - std::sys_common::backtrace::print::hbbeb9ed95a7b80ec
   4:        0x105a8082c - std::panicking::default_hook::{{closure}}::h9824320c6941fbee
   5:        0x105a8051c - std::panicking::default_hook::h9842bf3cae562040
   6:        0x105a810fc - std::panicking::rust_panic_with_hook::h83d90448f6646b96
   7:        0x105a80b18 - std::panicking::begin_panic_handler::{{closure}}::hf0c46de292f71ea2
   8:        0x105a7f724 - std::sys_common::backtrace::__rust_end_short_backtrace::h19b73a882a1ec51f
   9:        0x105a80884 - _rust_begin_unwind
  10:        0x105af4384 - core::panicking::panic_fmt::h5317ec8667b1cbec
  11:        0x105af4708 - core::result::unwrap_failed::h217ba6ef626fc10a
  12:        0x105475dfc - <reqwest::async_impl::client::Client as core::default::Default>::default::hf57e83cc782d88cb
  13:        0x1053f1928 - <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll::h814e37c1f5112c2e
  14:        0x1053ee23c - <mirrord_analytics::AnalyticsReporter as core::ops::drop::Drop>::drop::{{closure}}::h4de94e8426f1a031
  15:        0x1053eddc4 - tokio::runtime::task::core::Core<T,S>::poll::h03f9b3b40bf7b246
  16:        0x1053fbb50 - tokio::runtime::task::harness::Harness<T,S>::poll::hecb794b564fc5099
  17:        0x104d5a7cc - tokio::runtime::scheduler::current_thread::Context::enter::hdece761f632c71c0
  18:        0x104f0eff8 - tokio::runtime::context::scoped::Scoped<T>::set::hae9abe92c267b491
  19:        0x104e3dc5c - tokio::runtime::context::set_scheduler::h123108e7126cf435
  20:        0x104d6df38 - mirrord::main::heef16227dda6075d
  21:        0x104f4b0ec - std::sys_common::backtrace::__rust_begin_short_backtrace::h77d3657619d5e245
  22:        0x104ee9d20 - std::rt::lang_start::{{closure}}::h48d0474fc67780db
  23:        0x105a73a5c - std::rt::lang_start_internal::h9fea95fc6a17b76c
  24:        0x104d86468 - _main

(sha2.sh need not exist)

linear[bot] commented 4 days ago

MBE-420 analytics fails on certificate access?

gememma commented 2 days ago

Additional repro info: bug occurs when env var SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt" in remote - to reproduce:

RUST_BACKTRACE=full MIRRORD_PROGRESS_MODE=off RUST_LOG=mirrord=trace mirrord exec -f mirrord.yaml -t deployment/ip-visit-counter ./sha2.sh

with mirrord.yaml:

{
  "feature": {
    "env": {
      "override": {
        "SSL_CERT_FILE": "/etc/ssl/certs/ca-certificates.crt"
      }
    }
  }
}