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: Could not parse schema engine response: SyntaxError: Unexpected token '/', "/data/data"... is not valid JSON #24123

Open
RizeKishimaro opened this issue May 8, 2024 · 2 comments
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: android topic: cli

Comments

@RizeKishimaro
Copy link

RizeKishimaro commented May 8, 2024

Bug description

I run
npx prisma migrate dev
And it return

┌──(rizekishimaro@localhost)-[~/social-api]
└─$ npx prisma migrate dev
prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "defaultdb" at "mysql-203202d9-jokerlove2671-fe7a.f.aivencloud.com:12040"

Error: Could not parse schema engine response: SyntaxError: Unexpected token '/', "/data/data"... is not valid JSON

I was running in termux without root

How to reproduce

Expected behavior

No response

Prisma information

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

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

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

model User {
  id             Int             @id @unique @default(autoincrement())
  name           String          @db.VarChar(255)
  password       String
  email          String          @unique @db.VarChar(255)
  picture        String?
  isActive       Boolean         @default(false)
  comments       Comment[]
  videos         Video[]
  createdAt      DateTime        @default(now())
  commentRatings CommentRating[]
  videoRatings   VideoRating[]
  subscribers    Subscriber[]    @relation("subscriber")
  subscriptions  Subscriber[]    @relation("channel")
  activationCode ActivationCode?
}

model ActivationCode {
  id        Int       @id @unique @default(autoincrement())
  code      String    @unique
  expiresAt DateTime?
  user      User      @relation(fields: [userId], references: [id])
  userId    Int       @unique
}

enum Provider {
  google
  facebook
  // add other providers as needed
}

model Comment {
  id            Int             @id @default(autoincrement())
  content       String
  author        User            @relation(fields: [userId], references: [id])
  userId        Int
  createdAt     DateTime        @default(now())
  CommentRating CommentRating[]
}

model CommentRating {
  id        Int     @id @default(autoincrement())
  likes     Int
  dislikes  Int
  comment   Comment @relation(fields: [commentId], references: [id])
  commentId Int
  User      User?   @relation(fields: [userId], references: [id])
  userId    Int?
}

model VideoRating {
  id       Int   @id @default(autoincrement())
  likes    Int
  dislikes Int
  video    Video @relation(fields: [videoId], references: [id])
  videoId  Int
  User     User? @relation(fields: [userId], references: [id])
  userId   Int?
}

model Video {
  id          Int           @id @default(autoincrement())
  title       String
  description String?
  url         String        @unique
  author      User          @relation(fields: [userId], references: [id])
  userId      Int
  createdAt   DateTime      @default(now())
  ratings     VideoRating[]
}

model Subscriber {
  id           Int  @id @default(autoincrement())
  subscriberId Int
  channelId    Int
  subscriber   User @relation("subscriber", fields: [subscriberId], references: [id])
  channel      User @relation("channel", fields: [channelId], references: [id])
}
import { Injectable, OnModuleInit } from "@nestjs/common";
import { PrismaClient } from "@prisma/client";

@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
  async onModuleInit() {
    console.log("Connected To Database....");
    await this.$connect();
  }
}

Environment & setup

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

Prisma Version

prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
Environment variables loaded from .env
prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
Error: Unable to require(`/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node`).
The Prisma engines do not seem to be compatible with your system. Please refer to the documentation about Prisma's system requirements: https://pris.ly/d/system-requirements

Details: dlopen failed: "/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
    at Hee (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:116)
    at Gqe (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:269)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Command failed with exit code 1: /data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x --version
/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[1]: �ELF: inaccessible or not found
/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[2]: syntax error: unexpected ')'
    at Lwe (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:5:57)
    at /data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:5:10625
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Gqe (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:343) {
  shortMessage: 'Command failed with exit code 1: /data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x --version',
  command: '/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x --version',
  escapedCommand: '"/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x" --version',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[1]: \x7FELF\x02\x01\x01\x03: inaccessible or not found\n' +
    "/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[2]: syntax error: unexpected ')'",
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
prisma                  : 5.13.0
@prisma/client          : 5.12.1
Computed binaryTarget   : debian-openssl-1.1.x
Operating System        : android
Architecture            : arm64
Node.js                 : v21.6.2
Query Engine (Node-API) : E_CANNOT_RESOLVE_VERSION (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Schema Engine           : E_CANNOT_RESOLVE_VERSION (at node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x)
Schema Wasm             : @prisma/prisma-schema-wasm 5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b
Default Engines Hash    : b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b
Studio                  : 0.500.0

Tasks

No tasks being tracked yet.
@RizeKishimaro RizeKishimaro added the kind/bug A reported bug. label May 8, 2024
@janpio
Copy link
Member

janpio commented May 8, 2024

prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
Error: Unable to require(`/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node`).
The Prisma engines do not seem to be compatible with your system. Please refer to the documentation about Prisma's system requirements: https://pris.ly/d/system-requirements

Details: dlopen failed: "/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
    at Hee (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:116)
    at Gqe (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:269)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Command failed with exit code 1: /data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x --version
/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[1]: �ELF: inaccessible or not found
/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[2]: syntax error: unexpected ')'

This looks like a serious problem, that is probably also affecting the Schema Engine.

I am not sure Prisma can work on Android as it is.

@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. team/schema Issue for team Schema. team/client Issue for team Client. topic: android labels May 8, 2024
@RizeKishimaro
Copy link
Author

prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
Error: Unable to require(`/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node`).
The Prisma engines do not seem to be compatible with your system. Please refer to the documentation about Prisma's system requirements: https://pris.ly/d/system-requirements

Details: dlopen failed: "/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
    at Hee (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:116)
    at Gqe (/data/data/com.termux/files/home/social-api/node_modules/prisma/build/index.js:295:269)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Command failed with exit code 1: /data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x --version
/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[1]: �ELF: inaccessible or not found
/data/data/com.termux/files/home/social-api/node_modules/@prisma/engines/schema-engine-debian-openssl-1.1.x[2]: syntax error: unexpected ')'

This looks like a serious problem, that is probably also affecting the Schema Engine.

I am not sure Prisma can work on Android as it is.

Now i'm using proot ubuntu distro to perform database migrations and it's works pretty well.

@Weakky Weakky added topic: cli and removed team/client Issue for team Client. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: android topic: cli
Projects
None yet
Development

No branches or pull requests

3 participants