question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PANIC: 'trust_cert' and 'trust_cert_ca' are mutual exclusive! Only use one.

See original GitHub issue

Hi Prisma Team! My Prisma Client just crashed. This is the report:

Versions

Name Version
Node v16.15.0
OS windows
Prisma Client 4.1.0
Query Engine 8d8414deb360336e4698a65aa45a1fbaf1ce13d8
Database sqlserver

Logs

prisma:tryLoadEnv Environment variables loaded from C:\Users\mitch\Documents\GitHub\mudbath-sandbox\main\.env
prisma:tryLoadEnv Environment variables loaded from C:\Users\mitch\Documents\GitHub\mudbath-sandbox\main\.env
prisma:client dirname C:\Users\mitch\Documents\GitHub\mudbath-sandbox\main\node_modules\.prisma\client
prisma:client relativePath ..\..\..\prisma
prisma:client cwd C:\Users\mitch\Documents\GitHub\mudbath-sandbox\main\prisma
prisma:client clientVersion: 4.1.0
prisma:client clientEngineType: library
prisma:client:libraryEngine internalSetup
prisma:client:libraryEngine:loader Searching for Query Engine Library in C:\Users\mitch\Documents\GitHub\mudbath-sandbox\main\node_modules\.prisma\client
prisma:client:libraryEngine:loader loadEngine using C:\Users\mitch\Documents\GitHub\mudbath-sandbox\main\node_modules\.prisma\client\query_engine-windows.dll.node
prisma:client:libraryEngine sending request, this.libraryStarted: false
prisma:client:libraryEngine library starting

Client Snippet

import pkg from '@prisma/client'
const { PrismaClient } = pkg;
const prisma = new PrismaClient()

import express from 'express'
const app = express();

async function main() {
    const user1 = await prisma.users.findUnique({
        where: {
        email: 'JaneDoe@example.com'
      },
        select: {
          email: true
        }
    }
    )
    console.log(user1)

Schema

// 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 = "sqlserver"
  url      = "sqlserver://localhost:1433;database=hashi_db;user=SA;password=myPassword;encrypt=true;trustServerCertificate=true;integratedSecurity=false;"
}

model users {=
  email        String  @id @db.VarChar(255)
  first_name   String? @db.VarChar(255)
  last_name    String? @db.VarChar(255)
  jira_id      String @db.VarChar(255)
  wrike_id     String @db.VarChar(255)
  created_by   String? @db.VarChar(255)
  created_date DateTime @default(now())
  updated_by   String? @db.VarChar(255)
  updated_date DateTime?
}

model projects {=
  project_name String  @id @db.VarChar(255)
  client_name  String? @db.VarChar(255)
  jira_id      String @db.VarChar(255)
  wrike_id     String @db.VarChar(255)
  created_by   String? @db.VarChar(255)
  created_date DateTime @default(now())
  updated_by   String? @db.VarChar(255)
  updated_date DateTime?
}

I have updated Prisma via npm today. Prisma studio is currently working correctly and is able to connect to my database.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mitchell-wallacecommented, Oct 19, 2022

Sorry for the slow response.

A little story of how I found this issue. I had been connecting to a local MSSQL database, but had to change to connecting to one in docker, and it wasn’t working at first so I was just trying anything to get it working. I found some flags to put in my connection string to trust the certificate, and to trust the CA, and set both of them to true, but it didn’t change what errors I was getting. This was on Prisma 3.13. I then updated to Prisma 4.1 as a troubleshooting step and started getting this error of setting both trust_cert and trust_cert_ca, so I removed the flag to trust the CA, but I kept getting that error. I suspected that something outside the connection string was remembering these settings. I don’t remember if at the time the connection string was directly in schema.prisma or in my .env file.

Now I’ve pulled up an old copy of this project and got it running. I can’t find any documentation of what flag I was using to trust the CA, and I’ve looked in old files, source control, and online. It was very similar to the trustServerCertificate flag; I think it was trustServerCertificateCA, but I can’t find any proof of that. I’ve tried a few guesses at what it might have been, while upgrading/downgrading between Prisma 3.13 and Prisma 4.1, but can’t seem to reproduce that error message even when intentionally trying to set both trust_cert and trust_cert_ca via the connection string. Annoyingly, the old project seems to be working fine now.

1reaction
mitchell-wallacecommented, Sep 23, 2022

Hi, sorry the project I was working on using Prisma had to change to a different tech stack for reasons unrelated to this issue. I’ll try to find time to share a reproduction in the next week or so if possible.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Jan Piotrowski @.> Sent: Saturday, September 24, 2022 1:31:01 AM To: prisma/prisma @.> Cc: Mitchell Wallace @.>; Mention @.> Subject: Re: [prisma/prisma] PANIC: ‘trust_cert’ and ‘trust_cert_ca’ are mutual exclusive! Only use one. (Issue #14486)

Ping @mitchell-wallacehttps://github.com/mitchell-wallace - can you help us out here? We rely on more information to be able to reproduce this, otherwise we will have to close the issue and wait until someone else reports it again. Thanks.

— Reply to this email directly, view it on GitHubhttps://github.com/prisma/prisma/issues/14486#issuecomment-1256363432, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJDXSNGF4DQ5GVW3VP3TB3TV7XELLANCNFSM54UIERRQ. You are receiving this because you were mentioned.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Certificate of Trust: What is it and Why Do I Need It
A Certification of Trust is a legal document that can be used to certify both the existence of a Trust, as well as...
Read more >
Certification of Trust: What Is It and How to Use It? - Werner Law
A certification of trust is a document certifying that a trust was established and is under the management of a certain trustee. Learn...
Read more >
“Trust” but Verify: Trust Certificates Can Be a Win-Win for ...
The statute makes clear that a trust certificate need not include the dispositive terms of the trust, but it does permit the lender,...
Read more >
California Trusts and Estates Quarterly
This article provides an overview of common international trust and estate issues, and the rules and best practices that even the most domestic...
Read more >
Wills and Living Trusts: The Basics
Wills and living trusts are not mutually exclusive estate planning devices. In fact, if you have a trust, you should probably have a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found