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

getting an error with Ubuntu #238

Closed
Z-JaDe opened this issue Sep 15, 2018 · 3 comments
Closed

getting an error with Ubuntu #238

Z-JaDe opened this issue Sep 15, 2018 · 3 comments

Comments

@Z-JaDe
Copy link

Z-JaDe commented Sep 15, 2018

Fatal error: Error raised at top level: bind(descriptor:ptr:bytes:) failed: Address already in use (errno: 98): file /home/buildnode/jenkins/workspace/oss-swift-4.1-package-linux-ubuntu-16_04/swift/stdlib/public/core/ErrorType.swift, line 191
Current stack trace:
0 libswiftCore.so 0x00007f0adfee15c0 _swift_stdlib_reportFatalErrorInFile + 221
1 libswiftCore.so 0x00007f0adfc503dc + 1369052
2 libswiftCore.so 0x00007f0adfe8a222 + 3703330
3 libswiftCore.so 0x00007f0adfe8b689 + 3708553
4 libswiftCore.so 0x00007f0adfc4fad6 + 1366742
5 libswiftCore.so 0x00007f0adfe89feb + 3702763
6 libswiftCore.so 0x00007f0adfc4fad6 + 1366742
7 libswiftCore.so 0x00007f0adfdbcf79 + 2862969
8 libswiftCore.so 0x00007f0adfc8d960 swift_errorInMain + 318
9 Run 0x0000002e7410d252 + 5984850
10 libc.so.6 0x00007f0add4ab740 __libc_start_main + 240
11 Run 0x0000002e73c04189 + 704905

It's the same error to run "vapor run" on MAC(local), but it's normal to run "vapor update".
Error messages are always reported on Ubuntu(server)

@vzsg
Copy link
Member

vzsg commented Sep 15, 2018

The error message means that the application couldn't bind to the port it's configured to listen on (8080 by default), because some other process is using it.

This can be another instance of your app, or something else completely. You can use sudo lsof -i :8080 to see what it is, then kill it.

@Z-JaDe
Copy link
Author

Z-JaDe commented Sep 15, 2018

It turns out, thank you very much, I will try again tomorrow.

@Z-JaDe Z-JaDe closed this as completed Sep 17, 2018
@Sparklydust
Copy link

Sparklydust commented Jan 25, 2021

You can give your Vapor application a pre-actions to automatically delete the port being used each time you build and run your project.
The credit goes to @tiborbodecs and you can find the information on his website.

Open the Scheme of your app and add this pre-action before your project run:

lsof -i :8080 -sTCP:LISTEN |awk 'NR > 1 {print $2}'|xargs kill -15

You will never encounter this issue again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants