Git Product home page Git Product logo

Comments (7)

justinfx avatar justinfx commented on July 23, 2024

It seems its specifically related to how we configure our docker network at my studio vs a default installation, to deal with the potential for conflicts with the external network. So maybe this is just a matter of documenting the situation.

from olric.

buraksezer avatar buraksezer commented on July 23, 2024

Thank you for informing me. I'm going to take a look at thanos#615. Could you please give more information about your setup? Thus, I can provide the problem on my side.

from olric.

justinfx avatar justinfx commented on July 23, 2024

I have a reproduction for you.

docker network create --subnet=169.254.0.0/16 testnet

docker run -it --network testnet --ip 169.254.0.128 --rm -p 3320:3320 olricio/olricd:latest
# Olric quits prematurely:
# no private IP address found, and explicit IP not provided

docker network rm testnet

This replicates how my studio has custom network settings for their docker deployment to deal with known issues like address collisions, etc. But in this case the hashicorp memberlist isn't happy with the private ip range.

from olric.

d1ngd0 avatar d1ngd0 commented on July 23, 2024

Hey, Sorry for pulling this one up again, but I am currently experiencing an issue myself. It looks like this line

	privateIfs, _, err = IfByRFC("6890", privateIfs)

inside vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go is forcing all ip addresses to be within RFC 6890 which is likely too narrow. Would it make sense to simply first look into the private addresses, and if nothing is found look into the public ones?

	if bindIP == "0.0.0.0" {
		// if we're not bound to a specific IP, let's use a suitable private IP address.
		ipStr, err := sockaddr.GetPrivateIP()
		if err != nil {
			return "", fmt.Errorf("failed to get interface addresses: %w", err)
		}
		if ipStr == "" {
		        // Add logic here to search public ip addresses for bind address.
			return "", fmt.Errorf("no private IP address found, and explicit IP not provided")
		}

		parsed := net.ParseIP(ipStr)
		if parsed == nil {
			return "", fmt.Errorf("failed to parse private IP address: %q", ipStr)
		}
		bindIP = parsed.String()
	}

For instance my IP is within this range but you can see the Source is set to false, which is defined here. I'd be happy to write something up for you if you feel this is the correct direction. Otherwise if you have other ideas I would be willing to implement them too :)

from olric.

d1ngd0 avatar d1ngd0 commented on July 23, 2024

BTW: The workaround for this is to specify the interface in both the olric section of the config as well as the memberlist. When specifying the interface it looks like olric doesn't care what the ip address is.

from olric.

buraksezer avatar buraksezer commented on July 23, 2024

Hi @d1ngd0

Firstly, I'm so sorry for my late response.

When specifying the interface it looks like olric doesn't care what the ip address is.

Yes it is. Olric tries to discover the IP address from the network interface, if it is defined in the config.

I'd be happy to write something up for you if you feel this is the correct direction. Otherwise if you have other ideas I would be willing to implement them too :)

Great! I would like to see your solution and discuss about it.

from olric.

justinfx avatar justinfx commented on July 23, 2024

This does work for me now, with the 0.4.4 release

from olric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.