(An error occurred during DNS resolution: io error: Error parsing resolv.conf: ProtoError { kind: Msg("Malformed label: --") })
See original GitHub issueBug description
I tried to connect do my atlas mongodb with quickstart guide provided by prisma documentation. But I can’t get it working. Instead, I received the following message:
How to reproduce
- Set .ENV DATABASE_URL=“mongodb+srv://xxxx:xxxx@asuransi-kebakaran.wtor9.mongodb.net/myFirstDatabase?retryWrites=true&w=majority&ssl=true”
- Run npx prisma generate
- yarn start:dev
- See error
Expected behavior
I can connect to my atlas mongodb
Prisma information
// 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 = "mongodb"
url = env("DATABASE_URL")
}
model Users {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
email String
password String
}
Environment & setup
- OS: Manjaro Linux x86_64
- Database: mongodb
- Node.js version: v17.3.0
Prisma Version
prisma : 3.14.0
@prisma/client : 3.14.0
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 2b0c12756921c891fec4f68d9444e18c7d5d4a6a
Studio : 0.460.0
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Troubleshooting the GitLab agent for Kubernetes
This error occurs when a manifest file is malformed and Kubernetes can't create the specified objects. Make sure that your manifest files are...
Read more >parse of /etc/resolv.conf failed - Stack Overflow
In my case /etc/resolv.conf was a symbolic link pointing to /run/resolvconf/resolv.conf (the old config). The following commands fixed it:
Read more >[RHEL 5] What means the error 'nslookup: parse of /etc/resolv ...
conf file to get informations about domains and about the DNS. If you have any wrong parameter in this file the nslookup command...
Read more >Kubernetes pod /etc/resolv.conf has the wrong nameserver
These policies are specified in the dnsPolicy field of a Pod Spec. “ Default “: The Pod inherits the name resolution configuration from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same error. I found a line
search --
in my/etc/resolv.conf
file on my machine (ubuntu). I tried everything to change the file automatically (because there is a warning in the file not to change it manually). However - eventually i commented out the line and prisma seemed fine again. All is fixed.I have no idea why prisma is affected by this file - i have no idea why nothing else on my laptop has problems (only prisma) - but that’s what worked for me.
my resolv.conf file:
yes -
+srv
is in the connection string. It’s worth noting that i have many applications using the same DB running locally and on other machines. 3 are node applications using the basic mongodb library or mongoose. Only the application using Prisma has this problem - and nothing fixes it except alteringresolv.conf
as above (which works every time). So while Prisma may not read the file directly - it certainly alters its behaviour based on its contents - and other mongodb libraries do not.FYI - i am on ubuntu