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

Improve the error message: Address already in use #1398

Open
battlmonstr opened this issue Aug 2, 2023 · 2 comments
Open

Improve the error message: Address already in use #1398

battlmonstr opened this issue Aug 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@battlmonstr
Copy link
Collaborator

When starting silkworm without arguments after staring erigon without arguments on the same computer, silkworm crashes with "Unrecoverable failure: Address already in use" and no other clues. Apparently it wants to occupy some default TCP/UDP ports that are in use by the erigon process.

The error message needs to be improved to explain what port is occupied, what for is it needed, and which command line parameter must be passed to customize it.

@battlmonstr battlmonstr added the bug Something isn't working label Aug 2, 2023
@battlmonstr
Copy link
Collaborator Author

PR 1: #1611
PR 2: #1788

@battlmonstr
Copy link
Collaborator Author

battlmonstr commented Jan 31, 2024

One place where this still happens is in the sentry GRPC servers. In this case BuildAndStart returns null here: https://github.com/erigontech/silkworm/blob/master/silkworm/infra/grpc/server/server.hpp#L84

It is possible to implement GlobalCallbacks::AddPort, and call grpc::Server::SetGlobalCallbacks(...) to register the implementation. BuildAndStart() calls it here and that should trigger a callback. If port == 0 in the AddPort callback, we can assume that the port is busy.

This gives information to extend the error message here: https://github.com/erigontech/silkworm/blob/master/silkworm/infra/grpc/server/server.hpp#L86

canepat pushed a commit that referenced this issue Jan 31, 2024
Co-authored-by: claudioutt <c.uttenweiler@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant