Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Crash on navigating to Dashboard #28

Closed
4very opened this issue Jun 4, 2019 · 5 comments
Closed

Crash on navigating to Dashboard #28

4very opened this issue Jun 4, 2019 · 5 comments
Labels
bug Something isn't working
Projects
Milestone

Comments

@4very
Copy link
Contributor

4very commented Jun 4, 2019

Describe the bug
Crash whenever I navigate to dashboard

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.25/src/backtrace/libunwind.rs:97
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.25/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:197
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   8: rust_begin_unwind
             at src/libstd/panicking.rs:308
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::panicking::panic
             at src/libcore/panicking.rs:49
  11: core::option::Option<T>::unwrap
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/macros.rs:12
  12: observatory::users::handlers::user_commits_count::{{closure}}
             at src/users/handlers.rs:231
  13: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/ops/function.rs:279
  14: core::option::Option<T>::map
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/option.rs:416
  15: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/iter/adapters/mod.rs:570
  16: <core::iter::adapters::flatten::FlattenCompat<I,U> as core::iter::traits::iterator::Iterator>::next
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/iter/adapters/flatten.rs:219
  17: <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/iter/adapters/flatten.rs:144
  18: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/liballoc/vec.rs:1883
  19: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/liballoc/vec.rs:1796
  20: core::iter::traits::iterator::Iterator::collect
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/iter/traits/iterator.rs:1466
  21: observatory::users::handlers::user_commits_count
             at src/users/handlers.rs:229
  22: observatory::users::handlers::grade_summary
             at src/users/handlers.rs:222
  23: observatory::handlers::dashboard
             at src/handlers.rs:52
  24: observatory::handlers::rocket_route_fn_dashboard
             at src/handlers.rs:48
  25: core::ops::function::Fn::call
             at /rustc/3ade426ede7bca4a74bc641a12f2e7fe2cc20c47/src/libcore/ops/function.rs:69
  26: <F as rocket::handler::Handler>::handle
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.1/src/handler.rs:177
  27: rocket::rocket::Rocket::route
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.1/src/rocket.rs:293
  28: rocket::rocket::Rocket::route_and_process
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.1/src/rocket.rs:242
  29: rocket::rocket::Rocket::dispatch
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.1/src/rocket.rs:217
  30: <rocket::rocket::Rocket as hyper::server::Handler>::handle
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket-0.4.1/src/rocket.rs:82
  31: hyper::server::Worker<H>::keep_alive_loop
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.10.16/src/server/mod.rs:340
  32: hyper::server::Worker<H>::handle_connection
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.10.16/src/server/mod.rs:282
  33: hyper::server::handle::{{closure}}
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.10.16/src/server/mod.rs:242
  34: hyper::server::listener::spawn_with::{{closure}}
             at /home/avery/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.10.16/src/server/listener.rs:50
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@4very 4very added the bug Something isn't working label Jun 4, 2019
@rushsteve1 rushsteve1 added this to To do in Summer-2019 via automation Jun 4, 2019
@rushsteve1 rushsteve1 added this to the Pre-Beta milestone Jun 4, 2019
@rushsteve1
Copy link
Contributor

rushsteve1 commented Jun 7, 2019

This is the location of the bug:

  21: observatory::users::handlers::user_commits_count
             at src/users/handlers.rs:229

user_projects(conn, &user)
.iter()
.map(|p| project_commits(conn, p).unwrap())
.flatten()
.collect::<Vec<serde_json::Value>>()
.first()?
.as_array()?
.iter()
.filter(|c| {
c.get("author")
.unwrap()
.get("login")
.unwrap()
.as_str()
.unwrap()
== user.handle
})
.count(),

Somewhere in that very long statement one of the unwrap()s is failing.
This might be due to a user not having any repos associated with them, or possibly no commits?
Replacing the unwrap()s with expect()s with error messages should make this more apparent.

@4very
Copy link
Contributor Author

4very commented Jun 13, 2019

Could not replicate this issue after deleting my database file, even after creating an account with the same information. This probably was on my end.

@rushsteve1
Copy link
Contributor

I was able to replicate it and I think @OliviaLundelius did too.
I believe it only happens when the associated GitHub account has NO repos and NO commits but I am not quite sure.

@4very
Copy link
Contributor Author

4very commented Jun 14, 2019

Credentials that I originally used were as follows:
email - a@a.com
password - a
real name - Admin
github - admina

@rushsteve1
Copy link
Contributor

None of us have been able to replicate this for quite a while so I think the bug is gone. Going to close this issue. If it comes back up then I'll re-open.

Summer-2019 automation moved this from To do to Done Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
Summer-2019
  
Done
Development

No branches or pull requests

2 participants