ERROR: "Unable to establish connection: java.net.SocketTimeoutException: connect timed out" when trying to test email notification after establishing SMTP connection
search cancel

ERROR: "Unable to establish connection: java.net.SocketTimeoutException: connect timed out" when trying to test email notification after establishing SMTP connection

book

Article ID: 439512

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  •  While trying to test email notification after establishing SMTP connection in VMware Cloud Director(VCD) you will receive the below error: 

    Bad request: ERROR - Unable to establish connection: java.net.SocketTimeoutException: connect timed out

  • You may receive the following error too after establishing the connection from VCD cells to the SMTP server:  

    Error: Bad request: Failed to send email. Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: <SMTP_Server_Name>, port: ###, response: -1. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: <SMTP_Server_Name>, port: ###, response: -1

Environment

VMware Cloud Director 10.6.1

Cause

The issue is caused because connectivity between all the VCD cells is not properly established to the SMTP server.
The SMTP functionality is disabled by default and requires explicit configuration of the SMTP host, authentication credentials, and security protocols within the VCD Portal to initialize the JavaMail service across the all cells. 

Resolution

To resolve this issue bidirectional connectivity must be verified and established between every individual VCD cell and the SMTP server. To verify the bidirectional connectivity has been properly established, you can log into each VCD cell via SSH and run the following command to test the handshake:

curl -v telnet://<SMTP_SERVER_IP_OR_FQDN>:<PORT>

A successful connection will show Connected to.... A timeout confirms the network block still exists.

After establishing the connection between VCD cells and the SMTP server properly  you can use the document to modify Your Email Settings in VMware Cloud Director: SMTP setting in VMware Cloud Director