question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

command not found after install

See original GitHub issue

sudo snap install microk8s --classic --channel=1.18/stable microk8s (1.18/stable) v1.18.0 from Canonical✓ installed

sudo microk8s status --wait-ready Traceback (most recent call last): File “/snap/microk8s/1319/scripts/wrappers/status.py”, line 149, in <module> available_addons = get_available_addons(get_current_arch()) File “/snap/microk8s/1319/scripts/wrappers/common/utils.py”, line 113, in get_available_addons addons = yaml.load(file, Loader=yaml.FullLoader) AttributeError: module ‘yaml’ has no attribute ‘FullLoader’

lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.4 LTS Release: 18.04 Codename: bionic

uname -r 4.15.0-91-generic

microk8s
zsh: command not found: microk8s

snap services show services are running, snap logs for each of them, I not do see errors except flannelId, pasted below

snap services
Service Startup Current Notes microk8s.daemon-apiserver enabled active - microk8s.daemon-apiserver-kicker enabled active - microk8s.daemon-cluster-agent enabled active - microk8s.daemon-containerd enabled active - microk8s.daemon-controller-manager enabled active - microk8s.daemon-etcd enabled active - microk8s.daemon-flanneld enabled active - microk8s.daemon-kubelet enabled active - microk8s.daemon-proxy enabled active - microk8s.daemon-scheduler enabled active -

sudo snap logs microk8s.daemon-flanneld          
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.342266   16703 main.go:386] Found network config - Backend type: vxlan
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.342416   16703 vxlan.go:120] VXLAN config: VNI=1 Port=0 GBP=false DirectRouting=false
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.389635   16703 local_manager.go:234] Picking subnet in range 10.1.1.0 ... 10.1.255.0
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.393006   16703 local_manager.go:220] Allocated lease (10.1.43.0/24) to current node (192.168.1.124)
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.405622   16703 main.go:317] Wrote subnet file to /var/snap/microk8s/common/run/flannel/subnet.env
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.406204   16703 main.go:321] Running backend.
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.406456   16703 vxlan_network.go:60] watching for new subnet leases
2020-04-04T12:05:01Z microk8s.daemon-flanneld[16703]: I0404 20:05:01.409745   16703 main.go:429] Waiting for 22h59m59.981316306s to renew lease
2020-04-04T12:05:10Z microk8s.daemon-flanneld[16703]: E0404 20:05:10.901030   16703 **watch.go:43] Watch subnets: client: etcd cluster is unavailable or misconfigured; error #0: unexpected EOF
2020-04-04T12:05:10Z microk8s.daemon-flanneld[16703]: E0404 20:05:10.901030   16703 watch.go:171] Subnet watch failed: client: etcd cluster is unavailable or misconfigured; error #0: unexpected EOF**

journalctl logs grep flannel and etcd

Apr 04 20:05:22    microk8s.daemon-apiserver[18786]: + exec /snap/microk8s/1319/kube-apiserver --cert-dir=/var/snap/microk8s/1319/certs --service-cluster-ip-range=10.152.183.0/24 --authorization-mode=AlwaysAllow --basic-auth-file=/var/snap/microk8s/1319/credentials/basic_auth.csv --service-account-key-file=/var/snap/microk8s/1319/certs/serviceaccount.key --client-ca-file=/var/snap/microk8s/1319/certs/ca.crt --tls-cert-file=/var/snap/microk8s/1319/certs/server.crt --tls-private-key-file=/var/snap/microk8s/1319/certs/server.key --kubelet-client-certificate=/var/snap/microk8s/1319/certs/server.crt --kubelet-client-key=/var/snap/microk8s/1319/certs/server.key --secure-port=16443 --token-auth-file=/var/snap/microk8s/1319/credentials/known_tokens.csv --token-auth-file=/var/snap/microk8s/1319/credentials/known_tokens.csv --etcd-servers=https://127.0.0.1:12379 --etcd-cafile=/var/snap/microk8s/1319/certs/ca.crt --etcd-certfile=/var/snap/microk8s/1319/certs/server.crt --etcd-keyfile=/var/snap/microk8s/1319/certs/server.key --insecure-port=0 --requestheader-client-ca-file=/var/snap/microk8s/1319/certs/front-proxy-ca.crt --requestheader-allowed-names=front-proxy-client --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --proxy-client-cert-file=/var/snap/microk8s/1319/certs/front-proxy-client.crt --proxy-client-key-file=/var/snap/microk8s/1319/certs/front-proxy-client.key
Apr 04 20:15:25    etcd[18380]: store.index: compact 768
Apr 04 20:15:25    etcd[18380]: finished scheduled compaction at 768 (took 2.587079ms)
Apr 04 20:17:35    microk8s.daemon-apiserver[18786]: W0404 20:17:35.938620   18786 watcher.go:199] watch chan error: etcdserver: mvcc: required revision has been compacted
Apr 04 20:20:25    etcd[18380]: store.index: compact 1424
Apr 04 20:20:25    etcd[18380]: finished scheduled compaction at 1424 (took 2.938123ms)



Apr 04 20:05:22    microk8s.daemon-kubelet[18841]: ++ jq .Network /var/snap/microk8s/1319/args/flannel-network-mgr-config

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:23 (8 by maintainers)

github_iconTop GitHub Comments

7reactions
lofiguycommented, Apr 5, 2020

Hey @sweetpotatoz

I have the same problem (probably), Parrot OS (Debian based) here. Maybe little bit different. I haven’t added /snap/bin to the PATH. But when I added my output not it’s showing this. So when I do export in new session:

export PATH=$PATH:/snap/bin

I can work with microk8s. $ microk8s (…)

My question is: Do you have in new sessions /snap/bin in your PATH? If not this is the problem.

2reactions
sweetpotatozcommented, Apr 20, 2020

I’ve faced the same error and figured out that python uses user defined site-packages:

$ /snap/microk8s/current/usr/bin/python3 -m site
sys.path = [
    '/home/user',
    '/snap/microk8s/current/usr/lib/python35.zip',
    '/snap/microk8s/current/usr/lib/python3.5',
    '/snap/microk8s/current/usr/lib/python3.5/plat-x86_64-linux-gnu',
    '/snap/microk8s/current/usr/lib/python3.5/lib-dynload',
    '/home/user/.local/lib/python3.5/site-packages',
    '/snap/microk8s/current/usr/lib/python3/dist-packages',
]
USER_BASE: '/home/user/.local' (exists)
USER_SITE: '/home/user/.local/lib/python3.5/site-packages' (exists)
ENABLE_USER_SITE: True

In my case PyYAML package in /home/user/.local/lib/python3.5/site-packages has version 3.11 and an output of python says the same:

$ /snap/microk8s/current/usr/bin/python3
Python 3.5.2 (default, Oct  8 2019, 13:06:37) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> yaml.__version__
'3.11'

After deleting a directory /home/user/.local/lib/python3.5/site-packages (I have no python 3.5 anymore) I have next site-packages:

$ /snap/microk8s/current/usr/bin/python3 -m site
sys.path = [
    '/home/user',
    '/snap/microk8s/current/usr/lib/python35.zip',
    '/snap/microk8s/current/usr/lib/python3.5',
    '/snap/microk8s/current/usr/lib/python3.5/plat-x86_64-linux-gnu',
    '/snap/microk8s/current/usr/lib/python3.5/lib-dynload',
    '/snap/microk8s/current/usr/lib/python3/dist-packages',
]
USER_BASE: '/home/user/.local' (exists)
USER_SITE: '/home/user/.local/lib/python3.5/site-packages' (doesn't exist)
ENABLE_USER_SITE: True

After that microk8s starts to work:

$ microk8s status
microk8s is running
addons:
cilium: disabled
dashboard: disabled
dns: disabled
fluentd: disabled
gpu: disabled
helm: disabled
helm3: disabled
ingress: disabled
istio: disabled
jaeger: disabled
knative: disabled
kubeflow: disabled
linkerd: disabled
metallb: disabled
metrics-server: disabled
prometheus: disabled
rbac: disabled
registry: disabled
storage: disabled

Is it possible to disable ENABLE_USER_SITE for snap microk8s (environment variable PYTHONNOUSERSITE=false)?

thanks @realmfoo snap has its own python 😕 i went in here /home/user/.local/lib/python3.5/site-packages and delete rm -rf yaml and the yaml error has gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

After installing something, command not found - Server Fault
It will shows all installed files by something package. Look for files that are on */bin/ directories. Share.
Read more >
How to fix a "Command not found" error in Linux - Red Hat
5 ways to fix "Command not found" errors · 1. Include the path · 2. Add a new path · 3. Copy a...
Read more >
Linux / UNIX: Command Not Found Error and Solution - nixCraft
If a typed Unix command is not in PATH and anywhere on the system means the command or app is not installed at...
Read more >
Pip Command Not Found on Windows: A Guide | Built In
A “pip: command not found” error occurs when you haven't properly installed the package installer for Python (pip) on your computer.
Read more >
How to Fix “Command Not Found” Errors in Mac Command Line
Fixing “Command Not Found” Terminal Messages in Mac OS with $PATH Setting ... Hit return and run your command again, it should work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found