connection-refused-from-Spring-Data-when-using-Atlas-search

Getting following error when run query on index pipeline, although it works from Compass

Connection refused' on server cluster0-shard-00-01.sbboc.mongodb.net:27017. The full response is { "ok" : 0.0, "errmsg" : "PlanExecutor error during aggregation :: caused by :: Remote error from mongot :: caused by :: Error connecting to localhost:28000 (127.0.0.1:28000) :: caused by :: Connection refused", "code" : 6, "codeName" : "HostUnreachable", "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1686741884, "i" : 9 } }, "signature" : { "hash" : { "$binary" : "1nec9xxjW91akgRA3Q0fSBeIxoE=", "$type" : "00" }, "keyId" : { "$numberLong" : "7212675207377453057" } } }, "operationTime" : { "$timestamp" : { "t" : 1686741884, "i" : 9 } } }
        at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:179)

Hello @Shopi_Ads ,

I note you have written that it works on Compass. Can you confirm you’re running the exact same $search query for both?

As per this documentation on Troubleshooting Search.

The following error is returned if you run $search queries when the Atlas Search mongot process isn’t installed or running:

MongoError: Remote error from mongot :: caused by :: Error connecting to localhost:28000.

The mongot process is installed only when the first Atlas Search index is defined. If you don’t have any Atlas Search index in your Atlas cluster, create at least one Atlas Search index to resolve this error.

To learn how to create Atlas Search Index, please refer

Regards,
Tarun

thanks its resolved. developer was connecting to different cluster.

1 Like

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