Skip to content

Commit 8a40298

Browse files
committed
nfs: log error when go-ceph fails to create the export
With Ceph Tentacle creating a (the first?) NFS-export fails with: ``` Error EINVAL: Traceback (most recent call last): File "/usr/share/ceph/mgr/mgr_module.py", line 2010, in _handle_command return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf) File "/usr/share/ceph/mgr/mgr_module.py", line 534, in call return self.func(mgr, **kwargs) File "/usr/share/ceph/mgr/object_format.py", line 592, in _format_response robj = f(*args, **kwargs) File "/usr/share/ceph/mgr/nfs/module.py", line 45, in _cmd_nfs_export_create_cephfs earmark_resolver = CephFSEarmarkResolver(self) File "/usr/share/ceph/mgr/mgr_util.py", line 356, in __init__ self._cephfs_client = client or CephfsClient(mgr) File "/usr/share/ceph/mgr/mgr_util.py", line 318, in __init__ self.connection_pool = CephfsConnectionPool(self.mgr) File "/usr/share/ceph/mgr/mgr_util.py", line 223, in __init__ self.timer_task.start() File "/usr/lib64/python3.9/threading.py", line 899, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't start new thread ``` It seems this can only happen when the CLI is used, that means go-ceph failed to create the export in the first place. It would be useful to log the go-ceph failure, so that improving is possible. Signed-off-by: Niels de Vos <ndevos@ibm.com>
1 parent ea29841 commit 8a40298

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/nfs/controller/volume.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/ceph/ceph-csi/internal/cephfs/store"
3030
fsutil "github.com/ceph/ceph-csi/internal/cephfs/util"
3131
"github.com/ceph/ceph-csi/internal/util"
32+
"github.com/ceph/ceph-csi/internal/util/log"
3233
)
3334

3435
const (
@@ -169,6 +170,10 @@ func (nv *NFSVolume) CreateExport(backend *csi.Volume) error {
169170
case strings.Contains(err.Error(), "Export already exists"):
170171
return nil
171172
case strings.Contains(err.Error(), "rados: ret=-2"): // try with the old command
173+
log.ErrorLogMsg("going to fallback to cli, "+
174+
"go-ceph failed to create export %q in NFS-cluster %q: %v",
175+
nv, nfsCluster, err)
176+
172177
break
173178
default: // any other error
174179
return fmt.Errorf("exporting %q on NFS-cluster %q failed: %w",

0 commit comments

Comments
 (0)