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

🐛 BUG: when using nebula as library in custom application - we cannot handle os.Exit produced by library #1031

Open
valda-z opened this issue Dec 1, 2023 · 4 comments
Labels
bug Something isn't working NeedsFix The path to resolution is known, but the work has not been done.

Comments

@valda-z
Copy link

valda-z commented Dec 1, 2023

What version of nebula are you using?

1.7.2

What operating system are you using?

Linux, macOS, Windows

Describe the Bug

We are using nebula as library in our own binaries. But because library code contains os.Exit, we cannot handle it.
In our solution we are using customized source code of nebula to handle it correctly.
Problem is with file interface.go on line 285:

nebula/interface.go

Lines 284 to 285 in b22ba6e

// This only seems to happen when something fatal happens to the fd, so exit.
os.Exit(2)

We are changing code in our solution to:
break;

And after break from loop library returns that connection is broken and we can start connecting again.

Logs from affected hosts

No logs needed

Config files from affected hosts

No response

@wadey
Copy link
Member

wadey commented Dec 4, 2023

I agree this should be fixed. I am curious how this is happening in your system, as I have never seen this os.Exit trigger in the wild myself. Do you have any details on that?

@wadey wadey added the bug Something isn't working label Dec 4, 2023
@johnmaguire
Copy link
Collaborator

Hi @valda-z - I just wanted to bump this ticket again and ask if you have any additional details regarding this line of code being hit? Thanks!

@valda-z
Copy link
Author

valda-z commented Dec 28, 2023

I think that we can see it only in some very rare situations. But unfortunately we have no logs for this because in fact we are restarting our service and it is not issue for us ..
One situation observed is - when network interface are changing - from lan to wifi network card
Second - when disabling networking completely on machine.

@johnmaguire johnmaguire added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 11, 2024
@nbrownus
Copy link
Collaborator

Was able to repro using ip link delete $deviceName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants