How Do You Troubleshoot Puppet Agent with a “Failed to open TCP connection…connection refused port 8140” error?

Problem scenario
You run puppet agent but you get this error:

Error: Could not request certificate: Failed to open TCP connection to (Connection refused - connect(2) for "" port 8140)

What do you do?

Ensure port 8140 is open. Install nmap on a server, and run this command:

nmap -p 8140

If you see this

8140/tcp closed unknown

Then the Puppet Master service is not running. Start the puppet master service (e.g., sudo puppet master start). If you need help installing Puppet Master, see this link for Ubuntu and this link for RedHat.

If you get a message showing that port 8140 is filtered, change the Security Group (in AWS), the Network Security Group (in Azure) or the firewall between the two servers.

Leave a comment

Your email address will not be published. Required fields are marked *