question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Given exponent overflowing the maximum accepted scale (255).: TryFromIntError(())

See original GitHub issue

Hi Prisma Team! My Prisma Client just crashed. This is the report:

Versions

Name Version
Node v16.16.0
OS linux-musl
Prisma Client 4.2.1
Query Engine 2920a97877e12e055c1333079b8d19cee7f33826
Database sqlserver

Logs

prisma:tryLoadEnv Environment variables not found at null
prisma:tryLoadEnv Environment variables not found at undefined
prisma:tryLoadEnv No Environment variables loaded
prisma:tryLoadEnv Environment variables not found at null
prisma:tryLoadEnv Environment variables not found at undefined
prisma:tryLoadEnv No Environment variables loaded
prisma:client dirname /opt/bku-sync-final/node_modules/@@internal/prisma/client/sqlserver/cabang
prisma:client relativePath ../../../../../../src/util/db/sqlserver
prisma:client cwd /opt/bku-sync-final/src/util/db/sqlserver
prisma:client clientVersion 4.2.1
prisma:client clientEngineType library
prisma:client:libraryEngine internalSetup
prisma:client:libraryEngine:loader Searching for Query Engine Library in /opt/bku-sync-final/node_modules/@@internal/prisma/client/.prisma/client
prisma:client:libraryEngine:loader Searching for Query Engine Library in /opt/bku-sync-final/node_modules/@@internal/prisma/client/sqlserver/cabang
prisma:client:libraryEngine:loader loadEngine using /opt/bku-sync-final/node_modules/@@internal/prisma/client/sqlserver/cabang/libquery_engine-linux-musl.so.node
prisma:client:libraryEngine sending request, this.libraryStarted: false
prisma:client:libraryEngine library starting
prisma:client:libraryEngine library started

Client Snippet

// PLEASE FILL YOUR CODE SNIPPET HERE
dbContext.aktivasi_bku
                .upsert({
                    where: {
                        id_anggaran_id_periode: {
                            id_anggaran: data.id_anggaran,
                            id_periode: data.id_periode,
                        },
                    },
                    create: data,
                    update: data,
                })

Schema

// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE
model aktivasi_bku {
  id_anggaran            String       @db.Uuid
  id_periode             Decimal      @db.Decimal(2, 0)
  tanggal_aktivasi       DateTime     @db.Timestamp(6)
  tanggal_finish         DateTime?    @db.Timestamp(6)
  saldo_awal_bank        Decimal?     @db.Money
  saldo_awal_tunai       Decimal?     @db.Money
  saldo_akhir_bank       Decimal?     @db.Money
  saldo_akhir_tunai      Decimal?     @db.Money
  saldo_awal_bank_sisa   Decimal?     @db.Money
  saldo_awal_tunai_sisa  Decimal?     @db.Money
  saldo_akhir_bank_sisa  Decimal?     @db.Money
  saldo_akhir_tunai_sisa Decimal?     @db.Money
  soft_delete            Decimal      @db.Decimal(1, 0)
  create_date            DateTime     @db.Timestamp(6)
  last_update            DateTime     @db.Timestamp(6)
  updater_id             String?      @db.Uuid
  anggaran               anggaran     @relation(fields: [id_anggaran], references: [id_anggaran], onUpdate: Restrict, map: "FK_aktivasi_bku_anggaran_id_anggaran")
  ref_periode            ref_periode  @relation(fields: [id_periode], references: [id_periode], onUpdate: Restrict, map: "FK_aktivasi_bku_ref_periode_id_periode")
  report_bku             report_bku[]

  @@id([id_anggaran, id_periode], map: "PK_aktivasi_bku")
  @@index([id_periode], map: "IX_aktivasi_bku_id_periode")
}

Prisma Engine Query

{"X":{}}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hitzam-wartekcommented, Aug 31, 2022

@danstarns @Jolg42 here’s the data I tried to upsert:

    "id_anggaran": "5b329d4e-3eab-4d21-95fa-820f23bfe1c2",
    "id_periode": 90,
    "tanggal_aktivasi": "2022-10-01T07:00:00.000Z",
    "tanggal_finish": "2022-10-31T07:00:00.000Z",
    "saldo_awal_bank": 14495000,
    "saldo_awal_tunai": 0,
    "saldo_akhir_bank": 13895000,
    "saldo_akhir_tunai": 0,
    "saldo_awal_bank_sisa": 0,
    "saldo_awal_tunai_sisa": 0,
    "saldo_akhir_bank_sisa": 0,
    "saldo_akhir_tunai_sisa": 0,
    "soft_delete": 0,
    "create_date": "2022-08-31T18:46:52.000Z",
    "last_update": "2022-08-31T19:43:22.000Z",
    "updater_id": "9776290b-c309-41c5-a339-568ad0425e9b"
}
0reactions
hitzam-wartekcommented, Sep 6, 2022

nice info. thanks… 😃 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Given exponent overflowing the maximum accepted scale ...
The only place where we throw this is when somebody creates a BigDecimal with a scale that is bigger than 255, then tries...
Read more >
TryFromIntError usage - rust - Stack Overflow
TryFromIntError is a tuple struct with private fields (hence the (_) in the documentation). The type doesn't expose any way to construct an ......
Read more >
Prisma 4.4.0 Release - GitClear
test(client): int overflow #13913 (#15545). Authored September 27, 2022 ... Given exponent overflowing the maximum accepted scale (255).
Read more >
TryFromIntError in std::num - Rust
The error type returned when a checked integral type conversion fails.
Read more >
mod.rs.html -- source
Operations like `+` on `u32` values is intended to never overflow, /// and in some debug configurations overflow is detected and results ///...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found