Defect #20120
closedUsername can not be validated when creating an account
Added by C. R. almost 10 years ago. Updated almost 10 years ago.
0%
Description
When trying to register a new account, the username can not be validated, the system insists that the field is empty.
Occurs when running redmine on webrick from the console and when running redmine with nginx using passenger.
Environment: Redmine version 3.0.3.stable Ruby version 2.1.5-p273 (2014-11-13) [x86_64-linux-gnu] Rails version 4.2.1 Environment production Database adapter Mysql2 SCM: Filesystem Redmine plugins: redmine_contacts 4.0.0
Updated by Felix Schäfer almost 10 years ago
A friend of mine ran into this too, the request is the following:
Started POST "/account/register" for 84.56.127.146 at 2015-06-17 21:46:09 +0200 Processing by AccountController#register as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"GWbmnQxYWVqKcN/utGrPbzLJa6yAhrDGD6dr5Euk50DFaXlG0MNlnRhtTkiEIQyk45ekPeEOObGI68LwSDRTOA==", "user"=>{"login"=>"foobar", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "firstname"=>"foobar", "lastname"=>"foobar", "mail"=>"[FILTERED]", "language"=>"de"}, "commit"=>"OK"} Current user: anonymous WARNING: Can't mass-assign protected attributes for User: login lib/redmine/safe_attributes.rb:84:in `safe_attributes=' app/controllers/account_controller.rb:124:in `register' Rendered account/register.html.erb within layouts/base (5.2ms) Completed 200 OK in 35ms (Views: 22.1ms | ActiveRecord: 1.7ms)
Updated by Mischa The Evil almost 10 years ago
C. R. wrote:
When trying to register a new account, the username can not be validated, [...]
Felix Schäfer wrote:
I can confirm these and several other issues (seemingly only with new (DB) deployments of Redmine after Rails 4 upgrade). I'm still working on testing this all thoroughly though, so I haven't opened an issue for it yet (because a defect should at least mention the exact things that go wrong, and I can't do that now with the info I have currently). But, some of my preliminary findings (which btw transcends this issue's topic heavily) are:> [...] > WARNING: Can't mass-assign protected attributes for [...] >
- buildin groups (#17976) are not being not created (migration runs without errors or warnings) <<--- This is how I initially noticed there were troubles
- many '
can't mass-assign protected attribute
'-errors during initial db migration ánd first visit using WEBrick (initial creation of theAnonymous
user) - two ruby warnings during the loading of the initial default dataset
- ../activerecord-4.2.1/lib/active_record/associations.rb:1694:
warning: already initialized constant CustomField::HABTM_Roles
- ../activerecord-4.2.1/lib/active_record/associations.rb:1694:
warning: previous definition of HABTM_Roles was here
- ../activerecord-4.2.1/lib/active_record/associations.rb:1694:
- several tests seem to fail and throw errors (this is where I am now, initial tests showed the previous problems but without failures/errors during a test-suite run)
- Trunk test run output...Trunk test run output...
# Running: .....FF..EEEE....E................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ Finished in 489.802094s, 7.3867 runs/s, 44.8467 assertions/s. 1) Failure: TokenTest#test_find_token_should_return_the_token [/var/www/redmine/test/unit/token_test.rb:86]: --- expected +++ actual @@ -1 +1 @@ -#<Token id: 3, user_id: 1, action: "api", value: "35f5c5847c37bd9cc28c65b99c8f96cf4ffec2ac", created_on: "2015-06-08 04:26:36"> +nil 2) Failure: TokenTest#test_find_token_should_return_the_token_with_validity [/var/www/redmine/test/unit/token_test.rb:91]: --- expected +++ actual @@ -1 +1 @@ -#<Token id: 4, user_id: 1, action: "api", value: "ca05d7116dc1d3870aa0428fc6b32acafbb1ead0", created_on: "2015-06-08 03:26:36"> +nil 3) Error: TokenTest#test_find_active_user_should_return_user: ActiveRecord::RecordNotFound: Couldn't find User with 'id'=1 [WHERE `users`.`type` IN ('User', 'AnonymousUser')] test/unit/token_test.rb:64:in `test_find_active_user_should_return_user' 4) Error: TokenTest#test_create_should_remove_existing_tokens: ActiveRecord::RecordNotFound: Couldn't find User with 'id'=1 [WHERE `users`.`type` IN ('User', 'AnonymousUser')] test/unit/token_test.rb:31:in `test_create_should_remove_existing_tokens' 5) Error: TokenTest#test_find_user_should_return_locked_user: ActiveRecord::RecordNotFound: Couldn't find User with 'id'=1 [WHERE `users`.`type` IN ('User', 'AnonymousUser')] test/unit/token_test.rb:80:in `test_find_user_should_return_locked_user' 6) Error: TokenTest#test_find_user_should_return_user: ActiveRecord::RecordNotFound: Couldn't find User with 'id'=1 [WHERE `users`.`type` IN ('User', 'AnonymousUser')] test/unit/token_test.rb:75:in `test_find_user_should_return_user' 7) Error: TokenTest#test_find_active_user_should_return_nil_for_locked_user: ActiveRecord::RecordNotFound: Couldn't find User with 'id'=1 [WHERE `users`.`type` IN ('User', 'AnonymousUser')] test/unit/token_test.rb:69:in `test_find_active_user_should_return_nil_for_locked_user' 3618 runs, 21966 assertions, 2 failures, 5 errors, 0 skips
- Trunk test run output...Trunk test run output...
With the above in mind I'll start some more research into this, primarily focusing on comparison of initial DB deployments between source:/branches/2.6-stable and source:/trunk, with clean installs of the whole stack and including the Rails 4.2.2/3.2.22 updates from yesterday. I'll provide more info (logs, cli-output, db-dumps, etc.) when I have completed these tests.
Mischa.
Updated by Felix Schäfer almost 10 years ago
This specific issue seems to be related to the redmine_contacts
plugin, as without everything seems to work as expected.
Updated by Felix Schäfer almost 10 years ago
It seems the developers of the plugin are aware of a problem, for example their CRM Plugin has been updated and fixes a bug on user creation
I think this can be closed and should be escalated to the plugin authors should it not get fixed in the coming days.
Updated by C. R. almost 10 years ago
- Status changed from New to Resolved
Felix has been right, the issue has been fixed in Redmine CRM 4.0.1
Updated by Jean-Philippe Lang almost 10 years ago
- Status changed from Resolved to Closed
- Resolution set to Invalid