Edgar Contreras
Edgar Contreras

Reputation: 11

CosmoDB: No connection could be made because the target machine actively refused it. [::1]:10255

I'm unable to connect to my local CosmoDb instance. I'm currently configuring a new PC, the CosmoDB version and my solution are all currently with the same configuration as my old PC, but issue only exists on new PC.

Here's is my connection string (provided by the same CosmoDb):

"mongodb://localhost:C2y6yDjf5%2FR%2Bob0N8A7Cgv30VRDJIWEHLM%2B4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw%2FJw%3D%3D@localhost:10255/admin?ssl=true"

Reminder that this same connection string works in my other PC. Now Ive tried checking my ports and from my ignorance it seems that after running the netstat -ab CosmoDb doesn't list the port 10255 as open:

enter image description here

I tried adding the firewall exception like this (People recommended only adding it as Inbound rule but since it didn't worked I tried adding the same rule as outbound):

enter image description here

Have I added the port incorrectly to my firewall? Can I force CosmosDb to use another port?

Upvotes: 1

Views: 1951

Answers (1)

KarthikBhyresh-MT
KarthikBhyresh-MT

Reputation: 5044

Looking again at the snips you provided, it seems the error is occurring because there is no server listening at the hostname and port you assigned.

Start the emulator from command prompt as an administrator with "/EnableMongoDbEndpoint". Then verify format and use the connection string to connect.

Also, since you are able to connect using same configuration on another machine, this maybe an issue with the local settings on your new PC. Make sure your connection is not in proxy mode.

Open to "Internet Options" from "Control Panel" then select "Connection" tab, click on "LAN Settings" and uncheck everything or select "Automatically detect settings". Do the same for 2 if you have any VPN setup .

enter image description here enter image description here

Upvotes: 1

Related Questions