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

--host-only-cidr: invalid CIDR address: '192.168.99.1/24' #7063

Open
jgoeres opened this issue Mar 16, 2020 · 14 comments
Open

--host-only-cidr: invalid CIDR address: '192.168.99.1/24' #7063

jgoeres opened this issue Mar 16, 2020 · 14 comments
Labels
co/virtualbox good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@jgoeres
Copy link

jgoeres commented Mar 16, 2020

With my ancient minikube version (1.4.0), I had been using the option

--host-only-cidr='192.168.99.1/24' 

which now gives me

X Unable to start VM. Please investigate and run 'minikube delete' if possible: driver start: Error 
setting up host only network on machine start: invalid CIDR address: '192.168.99.1/24'

with both 1.8.1 and 1.8.2.
I used the option to make sure that the minikube VM gets attached to the right host-only network. It now seemed to work fine without it, so this might be no longer needed, but still...

Regards
J

@tstromberg tstromberg added the kind/support Categorizes issue or PR as a support question. label Mar 16, 2020
@tstromberg
Copy link
Contributor

Can you please share the entire minikube start output and command-line flags used?

The example --host-only-cidr command works for me on v1.8.3 using hyperkit and virtualbox drivers on macOS.

@tstromberg tstromberg added the triage/needs-information Indicates an issue needs more information in order to work on it. label Mar 16, 2020
@afbjorklund
Copy link
Collaborator

It seems like the quotes ended up inside the actual configuration, somehow.

package main

import "net"
import "fmt"


func main() {

	hostOnlyCIDR := "'192.168.99.1/24'"
	ip, network, err := net.ParseCIDR(hostOnlyCIDR)
	if err != nil {
		panic(fmt.Sprintf("%v", err))
	}

	fmt.Printf("ip: %v, network: %v\n", ip, network)
}

panic: invalid CIDR address: '192.168.99.1/24'

With just the regular quotes (i.e. not the embedded single quotes), it is fine.

ip: 192.168.99.1, network: 192.168.99.0/24

@afbjorklund
Copy link
Collaborator

Unless I am missing something, that is the default option anyway ?

--host-only-cidr='192.168.99.1/24': The CIDR to be used for the minikube VM (virtualbox driver only)

@jgoeres
Copy link
Author

jgoeres commented Mar 19, 2020

I usually used to run

minikube start --disk-size 30G --cpus 6 --insecure-registry <ourInternalRegistry> --memory 12g --host-only-cidr='192.168.99.1/24'

I don't remember the details why I actually started using the host-only-cidr switch - IIRC back when I started using minikube (around v1.4.0) the minikube VM sometimes ended up using the wrong host-only-network.
In the current version I am fine without the switch, cause, as you said, the default works just fine.

@tstromberg tstromberg added kind/bug Categorizes issue or PR as related to a bug. and removed triage/needs-information Indicates an issue needs more information in order to work on it. kind/support Categorizes issue or PR as a support question. labels Apr 15, 2020
@tstromberg tstromberg changed the title minikube start option "--host-only-cidr" no longer works --host-only-cidr: invalid CIDR address: '192.168.99.1/24' Apr 15, 2020
@tstromberg tstromberg added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Apr 15, 2020
@priyawadhwa priyawadhwa added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 22, 2020
@priyawadhwa
Copy link

As @afbjorklund commented, I think the only thing to do here is to trim the address of quotes & validate that it is valid. If invalid, return an error message.

        hostOnlyCIDR = strings.Trim(hostOnlyCIDR, "'\"")
	ip, network, err := net.ParseCIDR(hostOnlyCIDR)
	if err != nil {
		return errors.Wrap(err, "invalid address")
	}

this code would probably live in a helper function that would be called here:

func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {

If anyone is interested in taking this on, feel free to take this issue by commenting /assign

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 21, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 20, 2020
@sharifelgamal sharifelgamal added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Aug 26, 2020
@Aut0R3V
Copy link
Contributor

Aut0R3V commented Dec 16, 2020

/assign

@bl-ue
Copy link

bl-ue commented Jan 4, 2021

/remove-lifecycle frozen

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Jan 4, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 4, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 4, 2021
@medyagh
Copy link
Member

medyagh commented May 12, 2021

@Aut0R3V are you still working on this ?

@medyagh medyagh added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels May 12, 2021
@vibecoder
Copy link
Contributor

Hi, I was trying to replicate this issue. The value of fmt.Println(viper.GetString("host-only-cidr")) that I am getting does not have the single quotes on my output hen running the command ./out/minikube start --driver=virtualbox -p virt --host-only-cidr='192.168.99.1/24' and the minikube clusters starts as expected

@tharun208
Copy link
Contributor

yes with the latest minikube I am also able to get the cluster started as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/virtualbox good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.