tramhao / termusic

Music Player TUI written in Rust
GNU General Public License v3.0
992 stars 42 forks source link

App crashed #132

Open pierg75 opened 1 year ago

pierg75 commented 1 year ago

After today's update (though cargo) I keep getting a crash:

$ RUST_BACKTRACE=full termusic /mnt/data/Music
thread 'main' panicked at 'Error spawning server process.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/termusic-lib-0.7.11/src/utils/mod.rs:473:17
stack backtrace:
...
  15:     0x560e0ef29ab3 - core::result::unwrap_failed::hdff5465d74574b44
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
  16:     0x560e0f03fbf5 - termusiclib::utils::spawn_process::ha03b58727052341f
  17:     0x560e0f117790 - termusic::main::{{closure}}::h182201bdf389b614
  18:     0x560e0f0d397a - tokio::runtime::park::CachedParkThread::block_on::h2258cf95619a2752
  19:     0x560e0f1452a3 - tokio::runtime::context::runtime::enter_runtime::h8ffe4be7db76b175
  20:     0x560e0f064943 - tokio::runtime::runtime::Runtime::block_on::h76c2854efe46c5e5
  21:     0x560e0f11728f - termusic::main::hea3d3e39704460c8
  22:     0x560e0f212d33 - std::sys_common::backtrace::__rust_begin_short_backtrace::h46dd5a8e2a6c2a95
  23:     0x560e0f12b3ed - std::rt::lang_start::{{closure}}::h33b325352afa5165
  24:     0x560e0fbc575c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd6efcd3bec896f2c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/ops/function.rs:287:13
  25:     0x560e0fbc575c - std::panicking::try::do_call::hce04e543bb1f4cbb
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  26:     0x560e0fbc575c - std::panicking::try::h3342dd4e1f680968
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  27:     0x560e0fbc575c - std::panic::catch_unwind::h148ce1e59ac0cee7
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  28:     0x560e0fbc575c - std::rt::lang_start_internal::{{closure}}::h25f9dda2057a67fe
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:48
  29:     0x560e0fbc575c - std::panicking::try::do_call::h7caaaeaf9401650b
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:487:40
  30:     0x560e0fbc575c - std::panicking::try::he7d15285746cbbc2
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:451:19
  31:     0x560e0fbc575c - std::panic::catch_unwind::h89fb4f50c0301fe0
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panic.rs:140:14
  32:     0x560e0fbc575c - std::rt::lang_start_internal::h078acd489417d3c1
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/rt.rs:148:20
  33:     0x560e0f11a955 - main
  34:     0x7f759bc49b4a - __libc_start_call_main
  35:     0x7f759bc49c0b - __libc_start_main@@GLIBC_2.34
  36:     0x560e0ef29c95 - _start
  37:                0x0 - <unknown>
CRAG666 commented 1 year ago

I have the same error

tramhao commented 1 year ago

Seems that the server binary termusic-server is not copied during installation. Please find it in the target/release directory and copy it to your $PATH. You can also clone the repository and install manually make && make full. Seems the package you installed is not updated to reflect the new change.

pierg75 commented 1 year ago

Indeed by compiling manually and copying the termusic-server, it works. I guess then the problem is in the cargo install installation, there doesn't seem to be a server directory in the source code used by cargo, even though the version (0.7.11) is the same

tramhao commented 1 year ago

Sorry I didn't update the readme of cargo install. Now the command becomes:

cargo install termusic termusic-server
CRAG666 commented 1 year ago

@tramhao this is pkbuild on arch linux

# Maintainer: orhun <orhunparmaksiz@gmail.com>
# https://github.com/orhun/pkgbuilds

pkgname=termusic
pkgver=0.7.11
pkgrel=1
pkgdesc="Music Player TUI written in Rust"
arch=('x86_64')
url="https://github.com/tramhao/termusic"
license=('MIT' 'GPL3')
depends=('gstreamer' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad' 'gst-plugins-ugly' 'gst-libav' 'dbus' 'ueberzug' 'protobuf')
optdepends=('yt-dlp: download mp3'
            'ffmpeg: download mp3')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('3bf9cacb01ccaaa2415e0296d8870408b5d5b231dfc798236fa114fb1b61d9c3c03af4fedb2cdd98fa3a33f518b0b83f0636a2bfae8fa370a36bb33a378faa24')
options=('!lto')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --bin termusic --features cover --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --bin termusic --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE_MIT -t "$pkgdir/usr/share/licenses/$pkgname"
}
tramhao commented 1 year ago

seems need modification but I'm not familiar with the syntax of this file. Help!

tramhao commented 1 year ago

Updated pkgbuild:

# Maintainer: orhun <orhunparmaksiz@gmail.com>
# https://github.com/orhun/pkgbuilds

pkgname=termusic
pkgver=0.7.11
pkgrel=1
pkgdesc="Music Player TUI written in Rust"
arch=('x86_64')
url="https://github.com/tramhao/termusic"
license=('MIT' 'GPL3')
depends=('gstreamer' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad' 'gst-plugins-ugly' 'gst-libav' 'dbus' 'ueberzug' 'protobuf')
optdepends=('yt-dlp: download mp3'
            'ffmpeg: download mp3')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('67f0b06ff37dbc3d16c77c6bdd0163dc547fbea1a25b3a7574b4540a4ad3a2059dc547d49411803fd9aa162d4f432ff5b99bef1e0f5c362342943fa76985f443')
options=('!lto')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --bin termusic --features cover --release --frozen
  cargo build --bin termusic-server --features cover --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --bin termusic --frozen
  cargo test --bin termusic-server --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 755 "target/release/$pkgname-server" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE_MIT -t "$pkgdir/usr/share/licenses/$pkgname"
}
Lyokolux commented 8 months ago

It can be interesting to catch this and display a proper error message: the termusic-server should be installed. It is disturbing while upgrading to a new version and I (thankfully) ran into this issue after a couple dozen of minutes.

It is also a good first issue :)

hasezoey commented 6 months ago

It can be interesting to catch this and display a proper error message: the termusic-server should be installed.

since e5283302bb1c9c6e5fbb8d99feb7bb64e85352ab there is a better error message, but there has not been a release since then yet (likely 0.8.0, or less recommended 0.7.12)

Edit: there is now v0.9.0