Fraunhofer-AISEC / ids-clearing-house-service

This is an implementation of the IDS Clearing House
Apache License 2.0
0 stars 11 forks source link

Error in clearing-house-api when writing a log #8

Closed sebplorenz closed 2 years ago

sebplorenz commented 2 years ago
[2022-02-03][07:56:21][rocket::server][INFO] POST /messages/log/881ae112-912e-474f-aade-d5cbf0cec09d application/json:
[2022-02-03][07:56:21][_][INFO] Matched: (log) POST /messages/log/<pid> application/json
[2022-02-03][07:56:21][core_lib::api::auth][DEBUG] ...found cached jwks
[2022-02-03][07:56:21][core_lib::api::auth][DEBUG] ...valid token!
[2022-02-03][07:56:21][ch_lib::db][DEBUG] Trying to get process with id 881ae112-912e-474f-aade-d5cbf0cec09d...
[2022-02-03][07:56:21][ch_lib::db][DEBUG] ... found it.
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] Requested pid '881ae112-912e-474f-aade-d5cbf0cec09d' exists. Nothing to create.
[2022-02-03][07:56:21][ch_lib::db][DEBUG] checking if user 'C8:8C:5E:15:AE:D2:4D:E0:CA:30:D5:34:35:CC:78:81:14:34:24:24:keyid:C8:8C:5E:15:AE:D2:4D:E0:CA:30:D5:34:35:CC:78:81:14:34:24:24' is authorized to access '881ae112-912e-474f-aade-d5cbf0cec09d'
[2022-02-03][07:56:21][ch_lib::db][DEBUG] Trying to get process with id 881ae112-912e-474f-aade-d5cbf0cec09d...
[2022-02-03][07:56:21][ch_lib::db][DEBUG] ... found it.
[2022-02-03][07:56:21][ch_lib::db][DEBUG] found owner C8:8C:5E:15:AE:D2:4D:E0:CA:30:D5:34:35:CC:78:81:14:34:24:24:keyid:C8:8C:5E:15:AE:D2:4D:E0:CA:30:D5:34:35:CC:78:81:14:34:24:24
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][INFO] User authorized.
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] logging message for pid 881ae112-912e-474f-aade-d5cbf0cec09d
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] transforming message to document...
[2022-02-03][07:56:21][ch_lib::db][DEBUG] Getting transaction counter...
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] Storing document...
[2022-02-03][07:56:21][core_lib::api::client::document_api][DEBUG] calling http://document-api:8001/doc
[2022-02-03][07:56:21][hyper::client::connect::dns][DEBUG] resolving host="document-api"
[2022-02-03][07:56:21][hyper::client::connect::http][DEBUG] connecting to 172.22.0.11:8001
[2022-02-03][07:56:21][tokio_reactor][DEBUG] adding I/O source: 0
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Write for: 0
[2022-02-03][07:56:21][hyper::client::connect::http][DEBUG] connected to Some(172.22.0.11:8001)
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Read for: 0
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Read for: 0
[2022-02-03][07:56:21][hyper::proto::h1::io][DEBUG] flushed 1614 bytes
[2022-02-03][07:56:21][hyper::proto::h1::io][DEBUG] flushed 2863 bytes
[2022-02-03][07:56:21][hyper::proto::h1::io][DEBUG] read 366 bytes
[2022-02-03][07:56:21][hyper::proto::h1::io][DEBUG] parsed 7 headers
[2022-02-03][07:56:21][hyper::proto::h1::conn][DEBUG] incoming body is content-length (134 bytes)
[2022-02-03][07:56:21][hyper::proto::h1::conn][DEBUG] incoming body completed
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Read for: 0
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Read for: 0
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Read for: 0
[2022-02-03][07:56:21][hyper::client::pool][DEBUG] pooling idle connection for "http://document-api:8001"
[2022-02-03][07:56:21][reqwest::async_impl::response][DEBUG] Response: '201 Created' for http://document-api:8001/doc
[2022-02-03][07:56:21][tokio_reactor::registration][DEBUG] scheduling Read for: 0
[2022-02-03][07:56:21][core_lib::api::client::document_api][DEBUG] Status Code: 201 Created
Payload: DocumentReceipt { timestamp: 1643874981, pid: "881ae112-912e-474f-aade-d5cbf0cec09d", doc_id: "eb90ed87-96e3-4436-94f2-2cb6dcf09a9a", chain_hash: "0" }
[2022-02-03][07:56:21][tokio_reactor][DEBUG] dropping I/O source: 0
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] Increase transabtion counter
[2022-02-03][07:56:21][ch_lib::db][DEBUG] Getting transaction counter...
thread 'rocket-worker-thread' panicked at 'called `Result::unwrap()` on an `Err` value: IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })', ch-lib/src/crypto.rs:37:73
stack backtrace:
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] Creating receipt...
[2022-02-03][07:56:21][clearing_house_api::clearing_house_api][DEBUG] ...done. Signing receipt...
   0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::result::unwrap_failed
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/result.rs:1613:5
   3: ch_lib::crypto::get_fingerprint
   4: ch_lib::model::DataTransaction::sign
   5: clearing_house_api::clearing_house_api::log_message::{{closure}}
   6: clearing_house_api::clearing_house_api::log::into_info::monomorphized_function::{{closure}}
   7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  10: tokio::runtime::task::harness::Harness<T,S>::poll
  11: std::thread::local::LocalKey<T>::with
  12: tokio::runtime::thread_pool::worker::Context::run_task
  13: tokio::runtime::thread_pool::worker::Context::run
  14: tokio::macros::scoped_tls::ScopedKey<T>::set
  15: tokio::runtime::thread_pool::worker::run
  16: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  17: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  18: tokio::runtime::task::harness::Harness<T,S>::poll
  19: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[2022-02-03][07:56:21][_][ERROR] Handler log panicked.
[2022-02-03][07:56:21][_][INFO] This is an application bug.
[2022-02-03][07:56:21][_][INFO] A panic in Rust must be treated as an exceptional event.
[2022-02-03][07:56:21][_][INFO] Panicking is not a suitable error handling mechanism.
[2022-02-03][07:56:21][_][INFO] Unwinding, the result of a panic, is an expensive operation.
[2022-02-03][07:56:21][_][INFO] Panics will severely degrade application performance.
[2022-02-03][07:56:21][_][INFO] Instead of panicking, return `Option` and/or `Result`.
[2022-02-03][07:56:21][_][INFO] Values of either type can be returned directly from handlers.
[2022-02-03][07:56:21][_][WARN] A panic is treated as an internal server error.
[2022-02-03][07:56:21][_][INFO] Outcome: Failure
[2022-02-03][07:56:21][_][WARN] No 500 catcher registered. Using Rocket default.
[2022-02-03][07:56:21][_][INFO] Response succeeded.
kragall commented 2 years ago

This error is most likely due to your configuration missing a signing_key as described here.