Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fails when built for alpine i686 #991

Open
Un1q32 opened this issue Aug 8, 2022 · 5 comments
Open

Fails when built for alpine i686 #991

Un1q32 opened this issue Aug 8, 2022 · 5 comments

Comments

@Un1q32
Copy link

Un1q32 commented Aug 8, 2022

What did you expect to happen?

topgrade to run normally

What actually happened?

It didn't

Additional Details

  • Which operating system or Linux distribution are you using? Alpine i686
  • How did you install Topgrade? Built from source
  • Which version are you running? Topgrade 9.0.1
 2022-08-08T16:50:54.209Z DEBUG topgrade::config > Configuration at /root/.config/topgrade.toml
 2022-08-08T16:50:54.214Z DEBUG topgrade::config > Loaded configuration: ConfigFile { pre_commands: Some({}), post_commands: None, commands: Some({}), git_repos: None, predefined_git_repos: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, git_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, yay_arguments: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, accept_all_windows_updates: None, bashit_branch: None, only: None, composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None }), linux: Some(Linux { yay_arguments: None, arch_package_manager: None, show_arch_news: None, trizen_arguments: None, pikaur_arguments: None, dnf_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, rpm_ostree: None, emerge_sync_flags: None, emerge_update_flags: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, enable_winget: None }), npm: Some(NPM { use_sudo: None }), vim: None, firmware: Some(Firmware { upgrade: None }), vagrant: None, flatpak: Some(Flatpak { use_sudo: None }) }
 2022-08-08T16:50:54.215Z DEBUG topgrade::utils  > Cannot find "notify-send"
 2022-08-08T16:50:54.215Z DEBUG topgrade         > Version: 9.0.1
 2022-08-08T16:50:54.215Z DEBUG topgrade         > OS: i586-alpine-linux-musl
 2022-08-08T16:50:54.215Z DEBUG topgrade         > Args { inner: ["./topgrade", "-v"] }
 2022-08-08T16:50:54.216Z DEBUG topgrade         > Binary path: Ok("/root/topgrade-9.0.1/target/debug/topgrade")
 2022-08-08T16:50:54.216Z DEBUG topgrade         > Self Update: false
 2022-08-08T16:50:54.216Z DEBUG topgrade::utils  > Detected "/usr/bin/git" as "git"
 2022-08-08T16:50:54.217Z DEBUG topgrade::utils  > Cannot find "doas"
 2022-08-08T16:50:54.217Z DEBUG topgrade::utils  > Cannot find "sudo"
 2022-08-08T16:50:54.217Z DEBUG topgrade::utils  > Cannot find "gsudo"
 2022-08-08T16:50:54.218Z DEBUG topgrade::utils  > Cannot find "pkexec"
 2022-08-08T16:50:54.218Z DEBUG topgrade::utils  > Cannot find "pwsh"
 2022-08-08T16:50:54.218Z DEBUG topgrade::utils  > Cannot find "powershell"
 2022-08-08T16:50:54.220Z DEBUG topgrade::runner > Step "System update"

