Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout

Siddhant Pandey September 11, 2023

i was making pipeline for my python fastapi project and i am encountering this error again and agian and the error was this.

pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 64fef9e4a7f01e7caf401b46, topology_type: Unknown, servers: [<ServerDescription ('localhost', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('localhost:27017: [Errno 111] Connection refused')>]>

i have provided you my pipeline code can some one please help me out in this situation.1.png2.png3.png4.png



1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2023

Hi @Siddhant Pandey!

I see the error 'Connection refused' for localhost:27017.

  • Are you starting a service at localhost:27017 and is it available when you try to connect to it?
  • Can you try using instead of localhost?

In case you are using MongoDB, you can make use of the services feature in pipelines.

You can read more about database and services containers in Pipelines here:

More details about MongoDB specifically can be found here:

Kind regards,

Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events