kdash-rs / kdash

A simple and fast dashboard for Kubernetes
https://kdash.cli.rs
MIT License
2.12k stars 80 forks source link

kdash Crash Report #151

Closed omid closed 2 years ago

omid commented 2 years ago
name = 'kdash'
operating_system = 'unix:Manjaro'
crate_version = '0.2.6'
explanation = '''
Panic occurred in file '~/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/widgets/gauge.rs' at line 204
'''
cause = 'Ratio should be between 0 and 1 inclusively.'
method = 'Panic'
backtrace = '''

   0: 0x557115c570f2 - kdash::main::hbb7d0b00cd09bc2d
   1: 0x557115b1a0b3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h37718759770cb226
   2: 0x557115c62eb7 - main
   3: 0x7f02e4dc4b25 - __libc_start_main
   4: 0x557115a9325e - _start
   5:        0x0 - <unresolved>'''
deepu105 commented 2 years ago

Could you give bit more info, like what screen you were on and what you were doing? Also could attach the crash log file created. Path should be printed on your console during crash

omid commented 2 years ago

I just run the command, and wait some seconds. Sometimes it crashes, sometimes not! I think it crashes when loading the Namespace block, or whatever is in the queue after that.

I cannot attach the crash log file, since we cannot attach toml files in github. But what you see above is the crash file content. Just tried it again and here is a new one:

name = 'kdash'
operating_system = 'unix:Manjaro'
crate_version = '0.2.6'
explanation = '''
Panic occurred in file '~/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/widgets/gauge.rs' at line 204
'''
cause = 'Ratio should be between 0 and 1 inclusively.'
method = 'Panic'
backtrace = '''

   0: 0x55e75ba480f2 - kdash::main::hbb7d0b00cd09bc2d
   1: 0x55e75b90b0b3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h37718759770cb226
   2: 0x55e75ba53eb7 - main
   3: 0x7f959c8edb25 - __libc_start_main
   4: 0x55e75b88425e - _start
   5:        0x0 - <unresolved>'''
deepu105 commented 2 years ago

What terminal do you use and what is size when the error happens? can you try another terminal and a different terminal size? also can you copy-paste the content of crash log here

omid commented 2 years ago

What you see here is the copy/paste of the crash log, whole of it.

Terminal is gnome-terminal, and the window is full screen. By size you mean pixels/resolution or lines and chars of the terminal. Anyway, it's not small!

deepu105 commented 2 years ago

Honestly I dont have enough info here to troubleshoot. There was some issue with tui-rs lib tables in small terminals, but that was fixed some time ago so I have no idea whats going on here. Do you have rust installed if not will you be willing to run the main branch locally?

Thanks & Regards, Deepu

On Thu, Jan 20, 2022 at 9:52 AM Omid Rad @.***> wrote:

What you see here is the copy/paste of the crash log, whole of it.

Terminal is gnome-terminal, and the window is full screen. By size you mean pixels/resolution or lines and chars of the terminal. Anyway, it's not small!

— Reply to this email directly, view it on GitHub https://github.com/kdash-rs/kdash/issues/151#issuecomment-1017246650, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF3GBPSLRZUZSJKY2HLUW7ENLANCNFSM5MKBMO4Q . You are receiving this because you commented.Message ID: @.***>

omid commented 2 years ago

yes, I have Rust installed. Will try to debug it now.

omid commented 2 years ago

Now I have more info:

