uralsmh
uralsmh
PPrisma
Created by uralsmh on 8/4/2024 in #help-and-questions
Issues with Prisma 5.3.1: OpenSSL Version Mismatch during Build and Runtime in Docker
Will try but should i use 3.x.x? Isn't it up to date one
6 replies
PPrisma
Created by uralsmh on 8/4/2024 in #help-and-questions
Issues with Prisma 5.3.1: OpenSSL Version Mismatch during Build and Runtime in Docker
@Jon Harrell nope. I have two confusion. 1- Do I really have to install openssl? If yes, do i have to install specifically openssl-1.1.x ? RUN --mount=type=cache,target=/var/cache/apt \ apt-get update && \ apt-get --no-install-recommends install -y openssl && \ rm -rf /var/lib/apt/lists/* 2- Should I really add the binaryTargets in Array?
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
}
6 replies
PPrisma
Created by uralsmh on 8/4/2024 in #help-and-questions
Issues with Prisma 5.3.1: OpenSSL Version Mismatch during Build and Runtime in Docker
This is the full error when I ran docker container as well.
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "linux-arm64-openssl-1.1.x".

This happened because Prisma Client was generated for "linux-arm64-openssl-3.0.x", but the actual deployment required "linux-arm64-openssl-1.1.x".
Add "linux-arm64-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:

generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
}

The following locations have been searched:
/app/node_modules/.prisma/client
/app/node_modules/@prisma/client
/tmp/prisma-engines
/app
at va (/app/node_modules/@prisma/client/runtime/library.js:63:805)
at async Object.loadLibrary (/app/node_modules/@prisma/client/runtime/library.js:110:10060)
at async Tr.loadEngine (/app/node_modules/@prisma/client/runtime/library.js:111:448)
at async Tr.instantiateLibrary (/app/node_modules/@prisma/client/runtime/library.js:110:12575) {
clientVersion: '5.17.0',
errorCode: undefined
}
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "linux-arm64-openssl-1.1.x".

This happened because Prisma Client was generated for "linux-arm64-openssl-3.0.x", but the actual deployment required "linux-arm64-openssl-1.1.x".
Add "linux-arm64-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:

generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
}

The following locations have been searched:
/app/node_modules/.prisma/client
/app/node_modules/@prisma/client
/tmp/prisma-engines
/app
at va (/app/node_modules/@prisma/client/runtime/library.js:63:805)
at async Object.loadLibrary (/app/node_modules/@prisma/client/runtime/library.js:110:10060)
at async Tr.loadEngine (/app/node_modules/@prisma/client/runtime/library.js:111:448)
at async Tr.instantiateLibrary (/app/node_modules/@prisma/client/runtime/library.js:110:12575) {
clientVersion: '5.17.0',
errorCode: undefined
}
6 replies
PPrisma
Created by uralsmh on 6/18/2024 in #help-and-questions
prisma is generating some crappy migrations for no reason
Applying migration `20240618103051_action_dependency`
Error: P3018

A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

Migration name: 20240618103051_action_dependency

Database error code: 42704

Database error:
ERROR: constraint "ActionDependencyList_pkey" of relation "ActionDependencyList" does not exist

DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42704), message: "constraint \"ActionDependencyList_pkey\" of relation \"ActionDependencyList\" does not exist", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("tablecmds.c"), line: Some(12038), routine: Some("ATExecDropConstraint") }
Applying migration `20240618103051_action_dependency`
Error: P3018

A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

Migration name: 20240618103051_action_dependency

Database error code: 42704

Database error:
ERROR: constraint "ActionDependencyList_pkey" of relation "ActionDependencyList" does not exist

DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42704), message: "constraint \"ActionDependencyList_pkey\" of relation \"ActionDependencyList\" does not exist", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("tablecmds.c"), line: Some(12038), routine: Some("ATExecDropConstraint") }
I could not able to fix above error without modifying the script with below..
ALTER TABLE "ActionDependencyList" ADD COLUMN "filename" TEXT NOT NULL,
DROP COLUMN if exists "actions",
ALTER TABLE "ActionDependencyList" ADD COLUMN "filename" TEXT NOT NULL,
DROP COLUMN if exists "actions",
2 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
ok I deleted all the records and re-run the npx prisma migrate dev, where seems worked now
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
Or run first DELETE FROM public."ActionDependencyList"; and then run again npx prisma migrate dev ?
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
Shall I edit below part manually in migration.sql? ADD COLUMN "filename" TEXT NOT NULL
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
Seems the column is not created btw.. Sorry for dump question but how should I update the column to be nullabable?
Personally I would update your column to be nullable or to have a default value.
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
No description
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
Should I run npx prisma reset before the npx prisma migrate dev?
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
@Jon Harrell is there any other command do I have to run before npx prisma migrate? And what I understood, I need to delete all records in my database where i ve some records, am I right?
12 replies
PPrisma
Created by uralsmh on 5/24/2024 in #help-and-questions
ERROR: column "filename" of relation "ActionDependencyList" contains null values
This is my model where I made some changes.
model ActionDependencyList {
repository_id BigInt
repository_name String
filename String
actions String[]
repository Repository @relation(fields: [repository_id], references: [repository_id])

@@id([repository_id, filename])
}
model ActionDependencyList {
repository_id BigInt
repository_name String
filename String
actions String[]
repository Repository @relation(fields: [repository_id], references: [repository_id])

@@id([repository_id, filename])
}
Output of migration.sql when I ran npx prisma migrate dev
/*
Warnings:

- The primary key for the `ActionDependencyList` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The `actions` column on the `ActionDependencyList` table would be dropped and recreated. This will lead to data loss if there is data in the column.
- Added the required column `filename` to the `ActionDependencyList` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "ActionDependencyList" DROP CONSTRAINT "ActionDependencyList_pkey",
ADD COLUMN "filename" TEXT NOT NULL,
DROP COLUMN "actions",
ADD COLUMN "actions" TEXT[],
ADD CONSTRAINT "ActionDependencyList_pkey" PRIMARY KEY ("repository_id", "filename");

-- AddForeignKey
ALTER TABLE "ActionDependencyList" ADD CONSTRAINT "ActionDependencyList_repository_id_fkey" FOREIGN KEY ("repository_id") REFERENCES "Repository"("repository_id") ON DELETE RESTRICT ON UPDATE CASCADE;
/*
Warnings:

- The primary key for the `ActionDependencyList` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The `actions` column on the `ActionDependencyList` table would be dropped and recreated. This will lead to data loss if there is data in the column.
- Added the required column `filename` to the `ActionDependencyList` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "ActionDependencyList" DROP CONSTRAINT "ActionDependencyList_pkey",
ADD COLUMN "filename" TEXT NOT NULL,
DROP COLUMN "actions",
ADD COLUMN "actions" TEXT[],
ADD CONSTRAINT "ActionDependencyList_pkey" PRIMARY KEY ("repository_id", "filename");

-- AddForeignKey
ALTER TABLE "ActionDependencyList" ADD CONSTRAINT "ActionDependencyList_repository_id_fkey" FOREIGN KEY ("repository_id") REFERENCES "Repository"("repository_id") ON DELETE RESTRICT ON UPDATE CASCADE;
12 replies