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

prisma generate panics when migrations feature is enabled #467

Open
StoicDeveloper opened this issue Sep 1, 2024 · 5 comments
Open

prisma generate panics when migrations feature is enabled #467

StoicDeveloper opened this issue Sep 1, 2024 · 5 comments

Comments

@StoicDeveloper
Copy link

enabling features "rspc" and "migrations" together, and running prisma generate causes the following panic:

#11 7.766    Compiling prisma-client-rust v0.6.11 (https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d00)                                                                    
#11 12.00    Compiling MassServer v0.1.0 (/app)                                                                                                                                               
#11 18.82     Finished `dev` profile [unoptimized + debuginfo] target(s) in 17.34s                                                                                                            
#11 19.24      Running `/target/debug/prisma generate`                                                                                                                                        
#11 38.63 Error:                                                                                                                                                                              
#11 38.63              at ./src/bin/prisma.rs:2:5                                                                                                                                             
#11 38.63   16: core::ops::function::FnOnce::call_once                                                                                                                                        
#11 38.63              at /rustc/0d634185dfddefe09047881175f35c65d68dcff1/library/core/src/ops/function.rs:250:5                                                                              
#11 38.63 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.  

Removing the "migrations" feature causes the generator to work as expected.

@oscartbeaumont
Copy link
Collaborator

Hmm, I can't reproduct this locally.

Can you run the same program with RUST_BACKTRACE=full to try and get the full error trace because that one you shared doesn't give us enough to go off.

Might also be worth ensuring your on the latest version of Rust by doing rustup update.

@StoicDeveloper
Copy link
Author

Running the command with RUST_BACKTRACE=full results in an even more cryptic error:

   Compiling serde-value v0.7.0
   Compiling dotenv v0.15.0
   Compiling prisma-client-rust v0.6.11 (https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d00)
   Compiling rspc-axum v0.1.1
   Compiling prisma-client-rust-cli v0.6.11 (https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d00)
   Compiling MassServer v0.1.0 (/)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 11m 10s
     Running `target/debug/prisma generate`
Downloading https://prisma-photongo.s3-eu-west-1.amazonaws.com/prisma-cli-4.8.0-linux-x64.gz to /root/.cache/prisma/binaries/cli/4.8.0/prisma-cli-linux-x64
Downloading https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/debian-openssl-1.1.x/query-engine.gz to /root/.cache/prisma/binaries/cli/4.8.0/d6e67a83f971b175a593ccc12e15c4a757f93ffe/prisma-query-engine-debian-openssl-1.1.x
Downloading https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/debian-openssl-1.1.x/migration-engine.gz to /root/.cache/prisma/binaries/cli/4.8.0/d6e67a83f971b175a593ccc12e15c4a757f93ffe/prisma-migration-engine-debian-openssl-1.1.x
Downloading https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/debian-openssl-1.1.x/introspection-engine.gz to /root/.cache/prisma/binaries/cli/4.8.0/d6e67a83f971b175a593ccc12e15c4a757f93ffe/prisma-introspection-engine-debian-openssl-1.1.x
Downloading https://binaries.prisma.sh/all_commits/d6e67a83f971b175a593ccc12e15c4a757f93ffe/debian-openssl-1.1.x/prisma-fmt.gz to /root/.cache/prisma/binaries/cli/4.8.0/d6e67a83f971b175a593ccc12e15c4a757f93ffe/prisma-prisma-fmt-debian-openssl-1.1.x
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: 
  42:     0x559c83531f8e - main
  43:     0x7fd32ee9ad0a - __libc_start_main
  44:     0x559c83531e9a - _start
  45:                0x0 - <unknown>

@StoicDeveloper
Copy link
Author

Rust version:

root@3e9690b90a23:/# rustc --version
rustc 1.83.0-nightly (94885bc69 2024-09-01)

The build is occurring on a recent pull of the rust:slim-bullseye docker image.

@StoicDeveloper
Copy link
Author

StoicDeveloper commented Sep 2, 2024

The full steps to reproduce are:
Dockerfile

FROM rust:slim-bullseye AS test-builder
COPY ./src-server .
RUN rustup default nightly
# RUN RUST_BACKTRACE=full cargo prisma generate
ENTRYPOINT ["/bin/bash"]

Shell:

docker build --target test-builder -t mass:builder-test . --progress=plain
docker run --rm -it  --entrypoint bash mass:builder-test

Then in the resulting container REPL:

 apt update && apt install -y pkg-config libssl-dev
RUST_BACKTRACE=full cargo prisma generate

@StoicDeveloper
Copy link
Author

In case it helps rule something out, the same problem appear on stable rust:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 22m 39s
     Running `target/debug/prisma generate`
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: 
  43:     0x55bb63f6775e - main
  44:     0x7f583804ad0a - __libc_start_main
  45:     0x55bb63f675ba - _start
  46:                0x0 - <unknown>



root@25f284190bb6:/# rustc --version
rustc 1.80.1 (3f5fd8dd4 2024-08-06)

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

No branches or pull requests

2 participants