Skip to content
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

address already in use #302

Closed
ryanlego opened this issue Mar 14, 2020 · 7 comments
Closed

address already in use #302

ryanlego opened this issue Mar 14, 2020 · 7 comments
Labels
impact: small Minor papercuts in Rojo that don't warrant immediate resolutoin. size: small type: bug Something happens that shouldn't happen

Comments

@ryanlego
Copy link

Rojo server listening on port 34872
thread 'main' panicked at 'error binding to 127.0.0.1:34872: error creating server listener: Address already in use (os error 48)', /Users/thisismyname/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.12.35/src/server/mod.rs:116:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[ERROR rojo] Rojo crashed!
[ERROR rojo] This is a bug in Rojo.
[ERROR rojo]
[ERROR rojo] Please consider filing a bug: https://github.com/LPGhatguy/rojo/issues
[ERROR rojo]
[ERROR rojo] Details: error binding to 127.0.0.1:34872: error creating server listener: Address already in use (os error 48)

It says address is already in use, but it thinks that I've had it on for a while even though I restarted everything, is this really a bug?

@LPGhatguy
Copy link
Member

I believe this is not a bug itself, but just us handling an unrecoverable error poorly and crashing instead of exiting gracefully.

The error message is accurate. You probably do have some other Rojo server running on that port. Sometimes you might need to restart your terminal, your editor, or even your computer if you're unable to find the process with that port open.

I'll make sure Rojo exits gracefully when a port is already in use, if possible!

@LPGhatguy LPGhatguy added impact: small Minor papercuts in Rojo that don't warrant immediate resolutoin. size: small type: bug Something happens that shouldn't happen labels Mar 14, 2020
@ryanlego
Copy link
Author

I wish I could just exit my editor, or restart my terminal, but I had to restart my laptop to fix the issue. Haha lol, I wish the process was automatic and was removed upon qutting of the editor.

@joeldesante
Copy link

joeldesante commented May 5, 2020

For Mac Users, the solution to this when it occurs goes as follows:

  1. In the terminal type the command lsof -i :34872 (assuming you are on the default port)

  2. Look for the first rojo PID. It should look something like this:
    rojo 25247 username 3u IPv4 xxxxxxxxxxxxxxxxxx 0t0 TCP localhost:34872 (LISTEN)
    The PID in this case is 25247

  3. Now, run the command kill -9 25247 where "25247" is the PID that your computer displayed.

After doing this, click the Start Rojo button and crack on with what you were doing.

@ryanlego
Copy link
Author

ryanlego commented May 5, 2020

@joeldesante Thank you for your solution, the terminal commands are unnecessary as I can simply just restart my laptop. Nonetheless, it's a minor issue and I appreciate you for giving me a solution based on just command-prompts.

@joeldesante
Copy link

@ryanlego Are you using VSCode by any chance?

@ryanlego
Copy link
Author

Yes, I am. @joeldesante

@joeldesante
Copy link

@ryanlego

I've made a pull request to the VSCode plugin for Rojo which should hopefully fix this issue. If it's acceptable to the maintainer, it turns out it was able to be fixed with just one line of code.

rojo-rbx/vscode-rojo#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: small Minor papercuts in Rojo that don't warrant immediate resolutoin. size: small type: bug Something happens that shouldn't happen
Projects
None yet
Development

No branches or pull requests

4 participants