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

Using this package without ipvs doesn't return error #27

Open
uablrek opened this issue Dec 23, 2022 · 3 comments
Open

Using this package without ipvs doesn't return error #27

uablrek opened this issue Dec 23, 2022 · 3 comments

Comments

@uablrek
Copy link

uablrek commented Dec 23, 2022

I use you example, slightly modified;

package main

import (
	"log"

	"github.com/moby/ipvs"
)

func main() {
	handle, err := ipvs.New("")
	if err != nil {
		log.Fatalf("ipvs.New: %s", err)
	}
	log.Println("ipvs.New did NOT give an error!!")
	_, err = handle.GetServices()
	if err != nil {
		log.Fatalf("handle.GetServices: %s", err)
	}
	log.Println("handle.GetServices did NOT give an error!!")
}

And run on a kernel where ipvs is not configured. Output:

# moby-example 
WARN[0000] Running modprobe ip_vs failed with message: `modprobe: WARNING: Module ip_vs not found in directory /lib/modules/6.1.0`, error: exit status 1 
ERRO[0000] Could not get ipvs family information from the kernel. It is possible that ipvs is not enabled in your kernel. Native loadbalancing will not work until this is fixed. 
2022/12/23 18:09:43 ipvs.New did NOT give an error!!
2022/12/23 18:09:43 handle.GetServices did NOT give an error!!

So, that ipvs can't be loaded is obviously noted, but even so err==nil is returned.

This is a serious bug, which enforces weird work-arounds do detect if ipvs can be used:

https://github.com/Nordix/kubernetes/blob/68d78c89eccf2d2f381033c836472d53f3ba41c9/pkg/proxy/ipvs/proxier.go#L692-L694

@uablrek
Copy link
Author

uablrek commented Dec 23, 2022

This is output on a statically linked kernel where ipvs is configured:

# moby-example 
WARN[0000] Running modprobe ip_vs failed with message: `modprobe: WARNING: Module ip_vs not found in directory /lib/modules/6.0.0`, error: exit status 1 
2022/12/23 18:22:09 ipvs.New did NOT give an error!!
2022/12/23 18:22:09 handle.GetServices did NOT give an error!!

Please drop the "WARN". To use a statically linked kernel is not an "odd thing". When using moby/ipvs in a system that tries to use structured logging, printouts like this from a library is an annoyance.

uablrek pushed a commit to Nordix/kubernetes that referenced this issue Dec 24, 2022
Handle moby/ipvs#27
A work-around was already in place, but a segv would occur
when the bug is fixed. That will not happen now.
jaehnri pushed a commit to jaehnri/kubernetes that referenced this issue Jan 3, 2023
Handle moby/ipvs#27
A work-around was already in place, but a segv would occur
when the bug is fixed. That will not happen now.
@uablrek
Copy link
Author

uablrek commented Feb 1, 2023

Is this project still active?

@lojies
Copy link

lojies commented Oct 14, 2023

@thaJeztah, can you help see this problem

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

Successfully merging a pull request may close this issue.

2 participants