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

Change the error message when Config file is not available #4920

Closed
blueelvis opened this issue Jul 30, 2019 · 7 comments · Fixed by #5732
Closed

Change the error message when Config file is not available #4920

blueelvis opened this issue Jul 30, 2019 · 7 comments · Fixed by #5732
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@blueelvis
Copy link
Contributor

The exact command to reproduce the issue:
minikube-windows-amd64.exe start --alsologtostderr --v=8

The full output of the command that failed:


The full output is correct but this first line kind of pops out -

Error reading config file at C:\Users\Pranav.Jituri\.minikube\config\config.json: open C:\Users\Pranav.Jituri\.minikube\config\config.json: The system cannot find the file specified.

The operating system version:
Windows 10 Enterprise.

Instead of showing it as an error, this needs a better solution message. Earlier, I used to see this and get confused as to what was wrong. Later on figured that this is rather the external custom config which is used.

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jul 30, 2019

Should be shown as a warning, not as an error ?

	err := viper.ReadInConfig()
	if err != nil {
		glog.Warningf("Error reading config file at %s: %v", configPath, err)
	}

The verbose log does have some "scary" messages.

I supposed you could filter out os.IsNotExist(err).

But then it is hard to catch parameters that are wrong.

@blueelvis
Copy link
Contributor Author

My bad. Not an actual error but I mean that it should not state "Error" when clearly it is not an error but just that custom config is not present which needs to be applied.

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jul 30, 2019

Apparently it will be a viper.ConfigFileNotFoundError
So could perhaps use that instead of os.IsNotExist

https://github.com/spf13/viper#reading-config-files

And seems like glog doesn't show the severity level.
You filter that using the -v flag, where 8 is quite high

@afbjorklund afbjorklund added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Jul 30, 2019
@RA489
Copy link

RA489 commented Aug 1, 2019

/assign @RA489

@tstromberg
Copy link
Contributor

Anyone know if this still happens in v1.4? I'm still confused as to why this output only appears in Windows. I would have expected to see it tucked away in the logs.

@blueelvis
Copy link
Contributor Author

Yep. Still happening on the latest build -

PS C:\utilities> .\minikube-windows-amd64.exe mount "E:\:/home/mount" --alsologtostderr --v=9                                                     W0922 02:15:42.239730   11644 root.go:240] Error reading config file at C:\Users\bluee\.minikube\config\config.json: open C:\Users\bluee\.minikube\config\config.json: The system cannot find the file specified.
* Mounting host path E:\ into VM as /home/mount ...
  - Mount type:   <no value>
  - User ID:      docker
  - Group ID:     docker
  - Version:      9p2000.L
  - Message Size: 262144
  - Permissions:  755 (-rwxr-xr-x)
  - Options:      map[]
* Userspace file server: ufs starting
I0922 02:15:43.692197   11644 mount.go:143] Will run: [ "x$(findmnt -T /home/mount | grep /home/mount)" != "x" ] && sudo umount -f /home/mount || echo
I0922 02:15:43.692197   11644 ssh_runner.go:138] Run with output: [ "x$(findmnt -T /home/mount | grep /home/mount)" != "x" ] && sudo umount -f /home/mount || echo
I0922 02:15:43.739202   11644 mount.go:145] unmount force err=<nil>, out=
I0922 02:15:43.739202   11644 mount.go:62] Will run: sudo mkdir -m 755 -p /home/mount && sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=10555,version=9p2000.L 192.168.215.97 /home/mount
I0922 02:15:43.740168   11644 ssh_runner.go:138] Run with output: sudo mkdir -m 755 -p /home/mount && sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=10555,version=9p2000.L 192.168.215.97 /home/mount
I0922 02:17:52.212879   11644 utils.go:167] ! mount: /home/mount: mount(2) system call failed: Connection timed out.
I0922 02:17:52.212879   11644 mount.go:65] sudo mkdir -m 755 -p /home/mount && sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=10555,version=9p2000.L 192.168.215.97 /home/mount failed: err=Process exited with status 32, output: "mount: /home/mount: mount(2) system call failed: Connection timed out.\n"
W0922 02:17:52.213886   11644 exit.go:101] mount failed: mount: /home/mount: mount(2) system call failed: Connection timed out.
: Process exited with status 32
*
X mount failed: mount: /home/mount: mount(2) system call failed: Connection timed out.
: Process exited with status 32
*
* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
  - https://github.com/kubernetes/minikube/issues/new/choose

@tstromberg
Copy link
Contributor

tstromberg commented Sep 24, 2019

Made a PR, because this is confusing users and we probably shouldn't be parsing nonexistent files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
4 participants