Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Killing MailCatcher: Something's using port 1025

I'm trying to run "foreman start" for a rails app however this error message is preventing me from running the foreman properly:

~~> ERROR: Something's using port 1025. Are you already running MailCatcher?

I've tried killing the PID, going to the web interface to quit the program and also...restarting the comp. Does anybody know how to remedy this?

Thanks

like image 862
CJ -S Avatar asked Jul 18 '14 17:07

CJ -S


3 Answers

In OSX, run the following in a shell:

sudo lsof -nP -iTCP:1025 -sTCP:LISTEN

The expected output of this command is a process, which is listening on port 1025:

ruby    43841 youruserid    9u  IPv4 0x6a1610da80bb9b4f      0t0  TCP 127.0.0.1:1025 (LISTEN)

In the output above, the 2nd value is the process ID. Then, to kill the offending process (substitute in the correct PID):

sudo kill 43841
like image 146
Joseph Combs Avatar answered Nov 15 '22 07:11

Joseph Combs


MailCatcher launches both SMTP and HTTP servers.

When you start MailCatcher in a terminal you'll see the following output:

$ mailcatcher
Starting MailCatcher
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.

See the last line in the output when starting MailCatcher?

If you attempt to start MailCatcher if it's already running you'll see:

$ mailcatcher
Starting MailCatcher
~~> ERROR: Something's using port 1025. Are you already running MailCatcher?

How to quit Mailcatcher:

  1. Open the http url (http://127.0.0.1:1080) in your browser.

    Note: the port may be different than 1080. If so, you'll have to use that port. If you don't know it, you'll have to use one of the other answers here to kill the running process.

  2. In the top right corner of the page that opens, you'll see a "Quit" link.

How to Quit MailCatcher

like image 36
Beau Smith Avatar answered Nov 15 '22 07:11

Beau Smith


If you are using linux, you should be able to see what program is using a certain port using the netstat command. To see if port 1025 is in use, run this from the command line:

$ netstat -tulpn | grep :1025

Here is a useful reference: http://www.cyberciti.biz/faq/what-process-has-open-linux-port/

like image 10
saskcan Avatar answered Nov 15 '22 07:11

saskcan