开发者

Ejabberd / Rails "getaddrinfo: nodename nor servname provided, or not known"

I get the error

SocketError in UsersController#create
getaddrinfo: nodename nor servname provided, or not known

When i try to crate an account in my rails app. I think that the issue relates either to ejabberd or action mailer. How can I find out more about where this error comes from?

Here is def create in my users_controller

 def create    
    @user = User.new(params[:user])
    if @user.save!
      clear_current_session
      MailAgent.registration_confirmation(@user).deliver
      flash[:notice] = 'Please activate your account by clicking on the link sent to you by email.'
      redirect_to new_user_url
    else
      flash.now[:error] = 'Please fix the listed errors'
      render 'new'
    end
  end

Here is the full error

Started GET "/" for 127.0.0.1 at 2011-08-02 10:1开发者_StackOverflow中文版8:33 +1000
  Processing by PagesController#home as HTML
Redirected to http://localhost:3000/users/new
Completed 302 Found in 0ms


Started GET "/users/new" for 127.0.0.1 at 2011-08-02 10:18:33 +1000
  Processing by UsersController#new as HTML
Rendered users/_signup_form.html.erb (6.5ms)
Rendered layouts/_login_links.html.erb (23.3ms)
Rendered layouts/_error_messages.html.erb (0.3ms)
Rendered users/new.html.erb within layouts/application (33.7ms)
Completed 200 OK in 36ms (Views: 35.6ms | ActiveRecord: 0.2ms)


Started POST "/users" for 127.0.0.1 at 2011-08-02 10:18:49 +1000
  Processing by UsersController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"0JgPvOiu18OjD6TmpUrxDGtPiTUBlw0W78HqtdV/brc=", "user"=>{"name"=>"test", "email"=>"[FILTERED]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign Up"}
  [1m[36mSQL (0.1ms)[0m  [1mBEGIN[0m
  [1m[35mUser Load (0.1ms)[0m  SELECT `users`.`id` FROM `users` WHERE (LOWER(`users`.`email`) = LOWER("[FILTERED]")) LIMIT 1
  [1m[36mUser Load (0.1ms)[0m  [1mSELECT `users`.`id` FROM `users` WHERE (`users`.`persistence_token` = BINARY '61b972eee6ed6eb2341b08d92640b08e6379b8743a4df5aa73a233151a6d5629896470e00e108d0f08d20814fb67d8') LIMIT 1[0m
  [1m[35mSQL (1.7ms)[0m  describe `users`
  [1m[36mAREL (0.2ms)[0m  [1mINSERT INTO `users` (`name`, `email`, `crypted_password`, `password_salt`, `persistence_token`, `perishable_token`, `login_count`, `last_login_at`, `created_at`, `updated_at`, `activated`) VALUES ('test', "[FILTERED]", '37712237698ea6db7f044f9408adee9d1fe02447bdb1b92c34b71d2ca35795dd04af1528aa73b6e7db5b11f', 'JnajFzu5luNXbeU', '61b972ec6e0ee6ed6eb08e6379b8743a448ced73ddf5aa73a233151a6d56298e53a996470e00e108d0f08d20814f9c461185f0b67d8', 'bIPlmXIFPjJDHzt', 1, NULL, '2011-08-02 00:18:49', '2011-08-02 00:18:49', 0)[0m
  [1m[35mJabberCredential Load (0.1ms)[0m  SELECT `jabber_credentials`.* FROM `jabber_credentials` WHERE (`jabber_credentials`.user_id = 12) LIMIT 1
  [1m[36mJabberCredential Load (0.1ms)[0m  [1mSELECT `jabber_credentials`.`id` FROM `jabber_credentials` WHERE (`jabber_credentials`.`jabber_id` = BINARY '12_test_72') LIMIT 1[0m
  [1m[35mSQL (1.3ms)[0m  describe `jabber_credentials`
  [1m[36mAREL (0.1ms)[0m  [1mINSERT INTO `jabber_credentials` (`jabber_id`, `jabber_password`, `user_id`, `created_at`, `updated_at`) VALUES ('12_test_72', '123456', 12, '2011-08-02 00:18:49', '2011-08-02 00:18:49')[0m
  [1m[35mSQL (0.5ms)[0m  ROLLBACK
Completed   in 32093ms

SocketError (getaddrinfo: nodename nor servname provided, or not known):
  lib/xmpp_client.rb:14:in `initialize'
  app/models/user.rb:27:in `new'
  app/models/user.rb:27:in `register_jabber'
  app/models/user_observer.rb:7:in `after_create'
  app/controllers/users_controller.rb:11:in `create'

Rendered /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.6ms)
Rendered /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.4ms)
Rendered /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (4.8ms)


Check your log file, whenever an exception is thrown it outputs the stack trace. Lines closest to the top are more relevant than those lower down. Many of the lines will be "false errors" meaning they are not the problem, but fail because of the problem. It takes some guess-work and a healthy dose of experience to figure out which one is relevant.

Please include the stack trace and maybe we can help you further.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