Project

General

Profile

Bug #1613

Email address format validation preventing admin user creation

Added by Andy Shinn almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DB migrations
Target version:
Difficulty:
easy
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

On both RPM versions 0.4.2-0.1 and 0.5.1-1 the admin user is being created with the Auth type not set. On 0.4.2, without the :login setting, I can browse to the dashboard which logs me in as admin. If I then enable :login and refresh the dashboard I am automatically logged in and can see that the admin user has no Auth type set.

When I try to reset the admin user I receive the following Mail is invalid error

[root@foreman1 foreman]# rake -t -v permissions:reset RAILS_ENV=production 
Libvirt binding are missing - hypervisor management is disabled
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
/usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8
** Invoke permissions:reset (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute permissions:reset
Mail is invalid

I am able to bypass the error by commenting out the validation in the user model:

# validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_nil => true

This happens both with a domain of localdomain or localdomain.mydomain.com. The latter appears to pass with email address . I am not sure what may be failing.

This is on CentOS 6 x86_64 using foreman-installer.

Associated revisions

Revision 111a4083 (diff)
Added by Ohad Levy almost 11 years ago

fixes #1613 - Email address format validation preventing admin user creation

History

#1 Updated by Ohad Levy almost 11 years ago

  • Difficulty set to easy

#2 Updated by Ohad Levy almost 11 years ago

  • Target version deleted (1.0)

Hi Andy,

I've tried to reproduce, but none of my test email addresses were failing, can you mention which email address did it try to create it under?

thanks

#3 Updated by Andy Shinn almost 11 years ago

I was trying with a local domain I had setup. The local domain is called, literally, 'localdomain'. So my root email is . I'm in the process of setting up a new environment to test Foreman in so if this is reproducible it can be closed and I can reopen if it happens on the latest version.

#4 Updated by Ohad Levy almost 11 years ago

  • Assignee set to Ohad Levy
  • Priority changed from Low to Normal
  • Target version set to 1.0

#5 Updated by Ohad Levy almost 11 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF