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

Reformatter crash in relation code #13742

Closed
tomhoule opened this issue Jun 10, 2022 · 0 comments · Fixed by prisma/prisma-engines#3014
Closed

Reformatter crash in relation code #13742

tomhoule opened this issue Jun 10, 2022 · 0 comments · Fixed by prisma/prisma-engines#3014
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: error reporting Issues created via Prisma's CLI Crash Reporting topic: prisma format CLI: prisma format
Milestone

Comments

@tomhoule
Copy link
Contributor

Referencing fields are NA, we should write a test repro and fix that.

Command: prisma format
Version: 3.15.0
Binary Version: b9297dc3a59307060c1c39d7e4f5765066f38372
Report: https://prisma-errors.netlify.app/report/14042
OS: arm64 darwin 21.2.0

JS Stacktrace:

Error: Command failed with exit code 101: /..../pnpm/store/v3/tmp/dlx-35262/node_modules/.pnpm/@prisma+engines@3.15.0-29.b9297dc3a59307060c1c39d7e4f5765066f38372/node_modules/@prisma/engines/prisma-fmt-darwin-arm64 format -i /...no/libraries/data-access/prisma/schema.prisma
    at _Format.parse (....store/v3/tmp/dlx-35262/node_modules/.pnpm/prisma@3.15.0/node_modules/prisma/build/index.js:96309:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async main (/....store/v3/tmp/dlx-35262/node_modules/.pnpm/prisma@3.15.0/node_modules/prisma/build/index.js:98081:18)

Rust Stacktrace:

Error: Command failed with exit code 101:....pnpm/store/v3/tmp/dlx-35262/node_modules/.pnpm/@prisma+engines@3.15.0-29.b9297dc3a59307060c1c39d7e4f5765066f38372/node_modules/@prisma/engines/prisma-fmt-darwin-arm64 format -i ...prisma/schema.prisma
thread 'main' panicked at 'not yet implemented', libs/datamodel/parser-database/src/walkers/relation/inline.rs:146:46
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: parser_database::walkers::relation::inline::InlineRelationWalker::forward_relation_field_arity
   4: datamodel::reformat::Reformatter::new
   5: datamodel::reformat::reformat
   6: prisma_fmt::format::run
   7: prisma_fmt::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    at makeError ....y/pnpm/store/v3/tmp/dlx-35262/node_modules/.pnpm/prisma@3.15.0/node_modules/prisma/build/index.js:3673:18)
    at handlePromise (..../pnpm/store/v3/tmp/dlx-35262/node_modules/.pnpm/prisma@3.15.0/node_modules/prisma/build/index.js:4426:33)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

@tomhoule tomhoule added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: error reporting Issues created via Prisma's CLI Crash Reporting team/schema Issue for team Schema. labels Jun 10, 2022
@janpio janpio added the topic: prisma format CLI: prisma format label Jun 10, 2022
tomhoule added a commit to prisma/prisma-engines that referenced this issue Jun 28, 2022
This makes it explicitly a private concern of the reformatter that the
rest of the code does not need to worry about. As a side effect, we do
not allocate anymore for potentially inferred fields in validations, and
some validations as well as lifting gets simpler.

closes prisma/prisma#13742 as a side effect
@janpio janpio added this to the 4.1.0 milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: error reporting Issues created via Prisma's CLI Crash Reporting topic: prisma format CLI: prisma format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants