Skip to content

Error: Unique constraint failed on the (not available) on PlanetScale/Vitess #10829

Open

Description

@janpio

Note: Please read #10829 (comment) before responding to this issue.

Bug description

PlanetScale/Vitess does not provide the column name. But additionally to that not showing, we are also missing the additional fields or constraint string that is present in the error, helping the user to figure out what might be wrong.

How to reproduce

Cause unique constraint error on PlanetScale/Vitess

Expected behavior

More helpful error message.

Prisma information

Environment & setup

  • OS:
  • Database:
  • Node.js version:

Prisma Version

3.7.0

Activity

  1. added
    bug/1-unconfirmed
    kind/bug
    on Dec 22, 2021
  2. changed the title [-]Error: Unique constraint failed on the (not available)[/-] [+]`Error: Unique constraint failed on the (not available)`[/+] on Dec 22, 2021
  3. pantharshit00 commented on Dec 22, 2021

    @pantharshit00
    Contributor

    I can confirm with planetscale.

  4. added
    bug/2-confirmed
    and removed
    bug/1-unconfirmed
    on Dec 22, 2021
  5. jonahallibone commented on Jan 5, 2022

    @jonahallibone
  6. robcornn commented on Jan 8, 2022

    @robcornn
  7. dyeoman2 commented on Feb 10, 2022

    @dyeoman2
  8. WorkAttackDev commented on Feb 11, 2022

    @WorkAttackDev
  9. Saleh-Alibrahim commented on Feb 19, 2022

    @Saleh-Alibrahim
  10. dpnick commented on Mar 11, 2022

    @dpnick
  11. 25 remaining items

  12. samheyman commented on Mar 28, 2023

    @samheyman

    Thank you @VivekGupta137 , I was stuck on this for hours. Why can't the error message give more information? Like hint to what column is missing or that there may be an issue with duplicates - rather than a cryptic Unique constraint failed on the (not available)

  13. KODerFunk commented on Jun 8, 2023

    @KODerFunk
  14. Jolg42 commented on Jun 8, 2023

    @Jolg42
  15. changed the title [-]`Error: Unique constraint failed on the (not available)`[/-] [+]`Error: Unique constraint failed on the (not available)` on PlanetScale/Vitess[/+] on Jun 8, 2023
  16. KODerFunk commented on Jun 8, 2023

    @KODerFunk
  17. janpio commented on Jun 8, 2023

    @janpio
    Author
  18. vimtor commented on Jun 13, 2023

    @vimtor

    Facing the same issue here using Planetscale. For me it was creating the same object twice in a deep nested create.

  19. DarlonHenrique commented on Nov 20, 2023

    @DarlonHenrique

    Facing the same issue, I'm making an error handling for my API using prisma, but planet Scale do not put information on the "meta" of the error, It's impossible to know what column is causing the error, if the error does not be solved, probably I will migrate for other database service

  20. shrikantshet commented on Jan 15, 2024

    @shrikantshet

    Still facing the same issue.

  21. lbartoszcze commented on Mar 10, 2024

    @lbartoszcze

    facing this issue too

  22. JacobwBruce commented on Dec 5, 2024

    @JacobwBruce

    Did anyone find a solution for this?

  23. lbartoszcze commented on Dec 5, 2024

    @lbartoszcze

    yes, migrating off planetscale to supabase

  24. JacobwBruce commented on Dec 5, 2024

    @JacobwBruce

    Unfortunately thats not an option for me, my company uses PlanetScale.
    The error doesn't occur locally on a standard MySQL server, only popped up in the last week in our dev server (which uses PlanetScale). Only changes to the dev server were a single migration creating a new table, and updated the Prisma NPM version. Although I tried rolling back the prisma version it didn't solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions