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

db push / migrate is hiding the binary download process during generate, leading to confusion #6926

Closed
carlitorweb opened this issue May 4, 2021 · 7 comments · Fixed by #7436
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. topic: prisma db push CLI: prisma db push
Milestone

Comments

@carlitorweb
Copy link

Bug description

When you enable Napi and try npx prisma db push --preview-feature the process stuck running the generators.

How to reproduce

  1. Enable Napi by adding previewFeatures = ["napi"] to your schema.prisma
  2. Run npx prisma db push --preview-feature
  3. The process then stuck at: Running generate... (Use --skip-generate to skip the generators)

Expected behavior

Generators finish successful

Prisma information

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["napi"]
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

model Posts {
  id        Int      @id @default(autoincrement())
  title     String
  content   String   @db.VarChar(500)
  creator   User     @relation(fields: [authorId], references: [id])
  authorId  Int
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

model User {
  id       Int     @id @default(autoincrement())
  posts    Posts[]
  name     String
  email    String  @unique
  password String
  status   String  @default("I am new!")
}

Environment & setup

  • OS: LTS Ubuntu
  • Database: MySQL - MariaDB (Docker image: linuxserver/mariadb:latest)
  • Node.js version: LTS (but also tested with v16 with same result)
  • Prisma version: 2.21.2
prisma               : 2.21.2
@prisma/client       : 2.21.2
Current platform     : debian-openssl-1.1.x
Query Engine         : query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine     : migration-engine-cli e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary        : prisma-fmt e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : e421996c87d5f3c8f7eeadd502d4ad402c89464d
Studio               : 0.371.0
Preview Features     : napi
@janpio janpio added topic: node-api formerly `nApi` bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels May 4, 2021
@janpio
Copy link
Member

janpio commented May 4, 2021

Can you run npx prisma generate on its own successfully with napi enabled?
(What you had posted in #6926 before indicated the Migrations were fine, but the Client generation afterwards failed)

@carlitorweb
Copy link
Author

@janpio after run npx prisma generate is start to Downloading Prisma engines for debian-openssl-1.1.x... ....I'm bit confuse now with this :/ ...will let you know when finish the download what happen.

@carlitorweb
Copy link
Author

It finish successfully

@carlitorweb
Copy link
Author

Running again npx prisma db push --preview-feature and it finish now successfully. So, seen the problem was on my side, right?

@janpio janpio added the topic: prisma migrate dev CLI: prisma migrate dev label May 4, 2021
@janpio
Copy link
Member

janpio commented May 4, 2021

I think that was also running in the background when it got stuck - and waiting a bit more would probably have succeeded as well (Can you maybe nuke your node_modules, run npm install and then try again?). But of course we are hiding this progress output in db push here - which I would consider a usability problem.

@janpio janpio added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. topic: node-api formerly `nApi` labels May 4, 2021
@janpio janpio changed the title Enabling Napi stuck the generators process using db push db push is hiding the binary download process, leading to confusion May 4, 2021
@janpio janpio added topic: prisma db push CLI: prisma db push team/schema Issue for team Schema. and removed topic: prisma migrate dev CLI: prisma migrate dev labels May 4, 2021
@carlitorweb
Copy link
Author

carlitorweb commented May 8, 2021

@janpio is correct, after remove the node_modules, and run npm install the process was running in the background.

Today I install v2.22.1, and I see a script downloaded already the engine, so this problem will not repeat from new install.

@janpio
Copy link
Member

janpio commented May 10, 2021

Thanks, so we should really make sure this is more visible to users and they/you will not be confused about this any more.

@tomhoule tomhoule added this to the 2.24.0 milestone May 19, 2021
@Jolg42 Jolg42 self-assigned this May 27, 2021
@tomhoule tomhoule modified the milestones: 2.24.0, 2.25.0 Jun 2, 2021
@Jolg42 Jolg42 changed the title db push is hiding the binary download process, leading to confusion db push / migrate is hiding the binary download process during generate, leading to confusion Jun 3, 2021
@Jolg42 Jolg42 linked a pull request Jun 3, 2021 that will close this issue
Jolg42 added a commit that referenced this issue Jun 4, 2021
…hanged-files

* commit '6014bf287ff0acc1470c96df660199fc023c5f2e': (170 commits)
  fix(deps): update engines to v2.25.0-10.7eca2458569e8183a865bc4f7b1d842572edce4a
  test(client): snapshot params from middleware (#7441)
  fix(deps): update engines to v2.25.0-9.de005f74e95623a80a9912ba883fd105fcac5fda (#7435)
  fix(db,migrate): show download progress during generate closes #6926 (#7436)
  fix(deps): update engines to v2.25.0-6.54f085fd8a8bc6f28dc0d3e3d6e303c5111318d2 (#7433)
  fix(client): remove debug export (#7430)
  fix(deps): update engines to v2.25.0-5.78b0f2b031373a23869ef1ceace79ab171aa9273
  chore: cleanup middleware implementation (#6969)
  chore(client): prettier (#7420)
  fix(deps): update engines to v2.25.0-4.c735c0754168e23ac1aa936076bc98cee981d001 (#7418)
  fix(deps): update engines to v2.25.0-1.5554c45c4cb79fd93d7f92ae45d305c4c57abd36 (#7414)
  chore(deps): update jest
  chore: fix renovate config [skip ci]
  chore(renovate): add jest group
  chore: renovate masterIssue to dependencyDashboard
  chore(deps): update devdependencies (non-major) to v4.26.0
  fix(deps): update dependency dotenv to v10 (#7210)
  chore(deps): update dependency ts-node to v10 (#7238)
  chore: escape back-tick during git tag when publishing
  fix(deps): update engines to v2.24.0-30.f3e341280d96d0abc068f97e959ddf01f321a858 (#7393)
  ...
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. kind/bug A reported bug. team/schema Issue for team Schema. topic: prisma db push CLI: prisma db push
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants