Minikube: Failed to cache ISO: open .netrc: permission denied

Created on 17 Oct 2019  路  20Comments  路  Source: kubernetes/minikube

I just freshly installed minikube to try it out in my Mac but have not managed to start

stanleynguyen@macair:~ $ minikube version
minikube version: v1.4.0
commit: 7969c25a98a018b94ea87d949350f3271e9d64b6
stanleynguyen@macair:~ $ minikube start
馃槃  minikube v1.4.0 on Darwin 10.14.6
馃捒  Downloading VM boot image ...

馃挘  Failed to cache ISO: https://storage.googleapis.com/minikube/iso/minikube-v1.4.0.iso: invalid checksum: Error downloading checksum file: Error parsing netrc file at "/Users/stanleynguyen/.netrc": open /Users/stanleynguyen/.netrc: permission denied

馃樋  Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
馃憠  https://github.com/kubernetes/minikube/issues/new/choose

It seems that because minikube is asking for access to my .netrc file but I don't think it's supposed to have access to such file with sensitive info like my passwords

I still tried running it in superuser mode anyway, and faced with another problem

stanleynguyen@macair:~ $ sudo minikube start
Password:
馃槃  minikube v1.4.0 on Darwin 10.14.6
馃洃  The "virtualbox" driver should not be used with root privileges.
馃挕  If you are running minikube within a VM, consider using --vm-driver=none:
馃摌    https://minikube.sigs.k8s.io/docs/reference/drivers/none/

Note: I have virtualbox installed in my local as VM environment (I also used this for Docker)

The operating system version: MacOS Mojave 10.14.6

arenetworking kinsupport lifecyclrotten prioritawaiting-more-evidence

Most helpful comment

It seems like the network library minikube uses accesses .netrc, and raises an error if it cannot: https://github.com/hashicorp/go-getter/blob/master/netrc.go

As a workaround, you can manually download the ISO:

curl -L https://storage.googleapis.com/minikube/iso/minikube-v1.4.0.iso > ~/.minikube/cache/iso/minikube-v1.4.0.iso

Like most network commands, curl also references your .netrc, but it is nice enough to fail.

All 20 comments

It seems like the network library minikube uses accesses .netrc, and raises an error if it cannot: https://github.com/hashicorp/go-getter/blob/master/netrc.go

As a workaround, you can manually download the ISO:

curl -L https://storage.googleapis.com/minikube/iso/minikube-v1.4.0.iso > ~/.minikube/cache/iso/minikube-v1.4.0.iso

Like most network commands, curl also references your .netrc, but it is nice enough to fail.

Thanks @tstromberg :smile: how do you think we should go about solving this? I will take this issue

Why is it a bug that it reads user configuration from the home directory ? I don't see why it is.

@afbjorklund Since the ISO is public, I don't think it's necessary to read .netrc 馃

Oh, it's not _used_ at all (each entry has a machine token anyway). Just wondered why it was "bad" ?
It's a standard configuration file, so read-protecting it is a bit strange... Better to move/rename it, if so.

My .netrc has always been read protected from the start though. I don't know what the convention out there is but it makes sense to me as this file contains some of my passwords to cloud services (heroku, etc.)

Perhaps having another way to download the .iso when the first way of downloading it failed ?

Yea I'm thinking of using https://github.com/cavaliercoder/grab as fallback

I'd rather not import two different HTTP libraries.

I believe the workaround is to either rename your .netrc or use the following invocation to tell it to ignore your netrc file:

env NETRC=/nonexistent minikube start

I would also argue that storing plain-text passwords in a local file is bad news, and that .netrc is an outdated idea not suited for a world where private/public key cryptography is king. .netrc files served us well for the last 40 years, and will die a slow death, just like .rhosts did before it.

If you would like to see this get fixed, please open an issue with upstream:

https://github.com/hashicorp/go-getter/issues/new

Once fixed there, we can upgrade which go-getter version we point to.

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

@stanleynguyen How did you resolve this issue? I am facing the issue with minikube 1.7.0.

It seems like the network library minikube uses accesses .netrc, and raises an error if it cannot: https://github.com/hashicorp/go-getter/blob/master/netrc.go

As a workaround, you can manually download the ISO:

curl -L https://storage.googleapis.com/minikube/iso/minikube-v1.4.0.iso > ~/.minikube/cache/iso/minikube-v1.4.0.iso

Like most network commands, curl also references your .netrc, but it is nice enough to fail.

@naveeniitbhu u can follow the above comment to work around

Did you open a bug report upstream yet ? Looks like a library issue...

@afbjorklund yup. https://github.com/hashicorp/go-getter/issues/221 was opened for this

I added an implementation (even wrote a test case).

Most likely it would be better to keep the secret file somewhere else and use $NETRC for accessing it, but then again we can just ignore the contents instead of throwing a "permission denied" error...

Upstream looks comatose, but maybe we can cherry-pick.

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

/close

@stanleynguyen: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

It seems like the network library minikube uses accesses .netrc, and raises an error if it cannot: https://github.com/hashicorp/go-getter/blob/master/netrc.go

As a workaround, you can manually download the ISO:

curl -L https://storage.googleapis.com/minikube/iso/minikube-v1.4.0.iso > ~/.minikube/cache/iso/minikube-v1.4.0.iso

Like most network commands, curl also references your .netrc, but it is nice enough to fail.

i did as u mantioned after downloading iso now i start minikube by command "minkube start" but it again stuck on downloading VM boot image.

Was this page helpful?
0 / 5 - 0 ratings