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: called Result::unwrap() on an Err value: "Couldn't parse default value in SQL Server #17069

Closed
jkomyno opened this issue Dec 30, 2022 · 5 comments · Fixed by prisma/prisma-engines#4884
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: prisma db pull CLI: prisma db pull topic: sql server Microsoft SQL Server topic: unwrap error
Milestone

Comments

@jkomyno
Copy link
Contributor

jkomyno commented Dec 30, 2022

Command: prisma db pull
Version: 4.8.0
Binary Version: d6e67a83f971b175a593ccc12e15c4a757f93ffe
Report: https://prisma-errors.netlify.app/report/14485
OS: x64 win32 10.0.22621

JS Stacktrace:

Error: [libs\sql-schema-describer\src\mssql.rs:336:30] called `Result::unwrap()` on an `Err` value: "Couldn't parse default value: `\n/****** Object:  User dbo    Script Date: 1/25/2006 11:12:28 AM ******/\r\n/****** Object:  Default dbo.Dflt_Blank    Script Date: 1/25/2006 11:12:36 AM ******/\r\n\r\n/****** Object:  Default dbo.Dflt_Blank    Script Date: 12/21/2005 10:54:26 AM ******/\r\n\r\n/****** Object:  Default dbo.Dflt_Blank    Script Date: 12/1/2005 1:38:42 PM ******/\r\n\r\n/****** Object:  Default dbo.Dflt_Blank    Script Date: 11/30/2005 3:07:59 PM ******/\r\n\r\n/****** Object:  Default dbo.Dflt_Blank    Script Date: 11/30/2005 1:53:54 PM ******/\r\n\r\n/****** Object:  Default dbo.Dflt_Blank    Script Date: 11/29/2005 2:32:03 PM ******/\r\ncreate default [Dflt_Blank] as ''\r\n\r\n\r\n\r\n\r\n\r\n`"
@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 Dec 30, 2022
@jkomyno jkomyno changed the title Error: called Result::unwrap() on an Err value: "Couldn't parse default value: \n/****** Object: User dbo Script Date: 1/25/2006 11:12:28 AM ******/\r\n/****** Object: Default dbo.Dflt_Blank Script Date: 1/25/2006 11:12:36 AM ******/\r\n\r\n/****** Object: Default dbo.Dflt_Blank Script Date: 12/21/2005 10:54:26 AM ******/\r\n\r\n/****** Object: Default dbo.Dflt_Blank Script Date: 12/1/2005 1:38:42 PM ******/\r\n\r\n/****** Object: Default dbo.Dflt_Blank Script Date: 11/30/2005 3:07:59 PM ******/\r\n\r\n/****** Object: Default dbo.Dflt_Blank Script Date: 11/30/2005 1:53:54 PM ******/\r\n\r\n/****** Object: Default dbo.Dflt_Blank Script Date: 11/29/2005 2:32:03 PM ******/\r\ncreate default [Dflt_Blank] as ''\r\n\r\n\r\n\r\n\r\n\r\n" Error: called Result::unwrap() on an Err value: "Couldn't parse default value in SQL Server Dec 30, 2022
@jkomyno jkomyno added the topic: sql server Microsoft SQL Server label Dec 30, 2022
@Jolg42
Copy link
Contributor

Jolg42 commented Jan 4, 2023

It looks like that user created an issue here #17104

@Jolg42
Copy link
Contributor

Jolg42 commented Jan 4, 2023

We have 6 open issues with "Couldn't parse default" for SQL Server currently https://github.com/prisma/prisma/issues?q=Couldn%27t+parse+default+value+is%3Aopen
Could be worth checking them all

@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
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: prisma db pull CLI: prisma db pull topic: sql server Microsoft SQL Server topic: unwrap error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants