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

error converting YAML to JSON: yaml: line 6: found unknown escape character #8510

Closed
abhishekd07 opened this issue Jun 18, 2020 · 6 comments
Closed
Labels
co/hyperv HyperV related issues kind/support Categorizes issue or PR as a support question. os/windows

Comments

@abhishekd07
Copy link

Steps to reproduce the issue:

1.minikube.exe --extra-config=apiserver.Authentication.PasswordFile.BasicAuthFile=C:\Personal\Kubernetes\users.csv start --driver=hyperv

Full output of failed command:
stderr:
ls: cannot access '/etc/kubernetes/admin.conf': No such file or directory
ls: cannot access '/etc/kubernetes/kubelet.conf': No such file or directory
ls: cannot access '/etc/kubernetes/controller-manager.conf': No such file or directory
ls: cannot access '/etc/kubernetes/scheduler.conf': No such file or directory
I0618 12:51:10.018814 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap"
! initialization failed, will try again: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": Process exited with status 1
stdout:

stderr:
error converting YAML to JSON: yaml: line 6: found unknown escape character
To see the stack trace of this error execute with --v=5 or higher

I0618 12:51:10.069019 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm reset --cri-socket npipe:////./pipe/docker_engine --force"
I0618 12:51:10.163864 10780 ssh_runner.go:148] Run: sudo systemctl stop -f kubelet
I0618 12:51:10.194395 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_.*(kube-system) --format={{.ID}}
I0618 12:51:10.251809 10780 ssh_runner.go:148] Run: sudo ls -la /etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf
I0618 12:51:10.259973 10780 kubeadm.go:147] config check failed, skipping stale config cleanup: sudo ls -la /etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf: Process exited with status 2
stdout:

stderr:
ls: cannot access '/etc/kubernetes/admin.conf': No such file or directory
ls: cannot access '/etc/kubernetes/kubelet.conf': No such file or directory
ls: cannot access '/etc/kubernetes/controller-manager.conf': No such file or directory
ls: cannot access '/etc/kubernetes/scheduler.conf': No such file or directory
I0618 12:51:10.260936 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap"
I0618 12:51:10.316041 10780 kubeadm.go:295] StartCluster complete in 445.2251ms
I0618 12:51:10.319046 10780 ssh_runner.go:188] Completed: curl -sS -m 2 https://k8s.gcr.io/: (6.0130311s)
I0618 12:51:10.334049 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_kube-apiserver --format={{.ID}}
I0618 12:51:10.369025 10780 logs.go:203] 0 containers: []
W0618 12:51:10.369025 10780 logs.go:205] No container was found matching "kube-apiserver"
I0618 12:51:10.392187 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_etcd --format={{.ID}}
I0618 12:51:10.427462 10780 logs.go:203] 0 containers: []
W0618 12:51:10.428426 10780 logs.go:205] No container was found matching "etcd"
I0618 12:51:10.449461 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_coredns --format={{.ID}}
I0618 12:51:10.491858 10780 logs.go:203] 0 containers: []
W0618 12:51:10.491858 10780 logs.go:205] No container was found matching "coredns"
I0618 12:51:10.525393 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_kube-scheduler --format={{.ID}}
I0618 12:51:10.568390 10780 logs.go:203] 0 containers: []
W0618 12:51:10.568390 10780 logs.go:205] No container was found matching "kube-scheduler"
I0618 12:51:10.586389 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_kube-proxy --format={{.ID}}
I0618 12:51:10.618428 10780 logs.go:203] 0 containers: []
W0618 12:51:10.619393 10780 logs.go:205] No container was found matching "kube-proxy"
I0618 12:51:10.640433 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_kubernetes-dashboard --format={{.ID}}
I0618 12:51:10.669424 10780 logs.go:203] 0 containers: []
W0618 12:51:10.670390 10780 logs.go:205] No container was found matching "kubernetes-dashboard"
I0618 12:51:10.696430 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_storage-provisioner --format={{.ID}}
I0618 12:51:10.728479 10780 logs.go:203] 0 containers: []
W0618 12:51:10.729457 10780 logs.go:205] No container was found matching "storage-provisioner"
I0618 12:51:10.748481 10780 ssh_runner.go:148] Run: docker ps -a --filter=name=k8s_kube-controller-manager --format={{.ID}}
I0618 12:51:10.781480 10780 logs.go:203] 0 containers: []
W0618 12:51:10.782455 10780 logs.go:205] No container was found matching "kube-controller-manager"
I0618 12:51:10.785447 10780 logs.go:117] Gathering logs for kubelet ...
I0618 12:51:10.789746 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo journalctl -u kubelet -n 400"
I0618 12:51:10.805686 10780 logs.go:117] Gathering logs for dmesg ...
I0618 12:51:10.805686 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo dmesg -PH -L=never --level warn,err,crit,alert,emerg | tail -n 400"
I0618 12:51:10.819689 10780 logs.go:117] Gathering logs for describe nodes ...
I0618 12:51:10.820653 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo /var/lib/minikube/binaries/v1.18.3/kubectl describe nodes --kubeconfig=/var/lib/minikube/kubeconfig"
W0618 12:51:10.889697 10780 logs.go:124] failed describe nodes: command: /bin/bash -c "sudo /var/lib/minikube/binaries/v1.18.3/kubectl describe nodes --kubeconfig=/var/lib/minikube/kubeconfig" /bin/bash -c "sudo /var/lib/minikube/binaries/v1.18.3/kubectl describe nodes --kubeconfig=/var/lib/minikube/kubeconfig": Process exited with status 1
stdout:

