Can not create users or add keys after upgrade to 5.0 #3413

Closed
lanwin opened this Issue Mar 27, 2013 · 20 comments

Projects

None yet

9 participants

@lanwin
lanwin commented Mar 27, 2013

I get an 500 after hitting the button.

Here is a what the log file say.

Started GET "/admin" for 127.0.0.1 at 2013-03-27 10:07:26 +0100
Processing by Admin::DashboardController#index as HTML
  Rendered admin/dashboard/index.html.haml within layouts/admin (49.5ms)
  Rendered layouts/_head.html.haml (1.9ms)
  Rendered layouts/_search.html.haml (98.7ms)
  Rendered layouts/_init_auto_complete.html.haml (9.2ms)
  Rendered layouts/_head_panel.html.haml (219.2ms)
  Rendered layouts/_flash.html.haml (0.2ms)
Completed 200 OK in 282ms (Views: 273.7ms | ActiveRecord: 5.1ms)
Started GET "/admin/users" for 127.0.0.1 at 2013-03-27 10:07:28 +0100
Processing by Admin::UsersController#index as HTML
  Rendered admin/users/index.html.haml within layouts/admin (42.5ms)
  Rendered layouts/_head.html.haml (1.5ms)
  Rendered layouts/_search.html.haml (105.4ms)
  Rendered layouts/_init_auto_complete.html.haml (9.4ms)
  Rendered layouts/_head_panel.html.haml (121.3ms)
  Rendered layouts/_flash.html.haml (0.2ms)
Completed 200 OK in 176ms (Views: 164.4ms | ActiveRecord: 5.8ms)
Started GET "/assets/icon-search.png" for 127.0.0.1 at 2013-03-27 10:07:28 +0100
Served asset /icon-search.png - 304 Not Modified (0ms)
Started GET "/admin/users/new" for 127.0.0.1 at 2013-03-27 10:07:30 +0100
Processing by Admin::UsersController#new as HTML
  Rendered admin/users/_form.html.haml (10.6ms)
  Rendered admin/users/new.html.haml within layouts/admin (11.2ms)
  Rendered layouts/_head.html.haml (2.1ms)
  Rendered layouts/_search.html.haml (214.4ms)
  Rendered layouts/_init_auto_complete.html.haml (9.0ms)
  Rendered layouts/_head_panel.html.haml (229.3ms)
  Rendered layouts/_flash.html.haml (0.1ms)
Completed 200 OK in 251ms (Views: 243.3ms | ActiveRecord: 4.6ms)
Started POST "/admin/users" for 127.0.0.1 at 2013-03-27 10:07:43 +0100
Processing by Admin::UsersController#create as HTML
  Parameters: {"utf8"=>"?", "authenticity_token"=>"olDyDixQt/+/Fk2TiyiAPexdKx97eWggfMOCU11Gi9I=", "user"=>{"name"=>"test", "username"=>"test", "email"=>"test@test.de", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "projects_limit"=>"10000", "can_create_group"=>"1", "can_create_team"=>"1", "admin"=>"0", "skype"=>"", "linkedin"=>"", "twitter"=>""}}
  Rendered admin/users/_form.html.haml (8.9ms)
  Rendered admin/users/new.html.haml within layouts/admin (11.1ms)
  Rendered layouts/_head.html.haml (1.5ms)
  Rendered layouts/_search.html.haml (225.8ms)
  Rendered layouts/_init_auto_complete.html.haml (9.2ms)
  Rendered layouts/_head_panel.html.haml (243.1ms)
  Rendered layouts/_flash.html.haml (0.2ms)
Completed 200 OK in 363ms (Views: 251.4ms | ActiveRecord: 11.0ms)
Started POST "/admin/users" for 127.0.0.1 at 2013-03-27 10:07:50 +0100
Processing by Admin::UsersController#create as HTML
  Parameters: {"utf8"=>"?", "authenticity_token"=>"olDyDixQt/+/Fk2TiyiAPexdKx97eWggfMOCU11Gi9I=", "user"=>{"name"=>"test", "username"=>"test", "email"=>"test@test.de", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "projects_limit"=>"10000", "can_create_group"=>"1", "can_create_team"=>"1", "admin"=>"0", "skype"=>"", "linkedin"=>"", "twitter"=>""}}

==> application.log <==
March 27, 2013 10:07: User "test" (test@test.de) was created

==> production.log <==
Completed 500 Internal Server Error in 313ms

TypeError (can't dump anonymous class Class):
  app/observers/user_observer.rb:6:in `after_create'
  app/controllers/admin/users_controller.rb:62:in `block in create'
  app/controllers/admin/users_controller.rb:61:in `create'

Values:
Name: test
Username: test
EMail: test@test.de
Password: testtest

@lanwin
lanwin commented Mar 28, 2013

Hmm it seems to be something with the mailsender. After commenting the line

Notify.delay.new_user_email(user.id, user.password) unless user.extern_uid?

out from user_observer.rb it works now. But I am not experienced in Ruby enough to investigate further.

@negesti
negesti commented Apr 2, 2013

Same problem when adding an ssh key. comment

Notify.delay.new_ssh_key_email(key.id) if key.user

in app/observers/key_observer.rb#22

@saltybeagle

Experiencing the same issue on 5.0 and with 5.1:

https://groups.google.com/d/msg/gitlabhq/a8DatGY5c4c/IPYn_sS3at8J

@bbodenmiller
Contributor

You all tried this with 5.1? If you are brave perhaps try 5.2. Additionally if you can provide exact steps to replicate that would likely help devs.

@negesti
negesti commented May 22, 2013

Still happens with 5.2

Completed 500 Internal Server Error in 167ms

TypeError (can't dump anonymous class Class):
  app/services/notification_service.rb:94:in `new_user'
  app/observers/user_observer.rb:5:in `after_create'
  app/controllers/admin/users_controller.rb:62:in `block in create'
  app/controllers/admin/users_controller.rb:61:in `create'

maybe just a missing import/include/require (don't know how it is called in ruby)?

@bbodenmiller
Contributor

Check script returns all okay other than sidekiq (unrelated bug)? Are you using rvm? As I don't know ruby that's about the extent of the troubleshooting I know until a dev steps in.

@bbodenmiller
Contributor

Does this issue still exist in 5.2 or the latest master? Thanks for the issue report. Please reformat your issue to conform to the issue tracker guidelines found in our contributing guidelines.

@joshspivey

I just did a fresh install of the latest and I am having the same issue... So the answer is yes it still exist I am a php dev so cant really debug...

Completed 500 Internal Server Error in 268ms

TypeError (can't dump anonymous class Class):
app/services/notification_service.rb:94:in new_user' app/observers/user_observer.rb:5:inafter_create'
app/controllers/admin/users_controller.rb:68:in block in create' app/controllers/admin/users_controller.rb:67:increate'

@negesti
negesti commented Jun 28, 2013

Still happens with 5.3 with the same error message (can't dump anonymous class)
In 5.3 you can no longer set a default password. A temporary password is sent to the new user. e.g. the workaround to turn off the e-mail notification is not really working anymore. (maybe if you update the password to a known hash in the db..)

@negesti
negesti commented Jun 28, 2013

ok, i can create users again. The problem is at app/services/notification_service.rb# 94

mailer.new_user_email(user.id, user.password) unless user.extern_uid?

If extern_uid is null, we get the TypeError. With the following code, i can create a user again.

mailer.new_user_email(user.id, user.password) unless user.extern_uid.nil?

I'm no ruby programmer. eg. not sure if this is still the expected behaviour. I have used the to_json function and wrote the user object to log, the external_uid id null:

 {
   "admin":false,"..." email":"test@test.test","extern_uid":null,"id":23,"name":"test", 
   "password_expires_at":"2013-06-28T14:25:50Z", "username":"test"
 }

would be nice if somebody that "speaks ruby" can check this.

@bryanwb
bryanwb commented Jul 19, 2013

afaict this is caused by using a Ruby version older than 1.9.3

@negesti
negesti commented Jul 19, 2013

Really glad, I'm using ubuntu...
Ubuntu has a package called ruby 1.9.3. If installed you get ruby 1.9.2p290. I have now removed all ruby related stuff using apt and then compiled ruby 2.0 like it's described in the Installation Guide.

After that i remove /home/git/gitlab/vendor/bundle/* and reinstalled all required bundles using the information found at [Install Gems](sudo -u git -H bundle install --deployment --without development test postgres unicorn aws).

In addition i have install postix (aka. removed exim4). I haven't used the mail features of gitlab previously but with 5.3 is mandatory, as the initial password for a new user is send to the user per mail and can not be set during user creation.

Since upgrading to ruby 2.0 some other small bugs seem to be gone to.

thx @bryanwb

@joshspivey

I am using 1.9.3p392 so that's not my problem

Sent from my iPad Nano

On Jul 19, 2013, at 5:51 AM, Bryan Berry notifications@github.com wrote:

afaict this is caused by using a Ruby version older than 1.9.3


Reply to this email directly or view it on GitHub.

@bryanwb
bryanwb commented Jul 20, 2013

i upgraded from 1.9.3 to 2.0 and it solved this issue for me w/out any code changes

On Sat, Jul 20, 2013 at 2:52 AM, Josh Spivey notifications@github.comwrote:

I am using 1.9.3p392 so that's not my problem

Sent from my iPad Nano

On Jul 19, 2013, at 5:51 AM, Bryan Berry notifications@github.com
wrote:

afaict this is caused by using a Ruby version older than 1.9.3


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/gitlabhq/gitlabhq/issues/3413#issuecomment-21285345
.

@Luzifer
Luzifer commented Jul 22, 2013

Yep, upgrading to 2.0.0 solved it for me too… Sadly this seems to be built on ruby versions not supported by Ubuntu and also not supported by puppet… Both things I rely on…

@lanwin
lanwin commented Jul 22, 2013

It seems to work with 5.2 without removing the Notifications here.

@joshspivey

I upgraded it now i get a error when i try to start gitlab

tarting puma: /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:339: warning: parenthesize argument(s) for future version
/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/settings.rb:146:in []': odd number of arguments for Hash (ArgumentError) from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/settings.rb:146:inload_config'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/settings.rb:5:in initialize' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:196:innew'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:196:in settings' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:360:inconfigure_gem_home_and_path'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:90:in configure' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:146:indefinition'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:116:in setup' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/setup.rb:7 [FAILED] Starting sidekiq: /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:339: warning: parenthesize argument(s) for future version /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/settings.rb:146:in[]': odd number of arguments for Hash (ArgumentError)
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/settings.rb:146:in load_config' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/settings.rb:5:ininitialize'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:196:in new' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:196:insettings'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:360:in configure_gem_home_and_path' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:90:inconfigure'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:146:in definition' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:116:insetup'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/setup.rb:7
[FAILED]

@joshspivey

So this looks like a dependency issue and version issue is there a Ruby equivalent of "pip freeze > requirements.txt" To let you know all the modules that need to be installed along with there versions. Im not a ruby dev but I read online that bundler might be able to do this. Can anyone who has the latest version working post such information?

@bryanwb
bryanwb commented Jul 26, 2013

rm -rf gitlab/vendor/bundle then redo the bundle install command

On Fri, Jul 26, 2013 at 4:08 AM, Josh Spivey notifications@github.comwrote:

So this looks like a dependency issue and version issue is there a Ruby
equivalent of "pip freeze > requirements.txt" To let you know all the
modules that need to be installed along with there versions. Im not a ruby
dev but I read online that bundler might be able to do this. Can anyone who
has the latest version working post such information?


Reply to this email directly or view it on GitHubhttps://github.com/gitlabhq/gitlabhq/issues/3413#issuecomment-21597473
.

@jvanbaarsen
Contributor

It's been at least 2 weeks (and a new release) since we heard from you. I'm closing this issue but if you still experience this problem, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our contributing guidelines. /cc @Razer6

@Razer6 Razer6 closed this Dec 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment