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.

DB_URL not found when adding sslmode

See original GitHub issue

Bug description

I received the following error when running prisma migrate deploy:

Prisma schema loaded from prisma/schema.prisma
Error: Schema Parsing P1012

Get config 
error: Environment variable not found: DB_URL.
  -->  schema.prisma:5
   | 
 4 |   provider = "postgresql"
 5 |   url      = env("DB_URL")
   | 

It happens only when I add sslmode to the DB_URL as follows: postgresql://user:password@host:port/dbName?sslmode=require

It works just fine without adding the sslmode. Adding other arguments like connection_limit works tho.

Environment & setup

  • OS: Ubuntu 20.04 (LTS) x64
  • Database: PostgreSQL 12
  • Node.js version: 10.17.0
  • Prisma version: @prisma/client": "^2.19.0" "prisma": "^2.19.0"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rvlewerissacommented, Nov 1, 2021

@janpio Hi, sorry for the late reply, haven’t touch the project in a while so I suppose I’ll close this issue! Thank you.

1reaction
pantharshit00commented, May 16, 2021

I am still unable to reproduce this with a Digitalocean managed postgres instance. Can you try again with the latest version of Prisma once?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSL is not enabled on the server - Stack Overflow
sslmode is just added to the db url like a query parameter. Share. Share a link to this answer. Copy link ... This...
Read more >
Connecting to Heroku Postgres
By default, Heroku attempts to enable SSL for the PostgreSQL JDBC driver by setting the property sslmode=require globally. If you're building ...
Read more >
Fix documentation regarding datasource SSL/TLS certificates ...
It seems to be necessary to edit the YAML parser to get these additional configs and if the config is not 'sslmode: "disable"',...
Read more >
Connecting to a PostgreSQL database with Go's database/sql ...
Update your connection string to include sslmode=disable and you should be back in action. pq: role “postgres” does not exist. The terms role...
Read more >
34.1. Database Connection Control Functions - PostgreSQL
If set to 1, an SSL connection to the server is required (this is equivalent to sslmode require ). libpq will then refuse...
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