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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot mount XFS PV #7140

Closed
PhanLe1010 opened this issue Nov 18, 2023 · 5 comments
Closed

[BUG] Cannot mount XFS PV #7140

PhanLe1010 opened this issue Nov 18, 2023 · 5 comments
Assignees
Labels
area/volume-attach-detach Volume attach & detach related kind/bug priority/0 Must be fixed in this release (managed by PO)
Milestone

Comments

@PhanLe1010
Copy link
Contributor

PhanLe1010 commented Nov 18, 2023

Describe the bug (馃悰 if you encounter this issue)

Longhorn CSI plugin failed to mount xfs PV

To Reproduce

  1. Deploy the following pod with a PVC provisioned by a SC that has xfs fsType
    kind: StorageClass
    apiVersion: storage.k8s.io/v1
    metadata:
      name: longhorn-xfs
    provisioner: driver.longhorn.io
    allowVolumeExpansion: true
    reclaimPolicy: Delete
    volumeBindingMode: Immediate
    parameters:
      numberOfReplicas: "3"
      staleReplicaTimeout: "2880" # 48 hours in minutes
      fromBackup: ""
      fsType: "xfs"
    ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: longhorn-simple-pvc
      namespace: default
    spec:
      accessModes:
        - ReadWriteOnce
      storageClassName: longhorn-xfs
      resources:
        requests:
          storage: 1Gi
    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: longhorn-simple-pod
      namespace: default
    spec:
      restartPolicy: Always
      containers:
        - name: volume-test
          image: nginx:stable-alpine
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: volv
              mountPath: /data
          ports:
            - containerPort: 80
      volumes:
        - name: volv
          persistentVolumeClaim:
            claimName: longhorn-simple-pvc
    
  2. The pod cannot becomes running due to PV failed to mount
      Warning  FailedMount             99s (x9 over 3m48s)  kubelet                  MountVolume.MountDevice failed for volume "pvc-b44a1e7c-29eb-4200-8bf2-6ea066aa1d85" : rpc error: code = Internal desc = format of disk "/dev/longhorn/pvc-b44a1e7c-29eb-4200-8bf2-6ea066aa1d85" failed: type:("xfs") target:("/var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/d525c060b49d93252a9e9d29487622c4becf1d44d28aa1700389a75736e64876/globalmount") options:("defaults") errcode:(executable file not found in $PATH) output:()
    

Expected behavior

pod is able to become running

Environment

  • Longhorn version: master-head 11/17/2023
@PhanLe1010 PhanLe1010 added kind/bug require/qa-review-coverage Require QA to review coverage require/backport Require backport. Only used when the specific versions to backport have not been definied. and removed require/qa-review-coverage Require QA to review coverage require/backport Require backport. Only used when the specific versions to backport have not been definied. labels Nov 18, 2023
@innobead innobead added this to the v1.6.0 milestone Nov 18, 2023
@innobead innobead added priority/0 Must be fixed in this release (managed by PO) area/volume-attach-detach Volume attach & detach related labels Nov 18, 2023
@innobead
Copy link
Member

Is this related to the recent commit for reducing image size?

cc @ChanYiLin

@PhanLe1010
Copy link
Contributor Author

PhanLe1010 commented Nov 18, 2023

Looks like there is no mkfs.xfs command inside longhorn-csi-plugin pod

longhorn-csi-plugin-9sgss:/ # mkfs.xfs 
bash: mkfs.xfs: command not found

This lead to the error above
Warning FailedMount 99s (x9 over 3m48s) kubelet MountVolume.MountDevice failed for volume "pvc-b44a1e7c-29eb-4200-8bf2-6ea066aa1d85" : rpc error: code = Internal desc = format of disk "/dev/longhorn/pvc-b44a1e7c-29eb-4200-8bf2-6ea066aa1d85" failed: type:("xfs") target:("/var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/d525c060b49d93252a9e9d29487622c4becf1d44d28aa1700389a75736e64876/globalmount") options:("defaults") errcode:(executable file not found in $PATH) output:()

Which could be the side effect of the PR longhorn/longhorn-manager#2299

@longhorn-io-github-bot
Copy link

longhorn-io-github-bot commented Nov 18, 2023

Pre Ready-For-Testing Checklist

  • Where is the reproduce steps/test steps documented?
    The reproduce steps/test steps are at: issue description

  • Have the backend code been merged (Manager, Engine, Instance Manager, BackupStore etc) (including backport-needed/*)?
    The PR is at Fix bug cannot mount xfs PV聽longhorn-manager#2302

@roger-ryao
Copy link

Our regression test includes a case covering this issue at https://ci.longhorn.io/job/public/job/master/job/sles/job/amd64/job/longhorn-tests-sles-amd64/724/testReport/junit/tests/test_csi/test_xfs_pv/. We can verify this issue through our regression testing.

@roger-ryao
Copy link

roger-ryao commented Nov 23, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/volume-attach-detach Volume attach & detach related kind/bug priority/0 Must be fixed in this release (managed by PO)
Projects
None yet
Development

No branches or pull requests

4 participants