user_01_02
user_01_02

Reputation: 763

Gitlab smtp test failed

I am using gitlab community edition(omnibus installation). I tried to configure SMTP setting , but when tested the configuration I am getting an error. I believe there is no username and password for our smtp address.

 gitlab_rails['smtp_enable'] = true
 gitlab_rails['smtp_address'] = "xx.xxxx.com"
 gitlab_rails['smtp_port'] = 465
 gitlab_rails['smtp_enable_starttls_auto'] = true
 gitlab_rails['smtp_tls'] = false
 gitlab_rails['smtp_openssl_verify_mode'] = 'none'

Please let me know how should I troubleshoot this error. I am not able to understand where the error is.

 GitLab:       11.3.1 (32cb452)
 GitLab Shell: 8.3.3
 postgresql:   9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)
irb(main):001:0> ActionMailer::Base.delivery_method
=> :smtp
irb(main):002:0> Notify.test_email('[email protected]', 'Hello World', 'This is test')


    Notify#test_email: processed outbound mail in 210.3ms

Sent mail to [email protected] (30012.0ms)
Date: Thu, 15 Nov 2018 23:24:13 +0000
From: GitLab <[email protected]>
Reply-To: GitLab <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
Subject: Hello World
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-htm
<html><body><p>This is a test message</p></body></html>

Net::OpenTimeout: execution expired
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:539:in `initialize'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:539:in `open'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:539:in `tcp_socket'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:549:in `block in do_start'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/timeout.rb:103:in `timeout'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:548:in `do_start'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:518:in `start'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/network/deliion'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/network/deli
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionmailer-4.2.10/lib/action_m
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_strument'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_`instrument'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionmailer-4.2.10/lib/action_m
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionmailer-4.2.10/lib/action_m'
        from (irb):2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from bin/rails:14:in `require'
        from bin/rails:14:in `<main>'
irb(main):003:0> exit

Upvotes: 1

Views: 1896

Answers (1)

VonC
VonC

Reputation: 1323045

You had the same case with issue 22728, but it seems to disappear after upgrade.
In your case, you are already at the latest version (almost: check if 11.4 helps)

Issue 23600 pointed out to a cloud provider who had blocked outgoing smtp.

Check also the "Mail not working" section which makes sure of the values of:

  • ActionMailer::Base.delivery_method
  • ActionMailer::Base.smtp_settings

Upvotes: 2

Related Questions