canonical / canonical/microceph

Tentacle 20.2.1: Dashboard fails to start due to missing mgr/smb module (ModuleNotFoundError: No module named 'smb')

Open
#811 1 comment 0 reactions 1 assignee Claimed by @johnramsden View on GitHub
Dominant language
Go
Stars
396
Forks
74
Avg merge
2d 20h
Merged PRs (30d)
7

Description

# Environment

## MicroCeph

```
Name: microceph
Channel: tentacle/stable
Version: 20.2.1+snap074a450407
Revision: 1834
```

The same issue is also reproducible with:

```
Channel: tentacle/candidate
Revision: 1856
```

## Ceph

```
ceph version 20.2.1 (6a49aff47758778a5f5951e731d437c317f72fb2)
tentacle (stable)
```

Ubuntu 24.04 LTS.

---

# Summary

Enabling the Dashboard module causes the manager to fail with:

```
ModuleNotFoundError: No module named 'smb'
```

The Dashboard never starts and no process listens on the configured HTTP port.

This appears to be a packaging issue where the Dashboard SMB controller is present but the corresponding `mgr/smb` module is not included in the MicroCeph snap.

---

# Steps to reproduce

Enable the dashboard:

```bash
ceph mgr module enable dashboard
```

Configure HTTP:

```bash
ceph config set mgr mgr/dashboard/ssl false
ceph config set mgr mgr/dashboard/server_port 7000
```

Create the dashboard user.

Restart the dashboard (or restart the manager).

---

# Expected behaviour

Dashboard starts successfully and listens on the configured port.

Example:

```
http://:7000
```

---

# Actual behaviour

Cluster health reports:

```
HEALTH_ERR
Module 'dashboard' has failed:
No module named 'smb'
```

The dashboard service is advertised:

```bash
ceph mgr services
```

returns

```json
{
"dashboard": "http://192.168.88.43:7000/"
}
```

However no process actually listens on port 7000:

```bash
ss -ltnp | grep 7000
```

returns nothing.

---

# Traceback

```
Unhandled exception from module 'dashboard'

File "/usr/share/ceph/mgr/dashboard/controllers/smb.py", line 8

from smb.enums import Intent

ModuleNotFoundError: No module named 'smb'
```

---

# Investigation

Inside the MicroCeph runtime:

```
SNAP=/snap/microceph/1834

PYTHONPATH=/snap/microceph/1834/lib/python3/dist-packages:
/snap/microceph/1834/lib/python3.12/site-packages
```

The Dashboard controller exists:

```
/usr/share/ceph/mgr/dashboard/controllers/smb.py
```

However the corresponding manager module does not exist:

```bash
ls -la /usr/share/ceph/mgr/smb
```

returns

```
No such file or directory
```

The manager module directory contains:

```
alerts
balancer
crash
dashboard
devicehealth
...
nfs
orchestrator
prometheus
...
```

but no `smb` directory.

Python import also confirms the missing package:

```bash
python3 -c "import smb"
```

returns

```
ModuleNotFoundError: No module named 'smb'
```

This indicates that:

* `dashboard/controllers/smb.py` is present
* `mgr/smb` is missing
* importing `smb.enums` therefore always fails
* the Dashboard aborts startup before opening the configured port

---

# Related upstream work

This appears to match the packaging issue addressed by upstream Ceph PR:

https://github.com/ceph/ceph/pull/67510

The PR description states that the Dashboard imports the SMB manager module while the package was not installed by `ceph-mgr-modules-core`.

It looks like the fix is not present in the current MicroCeph Tentacle snap (1834 and 1856).

---

# Additional observations

While investigating I noticed a few additional import errors during Dashboard startup:

```
Module 'jmespath' is not installed.
Module 'xmltodict' is not installed.
```

and

```
Failed to import NVMeoFClient
```

These do **not** appear to be the direct cause of the Dashboard startup failure.

The fatal exception remains:

```
ModuleNotFoundError: No module named 'smb'
```

However they may indicate additional packaging inconsistencies affecting optional Dashboard components.

---

# Possible root cause

Based on the above investigation, the issue appears to be a packaging inconsistency inside the MicroCeph snap:

* Dashboard SMB controller is included.
* The corresponding `mgr/smb` module is missing.
* Dashboard unconditionally imports `smb.enums`.
* Dashboard aborts initialization before CherryPy starts serving requests.

If the SMB manager module is optional, another possible improvement would be for the Dashboard to gracefully skip loading the SMB controller when the module is unavailable instead of preventing the entire Dashboard from starting.

---

Thank you for your work on MicroCeph.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.