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.

Deploying on Server - MongoParseError

See original GitHub issue

Hi Arun,

This has to be best piece of GUI for Mongo I have seen ever.

kudos for the great work - have to buy you coffee sometime soon.

So there is this section you mention in your documentation:

Installed via npm:

mongo-gui -u mongodb+srv://<username>:<password>@host/<dbnames>?retryWrites=true&w=majority

I’d like to execute this line as this:

mongo-gui -u mongodb+srv://steve:mi%23llion@localhost:27071/chickendb?retryWrites=true&w=majority

Which should open a port 4321 where I can view from my server e.g. http:32.66.74.32:4321

But I keep getting this error:

Failed to connect mongoDB - MongoParseError: URI does not have hostname, domain name and tld

Kindly tell me what I am doing wrong.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
SteveFirsakecommented, Apr 10, 2021

It worked!!

This is what I did - let me leave this here for future reference to others:

  1. Open mongo on your server via the terminal

  2. Mongo will print out a line with the link you need to use e.g. mongodb://127.0.0.1:27017/?authSource=admin&compressors=disabled&gssapiServiceName=mongodb

  3. Use this for the -u tag. In my case I had to remove compressors section and user:password@127.0.0.1… at the beginning of the URL.

Now all that is left is to figure out how to automate this step by default - not having to run to the terminal over and over again.

Also note - your user may need a root role: https://stackoverflow.com/questions/23943651/mongodb-admin-user-not-authorized

0reactions
SteveFirsakecommented, Apr 10, 2021

Hello @arunbandari ,

mongo-gui

By itself works on my server by opening up a browser. It is using the admin user who can edit many thing 😦

So I created a user that only has “find” or “read” roles 😃

I tried:

mongo-gui -u mongodb://localhost:27017/powerless_user -p 4321

On the server so that I can get it to fire up an instance for exploring in a browser. For that user. But I get this error:

`events.js:167 throw er; // Unhandled ‘error’ event ^

Error: listen EADDRINUSE :::4321 at Server.setupListenHandle [as _listen2] (net.js:1286:14) at listenInCluster (net.js:1334:12) at Server.listen (net.js:1421:7) at Function.listen (/home/steve/.nvm/versions/node/v10.13.0/lib/node_modules/mongo-gui/node_modules/express/lib/application.js:618:24) at Function.app.once (/home/steve/.nvm/versions/node/v10.13.0/lib/node_modules/mongo-gui/server.js:47:7) at Object.onceWrapper (events.js:273:13) at Function.emit (events.js:182:13) at InitDB.mongoClient.connect.then.client (/home/steve/.nvm/versions/node/v10.13.0/lib/node_modules/mongo-gui/src/db/dataAccessAdapter.js:27:24) at process._tickCallback (internal/process/next_tick.js:68:7) Emitted ‘error’ event at: at emitErrorNT (net.js:1313:8) at process._tickCallback (internal/process/next_tick.js:63:19)`

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying to Heroku: MongoParseError: Invalid scheme ...
I am having issues deploying to Heroku. I have uploaded the relevant env variables under "Config Vars" within Heroku Dashboard but am ...
Read more >
Heroku deployment with mongodb atlas failed - Node
My error reads: 'MongoNetworkError: failed to connect to server ... 2021-02-14T15:55:22.489428+00:00 app[web.1]: 'MongoParseError: Unescaped ...
Read more >
mongoparseerror: invalid scheme, expected connection ...
When I hosted my web-app on cyclic.sh "npm run start" script is returning an error in deployment logs. App is working fine when...
Read more >
Unable to connect with node.js due to "mongodb+srv"
I'm having the EXACT same error as Getting error upon await client.connect() in node.JS and Error with await client.connect() node.JS.
Read more >
MongoError: failed to connect to server [localhost:27017] · ...
MongoDB connection error: MongoError: failed to connect to server ... After deploy to my external server (running in Cpanel) is when I get:....
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