From 7adb66cf4ce92100f721de4e562c40bfa339bdeb Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Tue, 12 Oct 2021 17:04:36 -0600 Subject: [PATCH] add spantrace debug logs --- appmgr/src/bin/embassy-init.rs | 8 ++++++-- appmgr/src/bin/embassyd.rs | 1 + appmgr/src/db/mod.rs | 5 ++++- appmgr/src/install/mod.rs | 2 ++ appmgr/src/manager/mod.rs | 7 +++++-- appmgr/src/net/tor.rs | 1 + appmgr/src/net/wifi.rs | 1 + appmgr/src/setup.rs | 1 + appmgr/src/shutdown.rs | 4 ++++ appmgr/src/sound.rs | 3 ++- 10 files changed, 27 insertions(+), 6 deletions(-) diff --git a/appmgr/src/bin/embassy-init.rs b/appmgr/src/bin/embassy-init.rs index 891d04f1c..2d1e34dda 100644 --- a/appmgr/src/bin/embassy-init.rs +++ b/appmgr/src/bin/embassy-init.rs @@ -181,10 +181,14 @@ async fn run_script_if_exists>(path: P) { match Command::new("/bin/bash").arg(script).spawn() { Ok(mut c) => { if let Err(e) = c.wait().await { - tracing::error!("Error Running {}: {}", script.display(), e) + tracing::error!("Error Running {}: {}", script.display(), e); + tracing::debug!("{:?}", e); } } - Err(e) => tracing::error!("Error Running {}: {}", script.display(), e), + Err(e) => { + tracing::error!("Error Running {}: {}", script.display(), e); + tracing::debug!("{:?}", e); + } } } } diff --git a/appmgr/src/bin/embassyd.rs b/appmgr/src/bin/embassyd.rs index 679a4ac12..5b497ae97 100644 --- a/appmgr/src/bin/embassyd.rs +++ b/appmgr/src/bin/embassyd.rs @@ -28,6 +28,7 @@ fn status_fn(_: i32) -> StatusCode { fn err_to_500(e: Error) -> Response { tracing::error!("{}", e); + tracing::debug!("{:?}", e); Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .body(Body::empty()) diff --git a/appmgr/src/db/mod.rs b/appmgr/src/db/mod.rs index 2ef3b0752..88fdb3c73 100644 --- a/appmgr/src/db/mod.rs +++ b/appmgr/src/db/mod.rs @@ -157,7 +157,10 @@ pub async fn subscribe(ctx: RpcContext, req: Request) -> Result (), - Err(e) => tracing::error!("WebSocket Closed: {}", e), + Err(e) => { + tracing::error!("WebSocket Closed: {}", e); + tracing::debug!("{:?}", e); + } } }); } diff --git a/appmgr/src/install/mod.rs b/appmgr/src/install/mod.rs index 9d4b17104..d5011936f 100644 --- a/appmgr/src/install/mod.rs +++ b/appmgr/src/install/mod.rs @@ -116,6 +116,7 @@ pub async fn install( tokio::spawn(async move { if let Err(e) = download_install_s9pk(&ctx, &man, s9pk).await { tracing::error!("Install of {}@{} Failed: {}", man.id, man.version, e); + tracing::debug!("{:?}", e); } }); @@ -276,6 +277,7 @@ pub async fn download_install_s9pk( version, e ); + tracing::debug!("{:?}", e); let mut broken = crate::db::DatabaseModel::new() .broken_packages() .get_mut(&mut tx) diff --git a/appmgr/src/manager/mod.rs b/appmgr/src/manager/mod.rs index abef607eb..bc113120c 100644 --- a/appmgr/src/manager/mod.rs +++ b/appmgr/src/manager/mod.rs @@ -91,6 +91,7 @@ impl ManagerMap { if let Some(man) = self.0.write().await.remove(id) { if let Err(e) = man.exit().await { tracing::error!("Error shutting down manager: {}", e); + tracing::debug!("{:?}", e); } } } @@ -325,13 +326,15 @@ impl Manager { Err(e) => { // TODO for code review: Do we return this error or just log it? tracing::error!("Failed to issue notification: {}", e); + tracing::debug!("{:?}", e); } Ok(()) => {} } - tracing::error!("service crashed: {}: {}", e.0, e.1) + tracing::error!("service crashed: {}: {}", e.0, e.1); } Err(e) => { - tracing::error!("failed to start service: {}", e) + tracing::error!("failed to start service: {}", e); + tracing::debug!("{:?}", e); } } } diff --git a/appmgr/src/net/tor.rs b/appmgr/src/net/tor.rs index 12c7443c7..dceb669db 100644 --- a/appmgr/src/net/tor.rs +++ b/appmgr/src/net/tor.rs @@ -389,6 +389,7 @@ pub async fn tor_health_check(client: &Client, tor_controller: &TorController) { } Err(e) => { tracing::error!("Unable to restart tor: {}", e); + tracing::debug!("{:?}", e); } } } diff --git a/appmgr/src/net/wifi.rs b/appmgr/src/net/wifi.rs index b99daa866..5e1fe34fd 100644 --- a/appmgr/src/net/wifi.rs +++ b/appmgr/src/net/wifi.rs @@ -68,6 +68,7 @@ pub async fn add( match add_procedure(wpa_supplicant, &ssid, &password, priority, connect).await { Err(e) => { tracing::error!("Failed to add new WiFi network '{}': {}", ssid, e); + tracing::debug!("{:?}", e); } Ok(_) => {} } diff --git a/appmgr/src/setup.rs b/appmgr/src/setup.rs index b43a1359b..818a7b82c 100644 --- a/appmgr/src/setup.rs +++ b/appmgr/src/setup.rs @@ -183,6 +183,7 @@ pub async fn execute_inner( if let Err(e) = recover(ctx.clone(), guid, recovery_drive, recovery_password).await { BEETHOVEN.play().await.unwrap_or_default(); // ignore error in playing the song tracing::error!("Error recovering drive!: {}", e); + tracing::debug!("{:?}", e); *ctx.recovery_status.write().await = Some(Err(e.into())); } }); diff --git a/appmgr/src/shutdown.rs b/appmgr/src/shutdown.rs index c897fa772..8db8d1f0a 100644 --- a/appmgr/src/shutdown.rs +++ b/appmgr/src/shutdown.rs @@ -34,6 +34,7 @@ impl Shutdown { .await { tracing::error!("Error Stopping Journald: {}", e); + tracing::debug!("{:?}", e); } if let Err(e) = Command::new("systemctl") .arg("stop") @@ -42,12 +43,15 @@ impl Shutdown { .await { tracing::error!("Error Stopping Docker: {}", e); + tracing::debug!("{:?}", e); } if let Err(e) = export(&*self.zfs_pool).await { tracing::error!("Error Exporting ZFS Pool: {}", e); + tracing::debug!("{:?}", e); } if let Err(e) = MARIO_DEATH.play().await { tracing::error!("Error Playing Shutdown Song: {}", e); + tracing::debug!("{:?}", e); } }); if self.restart { diff --git a/appmgr/src/sound.rs b/appmgr/src/sound.rs index ff2122a4b..deaef05c0 100644 --- a/appmgr/src/sound.rs +++ b/appmgr/src/sound.rs @@ -138,7 +138,8 @@ impl Drop for SoundInterface { let guard = self.0.take(); tokio::spawn(async move { if let Err(e) = tokio::fs::write(&*UNEXPORT_FILE, "0").await { - tracing::error!("Failed to Unexport Sound Interface: {}", e) + tracing::error!("Failed to Unexport Sound Interface: {}", e); + tracing::debug!("{:?}", e); } if let Some(mut guard) = guard { if let Some(lock) = guard.take() {