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.

enable storage failed

See original GitHub issue

Failed to execute microk8s enable storage Output is as follows

Enabling default storage class. 
sudo: unable to dlopen /usr/libexec/sudoers.so: (null). 
sudo: fatal error, unable to load plugins. 
Failed to enable storage

I have made sure that the sudoer.so library can be loaded using dlopen in c++ and the sudo command works fine.

Wish for your help!!!

inspection-report-20200913_234014.tar.gz

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
balchuacommented, Sep 14, 2020

Ok thanks. I think the script enable-storage.sh isn’t taking the system LD_LIBRARY_PATH like it is done for other enable script.

The enable-storage.sh should be using this [1], instead of just calling sudo. Thanks for reporting this.

For the meantime, to enable the storage, Create the directory where the hostpath will keep the images.

$ sudo mkdir -p /var/snap/microk8s/common/default-storage

Then apply the manifest below.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: hostpath-provisioner
  labels:
    k8s-app: hostpath-provisioner
  namespace: kube-system
spec:
  replicas: 1
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      k8s-app: hostpath-provisioner
  template:
    metadata:
      labels:
        k8s-app: hostpath-provisioner
    spec:
      serviceAccountName: microk8s-hostpath
      containers:
        - name: hostpath-provisioner
          image: cdkbot/hostpath-provisioner-amd64:1.0.0
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: PV_DIR
              value: /var/snap/microk8s/common/default-storage
          volumeMounts:
            - name: pv-volume
              mountPath: /var/snap/microk8s/common/default-storage
      volumes:
        - name: pv-volume
          hostPath:
            path: /var/snap/microk8s/common/default-storage
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: microk8s-hostpath
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: microk8s.io/hostpath
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: microk8s-hostpath
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: microk8s-hostpath
rules:
- apiGroups: [""]
  resources:
  - persistentvolumeclaims
  verbs:
  - list
  - get
  - watch
  - update
- apiGroups: [""]
  resources:
  - persistentvolumes
  verbs:
  - list
  - get
  - update
  - watch
  - create
  - delete
- apiGroups: [""]
  resources:
    - events
  verbs:
    - create
    - list
    - patch
- apiGroups: ["storage.k8s.io"]
  resources:
    - storageclasses
  verbs:
    - list
    - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: microk8s-hostpath
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: microk8s-hostpath
subjects:
  - kind: ServiceAccount
    name: microk8s-hostpath
    namespace: kube-system

[1] https://github.com/ubuntu/microk8s/blob/22a970b03a7b24ff8f733d5a91475a1babcb323a/microk8s-resources/actions/common/utils.sh#L70

1reaction
balchuacommented, Sep 14, 2020

@github1youlc

  1. The nodename has changed from localhost to VM_67_201_centos.
  2. Can you set the hostname to all small letters vm_67_201_centos

Stop and start microk8s.

Read more comments on GitHub >

github_iconTop Results From Across the Web

enable storage failed · Issue #1557 · canonical/microk8s
Failed to execute microk8s enable storage Output is as follows Enabling default storage class. sudo: unable to dlopen ...
Read more >
Storage configuration failed - error starting processes – Kaseya
SUMMARY. When doing the initial setup, the storage may fail to configure correctly. ISSUE. During the setup of storage you may receive an...
Read more >
'Insufficient storage': How to fix that error in Android and iOS
When Android shows the "Insufficient Storage Available" error · Open the Settings app, tap Storage (it should be in the System tab or...
Read more >
Enable storage bus cache with Storage Spaces on standalone ...
Enable storage bus cache with Storage Spaces on standalone servers generic failure message to create.
Read more >
Cove: Remote storage failed with error: "Failed to process "sc ...
Upgrade Backup Manager to latest version. ... Upgrade Storage Node software to latest version. This can be found here. Did this ...
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