From 9fe7d1612ec58dd2d2f6f1c3645bef63aa57f83b Mon Sep 17 00:00:00 2001 From: Mudit Agarwal Date: Tue, 19 May 2020 17:59:31 +0530 Subject: [PATCH] journal: In mount failure case, suggest to check the kernel logs When mounting fails, the node-plugin should give a suggestion to check the kernel logs so that users can report problems better. Edited the existing log to include the message in both rbd and cephfs. Fixes: https://github.com/ceph/ceph-csi/issues/1006 Signed-off-by: Mudit Agarwal --- internal/cephfs/nodeserver.go | 5 ++++- internal/rbd/nodeserver.go | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/cephfs/nodeserver.go b/internal/cephfs/nodeserver.go index ddb39b31d..57d641534 100644 --- a/internal/cephfs/nodeserver.go +++ b/internal/cephfs/nodeserver.go @@ -151,7 +151,10 @@ func (*NodeServer) mount(ctx context.Context, volOptions *volumeOptions, req *cs klog.V(4).Infof(util.Log(ctx, "cephfs: mounting volume %s with %s"), volID, m.name()) if err = m.mount(ctx, stagingTargetPath, cr, volOptions); err != nil { - klog.Errorf(util.Log(ctx, "failed to mount volume %s: %v"), volID, err) + klog.Errorf(util.Log(ctx, + "failed to mount volume %s: %v Check dmesg logs if required."), + volID, + err) return status.Error(codes.Internal, err.Error()) } return nil diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 3240112fe..5bdcb0064 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -436,7 +436,13 @@ func (ns *NodeServer) mountVolumeToStagePath(ctx context.Context, req *csi.NodeS err = diskMounter.FormatAndMount(devicePath, stagingPath, fsType, opt) } if err != nil { - klog.Errorf(util.Log(ctx, "failed to mount device path (%s) to staging path (%s) for volume (%s) error %s"), devicePath, stagingPath, req.GetVolumeId(), err) + klog.Errorf(util.Log(ctx, + "failed to mount device path (%s) to staging path (%s) for volume "+ + "(%s) error: %s Check dmesg logs if required."), + devicePath, + stagingPath, + req.GetVolumeId(), + err) } return err }