git-remote-s3 icon indicating copy to clipboard operation
git-remote-s3 copied to clipboard

Get "thread 'main' panicked at 'called `Option::unwrap()`" Error

Open wintercomic opened this issue 2 years ago • 2 comments

Hello,

I installed git-remote-s3 though "cargo install git-remote-s3". I get the following error when I try to push repo. am i missing something? Thank you very much.

$ RUST_BACKTRACE=1 git push s3remote 
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/bc/.cargo/registry/src/github.com-1ecc6299db9ec823/git-remote-s3-0.1.3/src/main.rs:293:45
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:48:5
   3: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
   4: itertools::Itertools::into_group_map
   5: git_remote_s3::list_remote_refs
   6: git_remote_s3::cmd_list
   7: git_remote_s3::cmd_loop
   8: git_remote_s3::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
  • cargo 1.64.0
  • OS: Ubuntu 22.04
  • rustc 1.64.0

wintercomic avatar Oct 11 '22 09:10 wintercomic

im getting something like this too, my stacktrace is;

env RUST_BACKTRACE=full git push s3remote master
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/main.rs:296:22
stack backtrace:
   0:        0x10060f121 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h428cf6d3383daa9c
   1:        0x10062d60b - core::fmt::write::hcf88e896ec23e052
   2:        0x100607afa - std::io::Write::write_fmt::h58c3052bb04c456d
   3:        0x100610cc5 - std::panicking::default_hook::{{closure}}::h99b76afd6b358916
   4:        0x1006108af - std::panicking::default_hook::hd7fbc9eda5da2259
   5:        0x1006113b0 - std::panicking::rust_panic_with_hook::h48eeb24de18c027c
   6:        0x100610e24 - std::panicking::begin_panic_handler::{{closure}}::h1cb76dc2cf734090
   7:        0x10060f597 - std::sys_common::backtrace::__rust_end_short_backtrace::h6ba95b68f495d865
   8:        0x100610dba - _rust_begin_unwind
   9:        0x10064cb2f - core::panicking::panic_fmt::h91749835f0f98da6
  10:        0x10064ca87 - core::panicking::panic::h2506d393f68a9da8
  11:        0x1002b2526 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once::hb838d31f9cdd7007
  12:        0x1002c0d5f - itertools::group_map::into_group_map::h7712cd640713e210
  13:        0x1002b37bd - git_remote_s3::list_remote_refs::hf9367c355dafed0d
  14:        0x1002b3b63 - git_remote_s3::cmd_list::h5e811a2ab3e8bea5
  15:        0x1002b51a3 - git_remote_s3::main::h62f7f4ac135b713b
  16:        0x1002b9ff6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h867bb305882a88ad
  17:        0x1002bea5c - std::rt::lang_start::{{closure}}::hd67aae476a69741d
  18:        0x10060edcf - std::rt::lang_start_internal::h240e1720b3cdfa5e
  19:        0x1002b7a09 - _main

OSX, release binary v0.1.3

jvsteiner avatar Nov 19 '22 13:11 jvsteiner

I think I figured out why this was happening - at least to me. Within the bucket, before pushing for the first time, I had already created a folder there for my repository to go into. The problem is that this folder must be put there by the tool itself, since if it is already there, a full repo is expected to be in there with refs and everything. Once I removed that folder, everything worked normally. @wintercomic you might want to try this out as well, in case you did the same thing.

jvsteiner avatar Nov 20 '22 12:11 jvsteiner