sameersbn / sameersbn/docker-gitlab

SMTP mail not working

Open
#1,381 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

wontfix
Dominant language
Shell
Stars
8.1k
Forks
2.1k
Avg merge
17h 47m
Merged PRs (30d)
7

Description

I use docker-compose up to install the gitlab.
I have configure gmail in yml file.

but when I test email, it shows error below, does anybody have any ideas?
which Name or service not known? gmail.com?

irb(main):001:0> Notify.test_email('haiba*@gmail.com', 'Message Subject', 'Message Body').deliver_now

Notify#test_email: processed outbound mail in 288.6ms

Sent mail to haiba*@gmail.com (20.9ms)
Date: Wed, 11 Oct 2017 18:57:30 +0530
From: GitLab <176208*@gmail.com>
Reply-To: GitLab <noreply@example.com>
To: haiba*@gmail.com
Message-ID: <59de1c42c8a98_2d2e3b0ac47776@1e7eea1d2334.mail>
Subject: Message Subject
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>Message Body</p></body></html>

SocketError: getaddrinfo: Name or service not known
	from /usr/lib/ruby/2.3.0/net/smtp.rb:542:in `initialize'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:542:in `open'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:542:in `tcp_socket'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:552:in `block in do_start'
	from /usr/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
	from /usr/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:551:in `do_start'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:521:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/network/delivery_methods/smtp.rb:111:in `deliver!'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:2149:in `do_delivery'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `block in deliver'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:543:in `block in deliver_mail'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:541:in `deliver_mail'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `deliver'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
	from (irb):1
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in `console'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'
	from bin/rails:9:in `require'
	from bin/rails:9:in `<main>'


//##########update
I add  ip smtp.gmail.com  in /etc/hosts, and now it report this error.

Net::OpenTimeout: execution expired
	from /usr/lib/ruby/2.3.0/net/smtp.rb:542:in `initialize'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:542:in `open'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:542:in `tcp_socket'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:552:in `block in do_start'
	from /usr/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:551:in `do_start'
	from /usr/lib/ruby/2.3.0/net/smtp.rb:521:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/network/delivery_methods/smtp.rb:111:in `deliver!'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:2149:in `do_delivery'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `block in deliver'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:543:in `block in deliver_mail'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:541:in `deliver_mail'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/mail-2.6.6/lib/mail/message.rb:237:in `deliver'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
	from (irb):3
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in `console'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'
	from bin/rails:9:in `require'
	from bin/rails:9:in `<main>'

@@@update again @@@
it seems to be a bug of docker, but it not work after I disabled firewalld
see here
https://github.com/docker/compose/issues/5106

docker info
Containers: 4
 Running: 3
 Paused: 0
 Stopped: 1
Images: 5
Server Version: 1.10.3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 51
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: journald
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 3.10.104-1-tlinux2_kvm_guest-0022.tl2
Operating System: Tencent tlinux 2.2 (Final)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 2
Total Memory: 7.674 GiB
Name: VM_245_125_centos
Registries: docker.io (secure)
uname -r
3.10.104-1-tlinux2_kvm_guest-0022.tl2
 cat /etc/centos-release
CentOS Linux release 7.2 (Final)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the docker-compose up environment and the Notify.test_email(...).deliver_now entry point, then compare the container's DNS and SMTP connectivity with the reported docker info and host details. Done would require a reproducible, project-owned fix for the container's inability to resolve or connect to smtp.gmail.com; the issue currently points instead to a Docker Compose issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby
Domain
infrastructure, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.