prisma-dart icon indicating copy to clipboard operation
prisma-dart copied to clipboard

Prisma Engine does not start (PrismaClientInitializationError: null Engine startup failed.)

Open urusaich opened this issue 1 year ago • 2 comments

What version of Prisma Dart is running?

5.2.1

What version of Prisma CLI is running?

5.22.0

What type of app are you using?

Dart Native (Server/CLI)

What database are you using?

MariaDB

What steps can reproduce the bug?

Hello everyone! Unfortunately I can't provide the source code now, but I made a dump of the arguments with which the engine starts. After looking at them, can you please help me?

arguments:

--enable-metrics, --enable-raw-queries, --engine-protocol, json, --port, 0

environment:

SECURITYSESSIONID: 186a3
DATABASE_URL: mysql://game:password@localhost:3306/game
DATABASE_URL_TESTING: mysql://game:password@localhost:3307/game
RUST_BACKTRACE: 1
RUST_LOG: info
OVERWRITE_DATASOURCES: W3sibmFtZSI6ImRiIiwidXJsIjoibXlzcWw6Ly9nYW1lOnBhc3N3b3JkQGxvY2FsaG9zdDozMzA3L2dhbWUifV0=
PRISMA_DML: Ly8gVGhpcyBpcyB0ZXN0aW5nIFByaXNtYSBzY2hlbWEgZmlsZQ==

prisma-query-engine output:

{
  "is_panic": false,
  "message": "Error in data model: Diagnostics { errors: [DatamodelError { span: Span { start: 0, end: 0, file_id: FileId(0) },     message: \"Error validating: You defined no datasource. You must define exactly one datasource.\" }], warnings: [] }",
  "backtrace":"0: __mh_execute_header\n   1: __mh_execute_header\n   2: __mh_execute_header\n   3: __mh_execute_header\n   4: __mh_execute_header\n   5: __mh_execute_header\n   6: __mh_execute_header\n"
}

Both 3306 and 3307 ports and listens.

urusaich avatar Nov 20 '24 19:11 urusaich

[{"name":"db","url":"mysql://game:password@localhost:3307/game"}] // This is testing Prisma schema file

Judging from your DML, your schema.prisma content is empty, which is the cause.

medz avatar Nov 21 '24 07:11 medz

If your current schema.prisma has the correct datasource and model definitions, you need to re-run prisma generate to generate a new client.

medz avatar Nov 21 '24 07:11 medz