―― 16:50:54 - System update ――――――――――――――――――――――――――――――――――――――――――――――――――――
2022-08-08T16:50:54.221Z DEBUG topgrade::utils > Detected "/sbin/apk" as "apk"
thread 'main' panicked at 'called Option::unwrap() on a None value', src/steps/os/linux.rs:155:36
stack backtrace:
0: 0x56d2f4aa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9426a344731f5994
1: 0x56d573b9 - core::fmt::write::he911fe1b6cdae067
2: 0x56d29e46 - std::io::Write::write_fmt::h7bea0a24ef59b3db
3: 0x56d3201b - std::panicking::default_hook::{{closure}}::hef7dbf09b871b7eb
4: 0x56d31cab - std::panicking::default_hook::h2d92713104d4aeba
5: 0x56d3277b - std::panicking::rust_panic_with_hook::hda48d92342e94832
6: 0x56d324c7 - std::panicking::begin_panic_handler::{{closure}}::hfde25d1aea4831a6
7: 0x56d2f913 - std::sys_common::backtrace::__rust_end_short_backtrace::hdecc064d71f42ae5
8: 0x56d321df - rust_begin_unwind
9: 0x5664a150 - core::panicking::panic_fmt::h5d4ce4606114385e
10: 0x5664a023 - core::panicking::panic::h98ad924ed7946be1
11: 0x567b7321 - core::option::Option::unwrap::h9d946d8d890f9249
at /home/buildozer/aports/community/rust/src/rustc-1.60.0-src/library/core/src/option.rs:752:21
12: 0x567a0e12 - topgrade::steps::os::linux::upgrade_alpine_linux::h8d48cbad079b9155
at /root/topgrade-9.0.1/src/steps/os/linux.rs:155:16
13: 0x5679f7fd - topgrade::steps::os::linux::Distribution::upgrade::h17df16e80e1dc4ef
at /root/topgrade-9.0.1/src/steps/os/linux.rs:95:37
14: 0x5671ac3e - topgrade::run::{{closure}}::hec3f2d1c8b56e5e2
at /root/topgrade-9.0.1/src/main.rs:147:66
15: 0x5669ce46 - topgrade::runner::Runner::execute::h7f4ce1f3ebe2b04f
at /root/topgrade-9.0.1/src/runner.rs:37:19
16: 0x5671d932 - topgrade::run::h94041a7f90f5a9fe
at /root/topgrade-9.0.1/src/main.rs:147:17
17: 0x5672380b - topgrade::main::hde8fc969057c1158
at /root/topgrade-9.0.1/src/main.rs:477:11
18: 0x56744ce6 - core::ops::function::FnOnce::call_once::hc572df1823fa8b76
at /home/buildozer/aports/community/rust/src/rustc-1.60.0-src/library/core/src/ops/function.rs:227:5
19: 0x5682ead1 - std::sys_common::backtrace::__rust_begin_short_backtrace::hac5b03868832f724
at /home/buildozer/aports/community/rust/src/rustc-1.60.0-src/library/std/src/sys_common/backtrace.rs:122:18
20: 0x5682b2b3 - std::rt::lang_start::{{closure}}::hba460959bfb95ffc
at /home/buildozer/aports/community/rust/src/rustc-1.60.0-src/library/std/src/rt.rs:145:18
21: 0x56d2ee49 - std::rt::lang_start_internal::hd3a6ec29ae3af204
22: 0x5682b27d - std::rt::lang_start::h3e38264a2b576b04
at /home/buildozer/aports/community/rust/src/rustc-1.60.0-src/library/std/src/rt.rs:144:17
23: 0x567239b7 - main
24: 0xf7e93dc3 -

@MCOfficer
Copy link
Contributor

MCOfficer commented Aug 8, 2022

Do you have a sudo command? If not, can you perhaps install one and try again?
Your options are

topgrade/src/utils.rs

Lines 106 to 109 in 4e6f48c

which("doas")
.or_else(|| which("sudo"))
.or_else(|| which("gsudo"))
.or_else(|| which("pkexec"))

@Un1q32
Copy link
Author

Un1q32 commented Aug 8, 2022

Do you have a sudo command? If not, can you perhaps install one and try again? Your options are

topgrade/src/utils.rs

Lines 106 to 109 in 4e6f48c

which("doas")
.or_else(|| which("sudo"))
.or_else(|| which("gsudo"))
.or_else(|| which("pkexec"))

I was using a basic docker container to build for another platform and did not have a sudo command. You should really add a proper error message when none is found, and maybe skip the check when already running as root.

@Un1q32
Copy link
Author

Un1q32 commented Aug 9, 2022

also you should add su as a fallback if theres nothing else, since basicly everything has su

@Un1q32 Un1q32 closed this as completed Aug 9, 2022
@MCOfficer
Copy link
Contributor

MCOfficer commented Aug 10, 2022

I can't speak for the developer, but personally I'd like to see this reopened. At the very least, topgrade should produce a proper error instead of a panic.

@Un1q32
Copy link
Author

Un1q32 commented Aug 10, 2022

I can't speak for the developer, but personally I'd like to see this reopened. At the very least, topgrade should produce a proper error instead of a panic.

True. I'll reopen.

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

No branches or pull requests

2 participants