Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Updater server returning a 204 causes issues. #6192

Closed
colin99d opened this issue Feb 3, 2023 · 2 comments
Closed

[bug] Updater server returning a 204 causes issues. #6192

colin99d opened this issue Feb 3, 2023 · 2 comments
Labels
scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it type: bug

Comments

@colin99d
Copy link

colin99d commented Feb 3, 2023

Describe the bug

When using the auto updater, Tauri gets the below error when receiving a 204 NO CONTENT:

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: TauriApi(Network(Error(Json(Error("EOF while parsing a value", line: 1, column: 0)))))', src/main.rs:55:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to update: Tauri API error: Network Error: Json Error: EOF while parsing a value at line 1 column 0

To confirm things are working properly, I used this url: https://api.fabianlars.de/v1/update/mw-toolbox/windows/x86_64/0.0.1.
I also tried it using dialogue as true or false. The issue fails on this line:

tauri::async_runtime::spawn(async move {
    handle.updater().check().await.unwrap();
});

Reproduction

Run: cargo tauri dev

Expected behavior

Sending an event saying that the app is already up to date.

Platform and versions

(base) ➜ terminalpro-poc git:(main) ✗ cargo tauri info

Environment
› OS: Mac OS 13.1.0 X64
› Node.js: 16.19.0
› npm: 8.19.3
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.67.0
› cargo: 1.67.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
Error only one package manager should be used, but found npm and yarn
please remove unused package manager lock files

(base) ➜ terminalpro-poc git:(main) ✗ cargo tauri --version
tauri-cli 1.2.3
(base) ➜ terminalpro-poc git:(main) ✗

Stack trace

➜  Local:   http://127.0.0.1:1420/
  ➜  Network: use --host to expose
        Info Watching /Users/colindelahunty/terminalpro-poc/src-tauri for changes...
   Compiling terminalpro-poc v0.0.0 (/Users/colindelahunty/terminalpro-poc/src-tauri)
    Finished dev [unoptimized + debuginfo] target(s) in 2.83s
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: TauriApi(Network(Error(Json(Error("EOF while parsing a value", line: 1, column: 0)))))', src/main.rs:55:48
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1113:23
   4: terminalpro_poc::main::{{closure}}::{{closure}}
             at ./src/main.rs:55:17
   5: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/future/future.rs:124:9
   6: tokio::runtime::task::core::CoreStage<T>::poll::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/core.rs:184:17
   7: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/loom/std/unsafe_cell.rs:14:9
   8: tokio::runtime::task::core::CoreStage<T>::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/core.rs:174:13
   9: tokio::runtime::task::harness::poll_future::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:480:19
  10: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panic/unwind_safe.rs:271:9
  11: std::panicking::try::do_call
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  12: ___rust_try
  13: std::panicking::try
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  14: std::panic::catch_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
15: tokio::runtime::task::harness::poll_future
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:468:18
  16: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:104:27
  17: tokio::runtime::task::harness::Harness<T,S>::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:57:15
  18: tokio::runtime::task::raw::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/raw.rs:194:5
  19: tokio::runtime::task::raw::RawTask::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/raw.rs:134:18
  20: tokio::runtime::task::LocalNotified<S>::run
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/mod.rs:385:9
  21: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/scheduler/multi_thread/worker.rs:421:13
  22: tokio::coop::with_budget::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/coop.rs:102:9
  23: std::thread::local::LocalKey<T>::try_with
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/thread/local.rs:446:16
  24: std::thread::local::LocalKey<T>::with
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/thread/local.rs:422:9
  25: tokio::coop::with_budget
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/coop.rs:95:5
  26: tokio::coop::budget
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/coop.rs:72:5
  27: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/scheduler/multi_thread/worker.rs:420:9
  28: tokio::runtime::scheduler::multi_thread::worker::Context::run
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/scheduler/multi_thread/worker.rs:387:24
  29: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/scheduler/multi_thread/worker.rs:372:17
  30: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/macros/scoped_tls.rs:61:9
  31: tokio::runtime::scheduler::multi_thread::worker::run
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/scheduler/multi_thread/worker.rs:369:5
  32: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/scheduler/multi_thread/worker.rs:348:45
  33: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/blocking/task.rs:42:21
  34: tokio::runtime::task::core::CoreStage<T>::poll::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/core.rs:184:17
  35: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/loom/std/unsafe_cell.rs:14:9
  36: tokio::runtime::task::core::CoreStage<T>::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/core.rs:174:13
  37: tokio::runtime::task::harness::poll_future::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:480:19
  38: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panic/unwind_safe.rs:271:9
  39: std::panicking::try::do_call
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  40: ___rust_try
  41: std::panicking::try
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  42: std::panic::catch_unwind
             at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  43: tokio::runtime::task::harness::poll_future
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:468:18
  44: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:104:27
  45: tokio::runtime::task::harness::Harness<T,S>::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/harness.rs:57:15
  46: tokio::runtime::task::raw::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/raw.rs:194:5
  47: tokio::runtime::task::raw::RawTask::poll
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/raw.rs:134:18
  48: tokio::runtime::task::UnownedTask<S>::run
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/task/mod.rs:422:9
  49: tokio::runtime::blocking::pool::Task::run
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/blocking/pool.rs:111:9
  50: tokio::runtime::blocking::pool::Inner::run
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/blocking/pool.rs:346:17
  51: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
             at /Users/colindelahunty/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.21.2/src/runtime/blocking/pool.rs:321:13
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failed to update: Tauri API error: Network Error: Json Error: EOF while parsing a value at line 1 column 0

Additional context

No response

@colin99d colin99d added status: needs triage This issue needs to triage, applied to new issues type: bug labels Feb 3, 2023
@FabianLars FabianLars added scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it and removed status: needs triage This issue needs to triage, applied to new issues labels Feb 3, 2023
@anastasiya1155
Copy link

I'm getting the same issue, but only when I switch to manually checking for updates. When there is no update available I get an error message saying that 'Update failed to install'

@amrbashir
Copy link
Member

A PR is up now to fix this but looking at your example, you shouldn't call .unwrap() at all because it will still panic when 204 is sent but with a different error which is UpToDate error. It was a mistake by us when we designed the updater API but will be fixed in v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it type: bug
Projects
None yet
Development

No branches or pull requests

4 participants