Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI error with maintenance subcommand #4

Closed
garyhodgson opened this issue Feb 27, 2024 · 2 comments
Closed

CLI error with maintenance subcommand #4

garyhodgson opened this issue Feb 27, 2024 · 2 comments

Comments

@garyhodgson
Copy link

Hi, when I try and use the cli maintenance commands I receive the following error:

$ kuma -V
kuma-cli v0.3.0

$ RUST_BACKTRACE=full kuma maintenance list
thread 'tokio-runtime-worker' panicked at /home/runner/work/AutoKuma/AutoKuma/kuma-client/src/client.rs:164:74:
called `Result::unwrap()` on an `Err` value: Error("missing field `seconds`", line: 0, column: 0)
stack backtrace:
   0:     0x5569cf84a43c - std::backtrace_rs::backtrace::libunwind::trace::ha637c64ce894333a
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x5569cf84a43c - std::backtrace_rs::backtrace::trace_unsynchronized::h47f62dea28e0c88d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5569cf84a43c - std::sys_common::backtrace::_print_fmt::h9eef0abe20ede486
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x5569cf84a43c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed7f999df88cc644
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5569cf8752e0 - core::fmt::rt::Argument::fmt::h1539a9308b8d058d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/rt.rs:142:9
   5:     0x5569cf8752e0 - core::fmt::write::h3a39390d8560d9c9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/mod.rs:1120:17
   6:     0x5569cf84783f - std::io::Write::write_fmt::h5fc9997dfe05f882
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/io/mod.rs:1762:15
   7:     0x5569cf84a224 - std::sys_common::backtrace::_print::h894006fb5c6f3d45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x5569cf84a224 - std::sys_common::backtrace::print::h23a2d212c6fff936
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x5569cf84b827 - std::panicking::default_hook::{{closure}}::h8a1d2ee00185001a
  10:     0x5569cf84b58f - std::panicking::default_hook::h6038f2eba384e475
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:292:9
  11:     0x5569cf84bca8 - std::panicking::rust_panic_with_hook::h2b5517d590cab22e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:779:13
  12:     0x5569cf84bb8e - std::panicking::begin_panic_handler::{{closure}}::h233112c06e0ef43e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:657:13
  13:     0x5569cf84a906 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e893f24d7ebbff8
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:170:18
  14:     0x5569cf84b8f2 - rust_begin_unwind
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
  15:     0x5569cf1f9615 - core::panicking::panic_fmt::hbf0e066aabfa482c
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
  16:     0x5569cf1f9b53 - core::result::unwrap_failed::hddb4fea594200c52
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/result.rs:1653:5
  17:     0x5569cf4242e6 - kuma_client::client::Worker::on_event::{{closure}}::h9dde7b2503c77e33
  18:     0x5569cf42257c - kuma_client::client::Worker::connect::{{closure}}::{{closure}}::{{closure}}::{{closure}}::h1bbf8e2108d36c65
  19:     0x5569cf42bd83 - std::panicking::try::h58b887778e4a6d97
  20:     0x5569cf3da27f - tokio::runtime::task::raw::poll::hcce0c37e91cb1228
  21:     0x5569cf79d3fe - tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h6601dff3ae59fea3
  22:     0x5569cf79c6d0 - tokio::runtime::scheduler::multi_thread::worker::Context::run::h321945b643c5c9bb
  23:     0x5569cf78ebd2 - tokio::runtime::context::set_scheduler::h7e1edb7e613bec59
  24:     0x5569cf7a82cf - tokio::runtime::context::runtime::enter_runtime::h6fe05d1e37dafe8c
  25:     0x5569cf79bc28 - tokio::runtime::scheduler::multi_thread::worker::run::h435e4403b269edf6
  26:     0x5569cf7a1133 - <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::h942d4ce1bbe242aa
  27:     0x5569cf7978e7 - tokio::runtime::task::core::Core<T,S>::poll::h8cc78bcc308d4550
  28:     0x5569cf78b7da - tokio::runtime::task::harness::Harness<T,S>::poll::h55a0209ea794a729
  29:     0x5569cf7942a9 - tokio::runtime::blocking::pool::Inner::run::hc8b201dc38a94b0a
  30:     0x5569cf7a13a7 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8989d497d1c9a9d9
  31:     0x5569cf78ddb9 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7fdc36c331a42c79
  32:     0x5569cf84ec05 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc7eafaff61e32df9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
  33:     0x5569cf84ec05 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6ba4a5de48dd2304
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
  34:     0x5569cf84ec05 - std::sys::unix::thread::Thread::new::thread_start::he469335aef763e45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/thread.rs:108:17
  35:     0x7f413d39eac3 - <unknown>
  36:     0x7f413d430850 - <unknown>
  37:                0x0 - <unknown>

uptime-kuma version is 1.23.11

This only occurs when there are maintenance entries in uptime-kuma.

also, the help flag for the maintenance sub-command appears to return the usage for monitors:

$ kuma maintenance -help
Manage Maintenances

Usage: kuma maintenance [OPTIONS] [COMMAND]

Commands:
  add     Add a new Monitor
  edit    Edit a Monitor
  get     Get a Monitor
  delete  Delete a Monitor
  list    Get all Monitors
  resume  Start/Resume a Monitor
  pause   Stop/Pause a Monitor
  help    Print this message or the help of the given subcommand(s)

Options:
      --url <URL>
          The URL AutoKuma should use to connect to Uptime Kuma
      --username <USERNAME>
          The username for logging into Uptime Kuma (required unless auth is disabled)
      --password <PASSWORD>
          The password for logging into Uptime Kuma (required unless auth is disabled)
      --mfa-token <MFA_TOKEN>
          The MFA token for logging into Uptime Kuma (required if MFA is enabled)
      --header <KEY=VALUE>
          Add a HTTP header when connecting to Uptime Kuma
      --connect-timeout <CONNECT_TIMEOUT>
          The timeout for the initial connection to Uptime Kuma [default: 30.0]
      --call-timeout <CALL_TIMEOUT>
          The timeout for executing calls to the Uptime Kuma server [default: 30.0]
      --format <OUTPUT_FORMAT>
          The output format [default: json] [possible values: json, toml, yaml]
      --pretty
          Wether the output should be pretty printed or condensed
  -h, --help
          Print help
@BigBoot
Copy link
Owner

BigBoot commented Feb 27, 2024

You're right, looks like some maintenance types don't contain a seconds part in the timepoints, I've adjusted the models accordingly, thanks for the report.

@garyhodgson
Copy link
Author

Great! Thanks for the fast resoonse!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants