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

Error: [libs\sql-schema-describer\src\mssql.rs:336:30] called Result::unwrap() on an Err value: "Couldn't parse default value: \r\ncreate default [va_nulla] as 0\r\n" #17292

Closed
jkomyno opened this issue Jan 13, 2023 · 4 comments · Fixed by prisma/prisma-engines#4884
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/bug A reported bug. topic: CREATE DEFAULT ... AS ... topic: default topic: error reporting Issues created via Prisma's CLI Crash Reporting topic: introspection topic: sql server Microsoft SQL Server topic: unwrap error
Milestone

Comments

@jkomyno
Copy link
Contributor

jkomyno commented Jan 13, 2023

Command: prisma introspect
Version: 4.8.1
Binary Version: d6e67a83f971b175a593ccc12e15c4a757f93ffe
Report: https://prisma-errors.netlify.app/report/14503
OS: x64 win32 10.0.19045

JS Stacktrace:

Error: [libs\sql-schema-describer\src\mssql.rs:336:30] called `Result::unwrap()` on an `Err` value: "Couldn't parse default value: `\r\ncreate default [va_nulla] as 0\r\n`"

In here, we have:

  let default_string = DEFAULT_NON_STRING
      .captures_iter(&default_string)
      .next()
      .or_else(|| DEFAULT_STRING.captures_iter(&default_string).next())
      .or_else(|| DEFAULT_DB_GEN.captures_iter(&default_string).next())
      .map(|cap| cap[1].to_string())
      .ok_or_else(|| format!("Couldn't parse default value: `{}`", default_string))
      .unwrap();
@jkomyno jkomyno added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. topic: error reporting Issues created via Prisma's CLI Crash Reporting domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. labels Jan 13, 2023
@janpio janpio added the topic: sql server Microsoft SQL Server label Jan 13, 2023
@jkomyno
Copy link
Contributor Author

jkomyno commented May 26, 2023

This was already happening in prisma@3.15.2: https://prisma-errors.netlify.app/report/14761

@jkomyno
Copy link
Contributor Author

jkomyno commented Jun 29, 2023

Other report (from a user): #19971

@janpio
Copy link
Contributor

janpio commented May 23, 2024

We still do not know how to make Introspection crash because of the existence of such an index.
We need a SQL dump of a database that reproduces this behavior to replicate this behavior.

(For us the default is just ignored and not represented in the Prisma schema: #12150)

@janpio janpio added topic: CREATE DEFAULT ... AS ... bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. labels May 23, 2024
@janpio janpio self-assigned this May 23, 2024
@janpio
Copy link
Contributor

janpio commented May 23, 2024

Reproduced: The line breaks cause this, see #24275

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/bug A reported bug. topic: CREATE DEFAULT ... AS ... topic: default topic: error reporting Issues created via Prisma's CLI Crash Reporting topic: introspection topic: sql server Microsoft SQL Server topic: unwrap error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants