Backport #3191
closedimap exits on login with invalid credentials
Added by kbaum (Karl Baum) over 14 years ago. Updated about 12 years ago.
Description
=begin
When I log into an account with invalid credentials, it throws an invalid login error and just exits the process. This can be reproduced from irb with:
require 'net/imap'
imap = Net::IMAP.new('imap.aol.com', 993, true)
imap.login('jerry', 'springer')
I traced the problem to the exception being raised within the client thread here on line 965 of imap.rb
rescue Exception
@client_thread.raise($!)
end
As soon as the exception is raised with in the @client_thread, the ruby process exits.
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
=begin
Hi,
At Fri, 23 Apr 2010 10:29:57 +0900,
Karl Baum wrote in [ruby-core:29745]:
When I log into an account with invalid credentials, it
throws an invalid login error and just exits the process.
What's wrong?
--
Nobu Nakada
=end
Updated by kbaum (Karl Baum) over 14 years ago
=begin
The problem is that the ruby process just exits after the login attempt:
ruby-1.8.7-tv1_8_7_72 >imap = Net::IMAP.new('imap.aol.com', 993, true)
=> #<Net::IMAP:0x4526a8 @parser (Parser Smarser)=#<Net::IMAP::ResponseParser:0x452658 @token=nil, @pos=18, @str="* OK IMAP4 ready\r\n", @lex_state=:EXPR_BEG>, @debug_output_bol=true, @host="imap.aol.com", @response_arrival=#<MonitorMixin::ConditionVariable:0x452518 @monitor=#<Net::IMAP:0x4526a8 ...>, @waiters=[]>, @usessl=true, @tagno=0, @logout_command_tag=nil, @sock=#OpenSSL::SSL::SSLSocket:0x4525e0, @tagged_responses={}, @responses={}, @mon_waiting_queue=[], @tag_prefix="RUBY", @mon_entering_queue=[], @continuation_request=nil, @mon_count=0, @client_thread=#<Thread:0x1361a4 run>, @response_handlers=[], @receiver_thread=#<Thread:0x4524c8 sleep>, @greeting=#<struct Net::IMAP::UntaggedResponse name="OK", data=#, raw_data="* OK IMAP4 ready\r\n">, @port=993, @mon_owner=nil>
ruby-1.8.7-tv1_8_7_72 > imap.login('jerry', 'springer')
(Net::IMAP::ByeResponseError).8.7-tv1_8_7_72/lib/ruby/1.8/net/imap.rb:954:in receive_responses': * BYE IMAP server terminating connection from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/monitor.rb:242:in
synchronize'
from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/net/imap.rb:938:in receive_responses' from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/net/imap.rb:923:in
initialize'
from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/net/imap.rb:922:in start' from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/net/imap.rb:922:in
initialize'
from (irb):3:in new' from (irb):3:in
irb_binding'
from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
from /Users/karl/.rvm/rubies/ruby-1.8.7-tv1_8_7_72/lib/ruby/1.8/irb/workspace.rb:52
petrushka:weshopnetwork karl$
=end
Updated by matz (Yukihiro Matsumoto) over 14 years ago
=begin
Hi,
In message "Re: [ruby-core:29767] [Bug #3191] imap exits on login with invalid credentials"
on Fri, 23 Apr 2010 22:19:16 +0900, Karl Baum redmine@ruby-lang.org writes:
|The problem is that the ruby process just exits after the login attempt:
It just raised an exception. You can catch and handle it if you don't
want the process to be terminated.
matz.
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Open to Rejected
=begin
=end
Updated by kbaum (Karl Baum) over 14 years ago
=begin
I didn't think that the ruby irb process exits when there is an error? For example, the following irb process does not exit:
irb(main):001:0> raise "Error"
RuntimeError: Error
from (irb):1
irb(main):002:0>
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Category set to lib
- Status changed from Rejected to Assigned
- Assignee set to shugo (Shugo Maeda)
- Target version set to Ruby 1.8.8
=begin
Seems r16512.
=end
Updated by kbaum (Karl Baum) over 14 years ago
=begin
I was able to trap this exception before the shutdown:
y06-s00055.14884 #<SystemExit: #SystemExit:0x10aa6120>
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/net/imap.rb:934:in initialize' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb:417:in
new'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb:417:in connect_to_master' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb:414:in
each'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb:414:in connect_to_master' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb:580:in
checkout'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/connection.rb:341:in send_message' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/collection.rb:312:in
update'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo-0.19.1/lib/../lib/mongo/collection.rb:208:in save' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:38:in
send'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:38
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:22:in call' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:22:in
attempt'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:39:in save' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:38:in
send'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:38
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:22:in call' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:22:in
attempt'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/collections/mimic.rb:39:in save' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/commands/save.rb:17:in
execute'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/commands/create.rb:15:in execute' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongoid-1.2.14/lib/mongoid/commands.rb:138:in
create!'
y06-s00055.14884 /data/weshop/releases/20100430210714/app/models/email/mongo_message.rb:62:in create_from_message!' y06-s00055.14884 /data/weshop/releases/20100430210714/app/models/email/message.rb:405:in
create_mongo_message!'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in send' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
evaluate_method'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in call' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in
run'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in each' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in
send'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in run' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in
run_callbacks'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:344:in callback' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:267:in
create'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2874:in create_or_update_without_callbacks' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:250:in
create_or_update'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2555:in save_without_validation!' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1088:in
save_without_dirty!'
y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:87:in save_without_transactions!' y06-s00055.14884 /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:200:in
save!'
=end
Updated by shugo (Shugo Maeda) over 14 years ago
- Status changed from Assigned to Closed
=begin
Fixed in r27688. Thank you.
=end