Gitlab Signup not working

Hi,

We are facing an issue with user sign up through GUI and I tried with command but not getting an activation link. Please help to resolve the issue.

https://git.domain.com/users/sign_up

root@ip-10-0-12-247:~# sudo gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
 GitLab:       13.7.4 (2f14978e280) FOSS
 GitLab Shell: 13.14.0
 PostgreSQL:   11.9
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.3)
irb(main):001:0> user = User.find_by(email: 'ar@domain2.com')
=> nil
irb(main):002:0> user = User.find_by(email: 'sc@domain.com')
=> nil
irb(main):003:0> user = User.find_by(email: 'ak@domain.com')
=> #<User id:28 @ak>
irb(main):004:0>
root@ip-10-0-12-247:~#
root@ip-10-0-12-247:~# git config --global user.name "sc"
root@ip-10-0-12-247:~# git config --global user.email "sc@domain.com"
root@ip-10-0-12-247:~# git config --global --list
user.name=sc
user.email=sc@domain.com
http.sslverify=false
root@ip-10-0-12-247:~# sudo gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
 GitLab:       13.7.4 (2f14978e280) FOSS
 GitLab Shell: 13.14.0
 PostgreSQL:   11.9
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.3)
irb(main):001:0> user = User.find_by(email: 'sc@domain.com')
=> nil
irb(main):002:0> user = User.find_by(email: 'sc@domain.com')
=> nil
irb(main):003:0> user = User.find_by(email: 'sc@domain.com')
=> nil
irb(main):004:0>
root@ip-10-0-12-247:~#

Hi,

Please help.

Hi,

I’m guessing you didn’t configure the gitlab.rb mail settings:

https://docs.gitlab.com/omnibus/settings/smtp.html

you will need to configure that properly before registration emails will appear.

Hi Sir,

The email setting is working. when I try to forget the password for an existing user then the password reset coming on the user’s email id but whenever I tried to signup that time password not coming.

Below is the setting.

### Email Settings
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'gitlab@domain.com'
gitlab_rails['gitlab_email_display_name'] = 'Gitlab'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.office365.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "gitlab@domain.com"
gitlab_rails['smtp_password'] = "XXXXXX"
gitlab_rails['smtp_domain'] = "domain.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
gitlab_rails['gitlab_email_from'] = 'gitlab@domain.com'

Can you try and find info from logs:

cat /var/log/gitlab/gitlab-rails/*.log | grep -i notify

filter the results to see if you can find anything related to registering. The git config --global commands are only going to set in your ~/.gitconfig file - if the user registered via the web interface, then the log files should show some attempt at notification.

Hi,

for transparency - I have edited your post and redacted the email addresses and domains. Please double check this before posting. I’ve also wrapped the output into 3 backticks each for better formatting.

Cheers,
Michael

root@ip-10-0-12-247:~# cat /var/log/gitlab/gitlab-rails/.log | grep -i notify
[ActiveJob] Enqueued ActionMailer::MailDeliveryJob (Job ID: 01e128c4-2793-4947-a516-063f6c862499) to Sidekiq(mailers) with arguments: “Notify”, “new_merge_request_email”, “deliver_now”, {:args=>[129, 3846, “assigned”]}
[ActiveJob] [ActionMailer::MailDeliveryJob] [01e128c4-2793-4947-a516-063f6c862499] Performing ActionMailer::MailDeliveryJob (Job ID: 01e128c4-2793-4947-a516-063f6c862499) from Sidekiq(mailers) enqueued at 2021-03-18T04:40:38Z with arguments: “Notify”, “new_merge_request_email”, “deliver_now”, {:args=>[129, 3846, “assigned”]}
root@ip-10-0-12-247:~# cat /var/log/gitlab/gitlab-rails/
.log | grep -i notify
[ActiveJob] Enqueued ActionMailer::MailDeliveryJob (Job ID: 01e128c4-2793-4947-a516-063f6c862499) to Sidekiq(mailers) with arguments: “Notify”, “new_merge_request_email”, “deliver_now”, {:args=>[129, 3846, “assigned”]}
[ActiveJob] [ActionMailer::MailDeliveryJob] [01e128c4-2793-4947-a516-063f6c862499] Performing ActionMailer::MailDeliveryJob (Job ID: 01e128c4-2793-4947-a516-063f6c862499) from Sidekiq(mailers) enqueued at 2021-03-18T04:40:38Z with arguments: “Notify”, “new_merge_request_email”, “deliver_now”, {:args=>[129, 3846, “assigned”]}
root@ip-10-0-12-247:~#

@dnsmichi just told you to wrap output in 3 backticks for better formatting. Why didn’t you?

Hi Sir,

Still, I am waiting for your suggestion. Please help.

Thanks,
Anish Raut

Hi,

please check the troubleshooting section in the docs, specifically to trigger an email manually from the rails console: SMTP settings | GitLab

Could also be related to TLS/SSL, mentioned in SMTP settings | GitLab

You can also test email sending manually on the CLI, with local MTA clients like Postfix or sendmail. Alternatively, curl has a method to send email with smtp: Sending email - Everything curl

Cheers,
Michael

Hi,

Through the console, email is getting delivered. I tested through gitlab-rails console command.
ubuntu@ip-10-0-12-247:~$ sudo -s
root@ip-10-0-12-247:~# gitlab-rails console

Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
GitLab: 13.7.4 (2f14978e280) FOSS
GitLab Shell: 13.14.0
PostgreSQL: 11.9

Loading production environment (Rails 6.0.3.3)
irb(main):001:0>
irb(main):002:0>
irb(main):003:0>
irb(main):004:0> Notify.test_email(‘anish.raut@domain.com’, ‘Test Email - Gitlab’, ‘Test email through console’).deliver_now
Notify#test_email: processed outbound mail in 1.1ms
Delivered mail 605c8fd88dd3a_4dd853d465079@ip-10-0-12-247.mail (1392.5ms)
Date: Thu, 25 Mar 2021 13:27:52 +0000
From: Gitlab gitlab@domain.com
Reply-To: Gitlab noreply@domain.com
To: anish.raut@domain.com


Message-ID: 605c8fd88dd3a_4dd853d465079@ip-10-0-12-247.mail
Subject: Test Email - Gitlab
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All

Test email through console

=> #<Mail::Message:199960, Multipart: false, Headers: <Date: Thu, 25 Mar 2021 13:27:52 +0000>, <From: Gitlab gitlab@domain.com>, <Reply-To: Gitlab noreply@domain.com>, <To: anish.raut@domain.com>, <Message-ID: 605c8fd88dd3a_4dd853d465079@ip-10-0-12-247.mail>, <Subject: Test Email - Gitlab>, <Mime-Version: 1.0>, <Content-Type: text/html; charset=UTF-8>, <Content-Transfer-Encoding: 7bit>, <Auto-Submitted: auto-generated>, <X-Auto-Response-Suppress: All>>
irb(main):005:0>

Thanks,
Anish Raut

Hi,

maybe a bug in 13.7.4. Any chance you do an upgrade to 13.9 or 13.10 to rule out a software problem?

Cheers,
Michael

Hi,

I have updated the Gitlab CE version but still, I am not getting an email when I tried to signup and also user not getting register through the Signup page.

root@ip-10-0-12-247:~# sudo gitlab-rake gitlab:env:info

System information
System: Ubuntu 16.04
Current User: git
Using RVM: no
Ruby Version: 2.7.2p137
Gem Version: 3.1.4
Bundler Version:2.1.4
Rake Version: 13.0.3
Redis Version: 6.0.10
Git Version: 2.29.0
Sidekiq Version:5.2.9
Go Version: unknown

GitLab information
Version: 13.10.0
Revision: 5eafdaf7b07
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 12.5
URL: https://git.domain.com
HTTP Clone URL: https://git.domain.com/some-group/some-project.git
SSH Clone URL: git@git.domain.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: gitlab

GitLab Shell
Version: 13.17.0
Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories
    GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
    Git: /opt/gitlab/embedded/bin/git
    root@ip-10-0-12-247:~#

There are a couple of potential issues in the output you show:

  1. You seem to be running this on Ubuntu 16.04? Support for that will end in about a month, that includes both security updates, and new GitLab versions.

  2. (Unless the you’re actually on domain.com, which seems a bit unlikely) domain.com has an SPF record, so you probably can’t send mail with that set up (if you have hidden the actual domain in that output: don’t, there’s no point to that)

(and why are you using sudo if you’re logged in as root, that only requires you to have configured sudo, but doesn’t give anything)

Hi Sir,

Please suggest the next steps.

Thanks,
Anish Raut