router icon indicating copy to clipboard operation
router copied to clipboard

Rust v1.78.0 router-bridge startup panic

Open str1aN opened this issue 1 year ago • 5 comments

Upgrading Rust Toolchain to 1.78.0 causes panic on startup in router-bridge for --release builds

Steps to reproduce the behavior:

  1. Upgrade Rust toolchain to 1.78.0
  2. Build and Start router with cargo run --release -- (env vars omitted)
  3. See error on startup

Output

2024-05-03T21:42:30.961533Z ERROR panicked at /Users/[redacted]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/router-bridge-0.5.18+v2.7.2/src/worker.rs:101:38: called 'Result::unwrap()' on an 'Err' value: TypeError: Error parsing args at position 1: serde_v8 error: invalid type; expected: object, got: string at send (worker.js:54:25) at run (worker.js:171:19)

Desktop (please complete the following information):

  • OS: macOS / Linux
  • Version macOS 13.6.1 / public.ecr.aws/docker/library/rust:1.78.0

str1aN avatar May 03 '24 22:05 str1aN

We'll need to look into this — and we will — but we haven't yet made the jump to Rust v1.78.0 (currently, we are on Rust 1.76.0). We'll take some time to make the jump, so we would recommend using 1.76.0 for now.

abernix avatar May 06 '24 09:05 abernix

Rust 1.76 is now over 6 months old, is there any timeline on when we can move forward on rust versions?

Dr-Emann avatar Aug 27 '24 20:08 Dr-Emann

I agree, some of my dependencies sqlx have released security vulnerability fixes in latest versions that will only compile on rust 1.80+. Unfortunately I can't take them since this won't compile.

robmarto avatar Aug 28 '24 03:08 robmarto

@abernix is it something the community can help? Is it quite easy, like updating the rust version, and fixing all warnings? Or is it something more complex, as updating dependencies first, then the project?

yanns avatar Sep 02 '24 07:09 yanns

i have the same issue over rust 1.76 - it builds but doesn't run.

on the side i'm not sure of why we need worker.js on that project. could it be separated/optional deps?

y-nk avatar Sep 17 '24 06:09 y-nk

Rust 1.76 has now been unsupported for 8 months.

Dr-Emann avatar Nov 21 '24 17:11 Dr-Emann

@Dr-Emann i was just mentioning that it may be something bigger than rust version since i also had it for another (previous) version :|

y-nk avatar Nov 22 '24 03:11 y-nk

@abernix now getting further blocked in my pipelines because cargo-platform v0.1.9` cannot be built because it requires rustc 1.78 or newer. It's a pretty common cargo dependency (cargo-machete, cargo-tarpaulin) use this, so now I'm expected to pin these to older version now to :<

Honestly, I think bumping your rust version needs to be a priority now. As mentioned previously 1.76 has been unsupported for 8 months now.

robmarto avatar Nov 28 '24 22:11 robmarto

The latest dev branch dropped deno and is now on the latest rustc! It's planned to be in the next release.

duckki avatar Dec 13 '24 16:12 duckki

I think it'd be great to release this soon-ish. CI pipelines are being blocked as many dependencies are asking for newer rustc version.

yanns avatar Jan 06 '25 12:01 yanns

Had this problem with apollo-router: 1.57.1 but when updating to 1.59.0 it stopped. Hope this can help someone.

flo-martin avatar Jan 08 '25 15:01 flo-martin

1.59 helps at runtime since it uses the native query planner by default, which skips invoking deno and the legacy query planner. But, the next release 1.60 will drop deno entirely and won't pin old crate versions any more at compile time, so the latest stable Rust version can be used.

duckki avatar Jan 08 '25 16:01 duckki

Since we removed Deno from the router in 1.60.0 it is safe to update rust version. Therefore I am closing this issue. It is advised to use the version of rust that is specified in the rust-toolchain.toml at the point of release, as this is the version that Apollo will have used for testing.

BrynCooke avatar Apr 17 '25 19:04 BrynCooke