stderr:
The connection to the server localhost:8443 was refused - did you specify the right host or port?
output:
** stderr **
The connection to the server localhost:8443 was refused - did you specify the right host or port?

** /stderr **
I0618 12:51:10.889697 10780 logs.go:117] Gathering logs for Docker ...
I0618 12:51:10.897713 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo journalctl -u docker -n 400"
I0618 12:51:10.923703 10780 logs.go:117] Gathering logs for container status ...
I0618 12:51:10.923703 10780 ssh_runner.go:148] Run: /bin/bash -c "sudo which crictl || echo crictl ps -a || sudo docker ps -a"
I0618 12:51:12.967283 10780 ssh_runner.go:188] Completed: /bin/bash -c "sudo which crictl || echo crictl ps -a || sudo docker ps -a": (2.0405513s)
W0618 12:51:12.968246 10780 out.go:201] Error starting cluster: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": Process exited with status 1
stdout:

stderr:
error converting YAML to JSON: yaml: line 6: found unknown escape character
To see the stack trace of this error execute with --v=5 or higher
*
X Error starting cluster: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": Process exited with status 1
stdout:

stderr:
error converting YAML to JSON: yaml: line 6: found unknown escape character
To see the stack trace of this error execute with --v=5 or higher

  • minikube is exiting due to an error. If the above message is not useful, open an issue:
    • https://github.com/kubernetes/minikube/issues/new/choose
      I0618 12:51:12.977582 10780 exit.go:58] WithError(failed to start node)=startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": Process exited with status 1
      stdout:

stderr:
error converting YAML to JSON: yaml: line 6: found unknown escape character
To see the stack trace of this error execute with --v=5 or higher
called from:
goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
/usr/local/go/src/runtime/debug/stack.go:24 +0xa4
k8s.io/minikube/pkg/minikube/exit.WithError(0x1b3e92f, 0x14, 0x1e16f20, 0xc00010af60)
/app/pkg/minikube/exit/exit.go:58 +0x3b
k8s.io/minikube/cmd/minikube/cmd.runStart(0x2b6c200, 0xc0002f87b0, 0x0, 0x3)
/app/cmd/minikube/cmd/start.go:203 +0x7fe
github.com/spf13/cobra.(*Command).execute(0x2b6c200, 0xc0002f8780, 0x3, 0x3, 0x2b6c200, 0xc0002f8780)
/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2b1
github.com/spf13/cobra.(*Command).ExecuteC(0x2b710c0, 0x0, 0x20, 0xc0002bbca0)
/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
k8s.io/minikube/cmd/minikube/cmd.Execute()
/app/cmd/minikube/cmd/root.go:112 +0x6f5
main.main()
/app/cmd/minikube/main.go:66 +0xf1
W0618 12:51:12.978574 10780 out.go:201] failed to start node: startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": Process exited with status 1
stdout:

stderr:
error converting YAML to JSON: yaml: line 6: found unknown escape character
To see the stack trace of this error execute with --v=5 or higher
*
X failed to start node: startup failed: run: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.18.3:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": Process exited with status 1
stdout:

stderr:
error converting YAML to JSON: yaml: line 6: found unknown escape character
To see the stack trace of this error execute with --v=5 or higher

Full output of minikube start command used, if not already included:

Optional: Full output of minikube logs command:

@abhishekd07
Copy link
Author

abhishekd07 commented Jun 18, 2020

this is not a consistent behavior. Sometimes it minikube instance starts without any issues by using the same start command. Windows 10 with WSL 2

@dbabbitt
Copy link

This is what I get when I try something simpler:

PS C:\Windows\system32> minikube start --driver=docker
* minikube v1.11.0 on Microsoft Windows 10 Enterprise 10.0.16299 Build 16299
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Restarting existing docker container for "minikube" ...
! StartHost failed, but will try again: driver start: expected container state be running but got "Stopped"
* Restarting existing docker container for "minikube" ...
* Failed to start docker container. "minikube start" may fix it: driver start: expected container state be running but got "Stopped"
*
X error provisioning host: Failed to start host: driver start: expected container state be running but got "Stopped"
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose
PS C:\Windows\system32> minikube start
* minikube v1.11.0 on Microsoft Windows 10 Enterprise 10.0.16299 Build 16299
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Restarting existing docker container for "minikube" ...
! StartHost failed, but will try again: driver start: expected container state be running but got "Stopped"
* Restarting existing docker container for "minikube" ...
* Failed to start docker container. "minikube start" may fix it: driver start: expected container state be running but got "Stopped"
*
X error provisioning host: Failed to start host: driver start: expected container state be running but got "Stopped"
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose
PS C:\Windows\system32> minikube status
minikube
type: Control Plane
host: Stopped
kubelet: Stopped
apiserver: Stopped
kubeconfig: Stopped

PS C:\Windows\system32> minikube start --driver=docker
* minikube v1.11.0 on Microsoft Windows 10 Enterprise 10.0.16299 Build 16299
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* docker "minikube" container is missing, will recreate.
E0618 16:50:55.956038    8328 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker container inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Error: No such container: minikube
* Creating docker container (CPUs=2, Memory=1967MB) ...
! StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: check container "minikube" running: temporary error created container "minikube" is not running yet
* Restarting existing docker container for "minikube" ...
* Failed to start docker container. "minikube start" may fix it: driver start: expected container state be running but got "Stopped"
*
X error provisioning host: Failed to start host: driver start: expected container state be running but got "Stopped"
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose
PS C:\Windows\system32> minikube start --driver=docker --preload=false
* minikube v1.11.0 on Microsoft Windows 10 Enterprise 10.0.16299 Build 16299
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Restarting existing docker container for "minikube" ...
! StartHost failed, but will try again: driver start: expected container state be running but got "Stopped"
* Restarting existing docker container for "minikube" ...
* Failed to start docker container. "minikube start" may fix it: driver start: expected container state be running but got "Stopped"
*
X error provisioning host: Failed to start host: driver start: expected container state be running but got "Stopped"
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose
PS C:\Windows\system32>

Here are the log files from Docker Desktop:

INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables
INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables
INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables
INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables

@afbjorklund
Copy link
Collaborator

@dbabbitt : that is something different, that is the docker driver (not hyper-v) and seems to be a duplicate of #8100

@afbjorklund afbjorklund added co/hyperv HyperV related issues os/windows labels Jun 22, 2020
@dbabbitt
Copy link

dbabbitt commented Jun 22, 2020 via email

@tstromberg tstromberg changed the title Minikube Start Up Error on Windows error converting YAML to JSON: yaml: line 6: found unknown escape character Jun 24, 2020
@tstromberg
Copy link
Contributor

Based on the command-line:

minikube.exe --extra-config=apiserver.Authentication.PasswordFile.BasicAuthFile=C:\Personal\Kubernetes\users.csv start --driver=hyperv

The YAML issue is because the backslashes being passed in not being valid (and not being escaped on our end). The path given needs to exist within the VM, not on the host. I suggest using https://minikube.sigs.k8s.io/docs/handbook/filesync/

  • Add the file to C:\Personal.minikube\files\etc
  • Specify BasicAuthFile=/etc/users.csv

@tstromberg tstromberg added the kind/support Categorizes issue or PR as a support question. label Jun 24, 2020
@medyagh
Copy link
Member

medyagh commented Aug 12, 2020

Hi @, I haven't heard back from you, I wonder if you still have this issue?
Regrettably, there isn't enough information in this issue to make it actionable, and a long enough duration has passed, so this issue is likely difficult to replicate.

I will close this issue for now but please feel free to reopen whenever you feel ready to provide more information.

@medyagh medyagh closed this as completed Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues kind/support Categorizes issue or PR as a support question. os/windows
Projects
None yet
Development

No branches or pull requests

5 participants