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.

(An error occurred during DNS resolution: io error: Error parsing resolv.conf: ProtoError { kind: Msg("Malformed label: --") })

See original GitHub issue

Bug 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:

image

How to reproduce

  1. Set .ENV DATABASE_URL=“mongodb+srv://xxxx:xxxx@asuransi-kebakaran.wtor9.mongodb.net/myFirstDatabase?retryWrites=true&w=majority&ssl=true”
  2. Run npx prisma generate
  3. yarn start:dev
  4. 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:open
  • Created a year ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
unalterablecommented, Sep 24, 2022

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:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
# search --
options edns0 trust-ad
1reaction
unalterablecommented, Sep 28, 2022

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 altering resolv.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

Read more comments on GitHub >

github_iconTop 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 >
CoreDNS Manual
Manual covering all aspects of getting and running CoreDNS.
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 >

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