prisma / studio

🎙️ The easiest way to explore and manipulate your data in all of your Prisma projects.
https://www.prisma.io/studio
1.9k stars 47 forks source link

Prisma Studio won't load #1149

Closed guidoaguiar closed 5 months ago

guidoaguiar commented 1 year ago

Bug description

I run the command npx prisma studio

and the fatal error appears straight away.

How to reproduce

Expected behavior

No response

Prisma information

Environment variables loaded from .env
prisma                  : 5.2.0
@prisma/client          : 5.2.0
Current platform        : debian-openssl-3.0.x
Query Engine (Node-API) : libquery-engine 2804dc98259d2ea960602aca6b8e7fdc03c1758f (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine           : schema-engine-cli 2804dc98259d2ea960602aca6b8e7fdc03c1758f (at node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm             : @prisma/prisma-schema-wasm 5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f
Default Engines Hash    : 2804dc98259d2ea960602aca6b8e7fdc03c1758f
Studio                  : 0.494.0
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

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

model Route {
  id          String   @id @default(auto()) @map("_id") @db.ObjectId
  name        String
  source      Place
  destination Place
  distance    Float
  duration    Float
  directions  Json
  created_at  DateTime @default(now())
  updated_at  DateTime @updatedAt
}

type Place {
  name     String
  location Coord
}

type Coord {
  lat Float
  lng Float
}

Environment & setup

Prisma logs

Error starting Prisma Client: {
  "code": "ENOENT",
  "message": "ENOENT: no such file or directory, copyfile '/home/node/.cache/prisma/master/2804dc98259d2ea960602aca6b8e7fdc03c1758f/debian-openssl-3.0.x/libquery-engine' -> '/home/node/app/node_modules/prisma/engines/2804dc98259d2ea960602aca6b8e7fdc03c1758f/libquery_engine-debian-openssl-3.0.x.so.node'",
  "stack": "ENOENT: no such file or directory, copyfile '/home/node/.cache/prisma/master/2804dc98259d2ea960602aca6b8e7fdc03c1758f/debian-openssl-3.0.x/libquery-engine' -> '/home/node/app/node_modules/prisma/engines/2804dc98259d2ea960602aca6b8e7fdc03c1758f/libquery_engine-debian-openssl-3.0.x.so.node'"
}
Error: Error starting Prisma Client: {
  "code": "ENOENT",
  "message": "ENOENT: no such file or directory, copyfile '/home/node/.cache/prisma/master/2804dc98259d2ea960602aca6b8e7fdc03c1758f/debian-openssl-3.0.x/libquery-engine' -> '/home/node/app/node_modules/prisma/engines/2804dc98259d2ea960602aca6b8e7fdc03c1758f/libquery_engine-debian-openssl-3.0.x.so.node'",
  "stack": "ENOENT: no such file or directory, copyfile '/home/node/.cache/prisma/master/2804dc98259d2ea960602aca6b8e7fdc03c1758f/debian-openssl-3.0.x/libquery-engine' -> '/home/node/app/node_modules/prisma/engines/2804dc98259d2ea960602aca6b8e7fdc03c1758f/libquery_engine-debian-openssl-3.0.x.so.node'"
}
    at qs.init (http://localhost:5556/assets/index.js:1:82961)`

Error on terminal:
`[Error: EACCES: permission denied, mkdir '/home/node/app/node_modules/prisma/engines'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/home/node/app/node_modules/prisma/engines'
}
Unable to get DMMF from Prisma Client:  [Error: ENOENT: no such file or directory, copyfile '/home/node/.cache/prisma/master/2804dc98259d2ea960602aca6b8e7fdc03c1758f/debian-openssl-3.0.x/libquery-engine' -> '/home/node/app/node_modules/prisma/engines/2804dc98259d2ea960602aca6b8e7fdc03c1758f/libquery_engine-debian-openssl-3.0.x.so.node'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'copyfile',
  path: '/home/node/.cache/prisma/master/2804dc98259d2ea960602aca6b8e7fdc03c1758f/debian-openssl-3.0.x/libquery-engine',
  dest: '/home/node/app/node_modules/prisma/engines/2804dc98259d2ea960602aca6b8e7fdc03c1758f/libquery_engine-debian-openssl-3.0.x.so.node'
}
janpio commented 1 year ago

Sounds like some software is blocking access to these files that Prisma Studio needs to use when it starts.