thread '<unnamed>' panicked at 'Ratio should be between 0 and 1 inclusively.', /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/widgets/gauge.rs:204:9
   0: kdash::panic_hook
             at src/main.rs:236:44
   1: kdash::main::{{closure}}::{{closure}}
             at src/main.rs:40:5
   2: std::panicking::rust_panic_with_hook
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:610:17
   3: std::panicking::begin_panic::{{closure}}
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:526:9
   4: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/sys_common/backtrace.rs:139:18
   5: std::panicking::begin_panic
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:525:12
   6: tui::widgets::gauge::LineGauge::ratio
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/widgets/gauge.rs:204:9
   7: kdash::ui::overview::draw_context_info_block
             at src/ui/overview.rs:144:19
   8: kdash::ui::overview::draw_status_block
             at src/ui/overview.rs:45:3
   9: kdash::ui::overview::draw_overview
             at src/ui/overview.rs:26:5
  10: kdash::ui::draw
             at src/ui/mod.rs:64:7
  11: kdash::start_ui::{{closure}}::{{closure}}
             at src/main.rs:180:23
  12: tui::terminal::Terminal<B>::draw
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.16.0/src/terminal.rs:267:9
  13: kdash::start_ui::{{closure}}
             at src/main.rs:180:5
  14: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/core/src/future/mod.rs:80:19
  15: kdash::main::{{closure}}
             at src/main.rs:103:3
  16: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/core/src/future/mod.rs:80:19
  17: tokio::park::thread::CachedParkThread::block_on::{{closure}}
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/park/thread.rs:263:54
  18: tokio::coop::with_budget::{{closure}}
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/coop.rs:102:9
  19: std::thread::local::LocalKey<T>::try_with
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/thread/local.rs:399:16
  20: std::thread::local::LocalKey<T>::with
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/thread/local.rs:375:9
  21: tokio::coop::with_budget
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/coop.rs:95:5
      tokio::coop::budget
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/coop.rs:72:5
      tokio::park::thread::CachedParkThread::block_on
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/park/thread.rs:263:31
  22: tokio::runtime::enter::Enter::block_on
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/runtime/enter.rs:151:13
  23: tokio::runtime::thread_pool::ThreadPool::block_on
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/runtime/thread_pool/mod.rs:77:9
  24: tokio::runtime::Runtime::block_on
             at /home/omid/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/runtime/mod.rs:463:43
  25: kdash::main
             at src/main.rs:105:3
  26: core::ops::function::FnOnce::call_once
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/core/src/ops/function.rs:227:5
  27: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/sys_common/backtrace.rs:123:18
  28: std::rt::lang_start::{{closure}}
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:145:18
  29: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:406:40
      std::panicking::try
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:370:19
      std::panic::catch_unwind
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panic.rs:133:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:128:48
      std::panicking::try::do_call
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:406:40
      std::panicking::try
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panicking.rs:370:19
      std::panic::catch_unwind
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/panic.rs:133:14
      std::rt::lang_start_internal
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:128:20
  30: std::rt::lang_start
             at /rustc/02072b482a8b5357f7fb5e5637444ae30e423c40/library/std/src/rt.rs:144:17
  31: main
  32: __libc_start_main
  33: _start
omid commented 2 years ago

this

get_nm_ratio(app.data.node_metrics.as_ref(), |acc, nm| {
    acc + nm.mem_percent
  })

returns a number like 1.167

I'm going deeper

omid commented 2 years ago

Now I see the error rarely! So, it is slow to debug. Anyway, I had 335% memory usage for 3 nodes!

deepu105 commented 2 years ago

Thank you, so seems like an edge case. So need to put an upper limit value. Would you like to contribute else I can do the fix later

omid commented 2 years ago

nm.mem shows something like 2575Mi But kubectl shows, 813Mi requests and 3634Mi limit for allocated resources and 2157Mi allocatable and 3931Mi capacity, for the same node!

So I think it's more than an edge case, it's like wrong calculation of memory usage.

I'm still investigating :)

deepu105 commented 2 years ago

Ideally the calculation should match what is shown by kubectl top

On Thu, 20 Jan 2022, 5:26 pm Omid Rad, @.***> wrote:

nm.mem shows something like 2575Mi But kubectl shows, 813Mi requests and 3634Mi limit for allocated resources and 2157Mi allocatable and 3931Mi capacity, for the same node!

So I think it's more than an edge case, it's like wrong calculation of memory usage.

I'm still investigating :)

— Reply to this email directly, view it on GitHub https://github.com/kdash-rs/kdash/issues/151#issuecomment-1017423263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF4ZKDX7O47PMWXBTZ3UW7Z53ANCNFSM5MKBMO4Q . You are receiving this because you commented.Message ID: @.***>

omid commented 2 years ago

You are right, I see these:

MEMORY(bytes)   MEMORY%   
2599Mi          120%

So, percentage can be more than 100. Do you think we should show 120% |=============| or 100% |=============| in these cases or something else? (50% will be 50% |=======-------|)

omid commented 2 years ago

Screenshot from 2022-01-20 13-12-58 ???

deepu105 commented 2 years ago

Since its a guage widget I think we should limit to 100, so anything above 100 we can cut off at 100, the accurate values can be seen in the utilization tab anyway. What do you think?

omid commented 2 years ago

I implemented it like 120% |=============| (in the PR) I like the result, but anyway, as you wish.

deepu105 commented 2 years ago

I have created a new release. Should be out in 10-15 mins

Thanks & Regards, Deepu

On Thu, Jan 20, 2022 at 1:57 PM Omid Rad @.***> wrote:

I implemented it like 120% |=============| (in the PR) I like the result, but anyway, as you wish.

— Reply to this email directly, view it on GitHub https://github.com/kdash-rs/kdash/issues/151#issuecomment-1017480875, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF2OX4JMVEYHUFLEHS3UXABENANCNFSM5MKBMO4Q . You are receiving this because you commented.Message ID: @.***>

omid commented 2 years ago

Thanks @deepu105 I think adding the version and date to the changlog file is forgotten.

deepu105 commented 2 years ago

Oh ya forgot to update that I'll do that in a bit

deepu105 commented 2 years ago

@omid feel free to make feature requests or even better contribute features that you think would make Kdash more useful :)

omid commented 2 years ago

@deepu105 sure, thanks