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

fix(csi): add node info to failed mount logging. (backport #2686) #2714

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csi/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func NewPluginDeployment(namespace, serviceAccount, nodeDriverRegistrarImage, li
},
{
Name: "host",
MountPath: "/rootfs", // path is required for namespaced mounter
MountPath: "/host",
MountPropagation: &MountPropagationBidirectional,
},
{
Expand Down
12 changes: 12 additions & 0 deletions csi/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (

"github.com/longhorn/longhorn-manager/csi/crypto"

lhns "github.com/longhorn/go-common-libs/ns"

longhornclient "github.com/longhorn/longhorn-manager/client"
longhorn "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta2"
)
Expand Down Expand Up @@ -269,6 +271,16 @@ func (ns *NodeServer) nodeStageSharedVolume(volumeID, shareEndpoint, targetPath
if err == nil {
return nil
}
// Still failed. Log with mounting node and kernel version for possible troubleshooting. Don't step on actual mount error.
kernelRelease, err1 := lhns.GetKernelRelease()
if err1 != nil {
kernelRelease = err1.Error()
}
osDistro, err2 := lhns.GetOSDistro()
if err2 != nil {
osDistro = err2.Error()
}
log.WithError(err).Warnf("Failed to mount volume %v on node %s with kernel release %s, os distro %s", volumeID, ns.nodeID, kernelRelease, osDistro)
}
return status.Error(codes.Internal, err.Error())
}
Expand Down
Loading