diff --git a/ecstore/src/config/common.rs b/ecstore/src/config/common.rs index d5d44b44d..eb9d65a4b 100644 --- a/ecstore/src/config/common.rs +++ b/ecstore/src/config/common.rs @@ -13,7 +13,7 @@ use http::HeaderMap; use lazy_static::lazy_static; use s3s::dto::StreamingBlob; use s3s::Body; -use tracing::error; +use tracing::{error, warn}; pub const CONFIG_PREFIX: &str = "config"; const CONFIG_FILE: &str = "config.json"; @@ -101,9 +101,12 @@ pub async fn read_config_without_migrate(api: &ECStore) -> Result { Ok(res) => res, Err(err) => { if is_not_found(&err) { + warn!("config not found init start"); let cfg = new_and_save_server_config(api).await?; + warn!("config not found init done"); return Ok(cfg); } else { + error!("read config err {:?}", &err); return Err(err); } } @@ -120,9 +123,12 @@ async fn read_server_config(api: &ECStore, data: &[u8]) -> Result { Ok(res) => res, Err(err) => { if is_not_found(&err) { + warn!("config not found init start"); let cfg = new_and_save_server_config(api).await?; + warn!("config not found init done"); return Ok(cfg); } else { + error!("read config err {:?}", &err); return Err(err); } } diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 361982c34..381ce46af 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -24,7 +24,7 @@ use service::hybrid; use std::{io::IsTerminal, net::SocketAddr, str::FromStr}; use tokio::net::TcpListener; use tonic::{metadata::MetadataValue, Request, Status}; -use tracing::{debug, info}; +use tracing::{debug, error, info, warn}; use tracing_error::ErrorLayer; use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt}; @@ -134,7 +134,6 @@ async fn run(opt: config::Opt) -> Result<()> { }; let rpc_service = NodeServiceServer::with_interceptor(make_server(), check_auth); - info!(" init store success!"); tokio::spawn(async move { let hyper_service = service.into_shared(); @@ -184,7 +183,11 @@ async fn run(opt: config::Opt) -> Result<()> { .await .map_err(|err| Error::from_string(err.to_string()))?; - store.init().await.map_err(|err| Error::from_string(err.to_string()))?; + store.init().await.map_err(|err| { + error!("init faild {:?}", &err); + Error::from_string(err.to_string()) + })?; + warn!(" init store success!"); // init scanner init_data_scanner().await; diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index 53c1b3e6c..93d327982 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -15,7 +15,6 @@ use ecstore::bucket::policy_sys::PolicySys; use ecstore::bucket::tagging::decode_tags; use ecstore::bucket::tagging::encode_tags; use ecstore::bucket::versioning_sys::BucketVersioningSys; -use ecstore::disk::error::DiskError; use ecstore::new_object_layer_fn; use ecstore::options::extract_metadata; use ecstore::options::put_opts; @@ -46,7 +45,6 @@ use s3s::S3; use s3s::{S3Request, S3Response}; use std::fmt::Debug; use std::str::FromStr; -use tracing::debug; use tracing::error; use tracing::info; use transform_stream::AsyncTryStream;