Upcoming Maintenance Alert:

The UBNT Community will be upgraded at 5pm MDT on April 25th. During this time the community forums will be set to read-only status.

Learn more

×
Reply
Highlighted
Member
Posts: 274
Registered: ‎05-29-2014
Kudos: 30
Solutions: 4

Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddrinfo

Any idea why I'm randomly getting this?

 

Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddrinfo failed: Try again #0]

 

I have uNMS setup on the box and also running a local SMTP for my website, but previously this worked.  I had some issues with uNMS but reconnected it and it started working.  Now when I go back to uCRM it won't mail.

 

Any chance the two are conflicting?  Trying to connect to Gmail.

Member
Posts: 274
Registered: ‎05-29-2014
Kudos: 30
Solutions: 4

Re: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddri

So I think its related to the containers IP address.  Everything inbound appears operational, but nothing outbound works.  I noticed the uNMS mailer is also no longer working, even though the box hasn't been rebooted, upgraded or changed since it was working.

 

Here's what the inspect on the container is showing.

 

"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.9",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",

 

I don't use any 172 IPs on my network so it came up with that itself.  I'm not sure what it's supposed to be, but unless docker is creating its own IP addressing, that isn't going to make it very far.  Thoughts?  This was all working then randomly stopped.

Ubiquiti Employee
Posts: 1,320
Registered: ‎12-10-2015
Kudos: 525
Solutions: 120

Re: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddri

we are investigating this issue.

Meanwhile, please verify:
1. you configured your mailer settings properly in UCRM
2. try to ping the smtp.gmail.com from the server or your VM and ideally, from the docker container:
sudo docker exec -it ucrm_web_app_1 sh
ping smtp.gmail.com
3. it's recommended to configure your gmail properly: use secure password and ideally even 2-factor auth.
Member
Posts: 274
Registered: ‎05-29-2014
Kudos: 30
Solutions: 4

Re: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddri

Thanks for checking in.

 

1.) Yes, configured mailer through uCRM, previously it was operational then was not.

2.) It's a physical box, not a VM, inside the docker contain I am unable to ping domain addresses.  I can successfully ping the IP addresses including the IP behind the smtp.gmail.com.  cat of the resolv.conf in the below code paste, not sure what 127.0.0.11 uses as a passthrough but the outer shell does have operable dns servers.  

 

Here's the ifconfig from inside the container.

/usr/src/ucrm # ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:AC:12:00:09
          inet addr:172.18.0.9  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:59162 errors:0 dropped:0 overruns:0 frame:0
          TX packets:75484 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:35983850 (34.3 MiB)  TX bytes:11139736 (10.6 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:20192 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1264139 (1.2 MiB)  TX bytes:1264139 (1.2 MiB)


/usr/src/ucrm # cat /etc/resolv.conf
nameserver 127.0.0.11
options ndots:0

3.) makes sense, will activate once its working again.

 

Update - I hardwrote 8.8.8.8 into the resolv.conf inside the docker container and I am successful in emails.  I think once I reboot docker it'll go back to normal, but it does have to do with the nameserver resolution inside the container.  Any help would be appreciated on how to troubleshoot that, not very familiar with docker.

Member
Posts: 274
Registered: ‎05-29-2014
Kudos: 30
Solutions: 4

Re: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddri

So a quick update.  When I go to "Settings" it does test successfully and says it sends the email successfully.  When I switch to send an email to a client to setup an account, it gets hung up with the original error message.  My guess is there are multiple docker containers and I only fixed the nameservers on one via hardcode.

 

Any idea how to make this pull my actual resolv.conf from the base system?

Member
Posts: 274
Registered: ‎05-29-2014
Kudos: 30
Solutions: 4

Re: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddri

Ok, so while not the final solution, I did figure out after the diagnostic steps sent that Docker can only handle a single DNS server.  My primary on the resolv.conf is pending the fiber setup so it's not responding, the main box is using the backup but docker is unable to use the backup.

 

I swapped the DNS entries in my network config to make my live one come first then rebooted, I'm able to send emails.  Going forward, I'm going to point to my edgerouter where I can load up a number of DNS servers, so it will dish out whichever is active.

 

Thanks for the help.

Ubiquiti Employee
Posts: 1,320
Registered: ‎12-10-2015
Kudos: 525
Solutions: 120

Re: Connection could not be established with host smtp.gmail.com [php_network_getaddresses: getaddri

@dballan thanks. It's really a bug in Docker. We will improve the UCRM troubleshooting guide.
Reply