Google cloud mongoURI error

Ive hosted my nodejs server to google cloud but the server isnt running and getting this err: MongoAPIError: URI cannot contain options with no value at parseOptions

my password doesnt have special characters and its running properly in dev environment. what could be the problem please.

Lots of things could be wrong.

Paste the URI you are using (but of course obscure your actual server name, user id, and password) and we can try to debug together.

heres the URI am using and ive tested locally its correctly fetching and saving data, the network access is set to all IP addresses so i dont think its IP restriction

MONGODB_URI= ‘mongodb+srv://abcd:abcd@cluster0.xkjdutx.mongodb.net/?retryWrites=true&w=majority’

URI looks pretty normal AFAIK.
The error suggests that maybe something in the URI is escaping your quoting and getting expanded incorrectly in Node. My suggestion is to stare at your code until your brain hurts. :smiley:

It didnt work out so i switched to a different service - google compute engine and it worked okay

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.