-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mail catching smtp timeout when running in background #182
Comments
Please note I have tried different ports from 1025 like 2525 to see if this helps but. it does not. when running in daemon mode ( background ) the smtp does not work properly. |
+1, same issue as described. |
I think that it has something to do with the updated dependencies. Right, old and working ones. Left, new and not working ones. http://puu.sh/dGlWf/cb4b0e8dd9.png Temporary workaround: |
Thanks for the info. I will try to run it in the foreground and put it into bg as you suggested |
We encountered this issue today, it cause much hair pulling :) Running in foreground workaround fixed it for us. |
Hi, I am changing my script to do this too. Although I was really worried as the only similar script is https://github.com/ian-kent/Go-MailHog and I really do not want to upgrade as in the project we use vagrant boxes for the devs and each has mailcatcher. It would be nice to find out what breaks this. Unfortunatelly I am not a ruby guy and I can not see any log message anywherer. Thanks |
+1 |
I have the same issue. Ubuntu 14.04 |
+1, i am having the same issue as described. |
+1 |
Problem is Process.daemon here: |
+1, 0.5.12, ruby 2.1.5, OS X 10.10.1 running in foreground workaround works. |
+1, 0.5.12, ruby 2.1.5, OS X 10.10.1 The foreground workaround works for me too. |
+1, ruby 2.1.2p95, , OS X 10.10.1 The foreground workaround works for me. |
+1 - super frustrating. Glad it at least works in the foreground. |
👍 |
2 similar comments
+1 |
👍 |
Exactly the same problem, and workaround. In addition, if you run mailcatcher as daemon and try to quit from the interface, this will redirect you to mailcatcher homepage but won't kill the concerned process. |
Just got the same issue, and seems like it somehow depends on Ruby version. The mailcatcher as a daemon doesn't work on Ruby I haven't changed anything on the project except Ruby version. The daemon stopped working after upgrade to Ruby 2.1.5. |
+1, I encountered this when upgrading from Rails 4.1.x to Rails 4.2. I traced it down to: net/smtp The version of ruby remained the same: ruby 2.1.5p273 Right before it sends the email
Net Smtp id file (/usr/local/lib/ruby/2.1.0/net/smtp.rb:555) Actual code
When running in the foreground (as above) the message received is:
When running in background mode; the message is not received |
I solved the problem for myself by installing eventmachine 1.0.3
and then restarting mailcatcher. |
@danlo that worked for me too! 👍 |
@danlo +1, also fixed for me |
Thanks @danlo, that does the trick! |
👍 @danlo |
Thank you for this, hours of reading articles where it just all about port 1080 and no one cares about 1025. This helped save my sanity. @danlo |
👍 @danlo, thanks! |
Nice solution @danlo ! Thanks! |
Seems to be a bug in the latest version of EventMachine, sadly. -.- The reason it doesn't daemonise until after the eventmachine loop is running is so that port failures can be reported to the user. I'll see what's going on upstream in eventmachine. But honestly eventmachine has become a major pain. May see if there's a feasible alternative, maybe even going back to the standard library with a custom select loop. |
@danlo, Thank you soo much! |
@danlo, Thank you!!! |
@sj26 Someone mentioned on another thread; but could we have a new release of the existing code, but just forcing event machine at 1.0.3? |
I issued a pull request as a temporary fix that forces the version of eventmachine to be less than 1.0.4. If that is not used, eventmachine will default install 1.0.4 which will cause the timeout issue |
This does seem to be an eventmachine regression. Please try mailcatcher 0.6.0pre1 ( |
@chrishough eventmachine 1.0.3 is not compatible with ruby 2.2, so you need to use ruby 2.1 or older. |
I have the same issue. Running as |
@matthewbarram please try mailcatcher 0.6.0pre1 ( |
@sj26 Just came to report this exact bug. Brought in the 0.0.0pre1, as you suggested, and I can now run it fine without --foreground - thank you 👍 |
This has been worked around in 0.6.0, please upgrade with The root cause of this has also been lodged as an issue upstream: |
@sj26 Sorry to jump-start this again but I don't think it's fixed and having spent the best part of 4 hours of unpaid work playing with this I'm cross! This was a completely clean install this morning. ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux] Clean install today and updated to 0.6.0 activesupport (4.2.0) It's working with the -f -v options but nada in the background. /usr/lib/ruby/1.9.1/net/protocol.rb:146:in |
Ah, I see:
They must have released a new version which has broken my fix. I'll look into it again. |
👍 |
mailcatcher 0.6.1 is out which works with eventmachine up to 1.0.5, and restricts future upgrades. |
@sj26 downloading now and will report back, many thanks for monitoring this, great response. |
@sj26 It works! Thanks again for your timely update. |
@danlo 👍 |
not sure if this is still open, but I am running into this problem where mailcatcher has stopped working. Nothing that I know of has changed (other than switching between a lot of branches) and I can't find any error messages showing where something might be breaking. right now in development I can see the emails being sent in the logs, but they're not popping up in mailcatcher. here's my set up
I have tried @danlo tip and it didn't work (ended with a result similar to @chrishough) and tried running with |
I still have this problem, only able to use it in foreground. Otherwise it simply crashes the smtp interface.
|
Hi Guys,
I have a very strange issue but I do not how I could debug it any further.
1, if I run mailcatcher in the foreground -f -v
a, web interface works perfectly
b, smtp receives emails flawlessly
2, if I run it in the backgroud
a, web interface works
b, smtp interface does not respond.
Dec 22 12:34:24 sendemail[10247]: ERROR => Timeout while reading from localhost:2525 There was no response after 60 seconds.
If I want to telnet into it I CAN!
It is not a port issue as I run the test on the same computer and when it is in foreground mode it works.
I do not see any error logs anywhere. is there a way to enable some debug mode so that I can see why the smtp timeouts ?
Any idea what can be wrong ?
my ruby version is -> ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-linux]
my mailcatcher version is mailcatcher (0.5.12)
My local gems:
*** LOCAL GEMS ***
activesupport (3.2.19)
bigdecimal (1.1.0)
builder (3.2.2)
bundler (1.5.3)
chef (11.16.4)
chef-zero (2.2)
coderay (1.1.0)
daemons (1.1.9)
diff-lcs (1.2.5)
docile (1.1.5)
erubis (2.7.0)
eventmachine (1.0.4)
ffi (1.9.5)
ffi-yajl (1.1.0)
haml (4.0.6)
hashie (2.1.2)
highline (1.6.21)
i18n (0.6.11)
io-console (0.3)
ipaddress (0.8.0)
json (1.8.1, 1.5.5)
libyajl2 (1.0.1)
mail (2.6.3)
mailcatcher (0.5.12)
method_source (0.8.2)
mime-types (1.25.1)
minitest (2.5.1)
mixlib-authentication (1.3.0)
mixlib-cli (1.5.0)
mixlib-config (2.1.0)
mixlib-log (1.6.0)
mixlib-shellout (1.6.0)
multi_json (1.10.1)
mysql (2.9.1)
net-ssh (2.9.1)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.2.0)
ohai (7.4.0)
plist (3.1.0)
pry (0.10.1)
rack (1.5.2)
rack-protection (1.5.3)
rake (10.1.1, 0.9.2.2)
rdoc (3.9.5)
rest-client (1.6.7)
rspec (2.14.1)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
rspec-mocks (2.14.6)
rspec_junit_formatter (0.1.6)
ruby-shadow (2.3.4)
simplecov (0.9.1)
simplecov-html (0.8.0)
sinatra (1.4.5)
skinny (0.2.3)
slop (3.6.0)
sqlite3 (1.3.10)
systemu (2.6.4)
thin (1.5.1)
tilt (1.4.1)
wmi-lite (1.0.0)
The text was updated successfully, but these errors were encountered: